Skip to content

Delete an import

DELETE
/imports/{importId}
curl --request DELETE \
--url https://api.modeldesk.io/imports/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0 \
--header 'Authorization: Bearer <token>'

Delete import. An import that waits for review in a model (READY with a targetModelId) is discarded by anyone who may change that model, not only by its creator or an organization admin. The model’s import line goes back to the last commit a branch or a draft has merged, or to the model’s first commit when none has, only while its head is still the import’s commit; then the import is deleted. A head a branch already reaches moves nothing, so an import whose file changed nothing is deleted with the line where it was. The model’s branches are untouched. Any other import is deleted by its creator or an organization admin; one into a model also needs write access to it, and a superseded one is only deleted. An import into a model is found by read access to that model, as its plan and merge are, so a writer of the model discards a waiting import they may not read by its own rules; anyone who may not read the model gets 404. The line is moved back and the import deleted in one transaction held to the line as read, so a discard and a merge of the same import never both take effect.

importId
required
string format: uuid

No content

The caller is not signed in.

Media typeapplication/problem+json

An RFC 9457 problem document, always sent as application/problem+json.

object
type

Present only on a typed refusal, whose own schema requires it and fixes its value. An untyped problem omits it, which RFC 9457 defines as about:blank: the status and title are all there is to branch on.

string format: uri
title
required
string
status
required
integer
detail
required
string
instance

The path of the request that was refused. Absent when the request was refused before it reached the application’s handlers: a 401 for a missing or unusable access token, and a 403 for a service account whose scopes do not reach the route.

string
violations

Present on a 400 raised by request-body validation, and on a 422 that refuses named fields (a malformed slug or namespace prefix). Each entry names the rejected property, so a client can attach the message to the field that caused it rather than showing one error for the whole form.

Array<object>
object
property
required
string
message
required
string

Example generated

{
"type": "https://example.com",
"title": "example",
"status": 1,
"detail": "example",
"instance": "example",
"violations": [
{
"property": "example",
"message": "example"
}
]
}

The caller is signed in and may not delete the import, or may not change the model it goes into.

Media typeapplication/problem+json

An RFC 9457 problem document, always sent as application/problem+json.

object
type

Present only on a typed refusal, whose own schema requires it and fixes its value. An untyped problem omits it, which RFC 9457 defines as about:blank: the status and title are all there is to branch on.

string format: uri
title
required
string
status
required
integer
detail
required
string
instance

The path of the request that was refused. Absent when the request was refused before it reached the application’s handlers: a 401 for a missing or unusable access token, and a 403 for a service account whose scopes do not reach the route.

string
violations

Present on a 400 raised by request-body validation, and on a 422 that refuses named fields (a malformed slug or namespace prefix). Each entry names the rejected property, so a client can attach the message to the field that caused it rather than showing one error for the whole form.

Array<object>
object
property
required
string
message
required
string

Example generated

{
"type": "https://example.com",
"title": "example",
"status": 1,
"detail": "example",
"instance": "example",
"violations": [
{
"property": "example",
"message": "example"
}
]
}

Not found

Media typeapplication/problem+json

An RFC 9457 problem document, always sent as application/problem+json.

object
type

Present only on a typed refusal, whose own schema requires it and fixes its value. An untyped problem omits it, which RFC 9457 defines as about:blank: the status and title are all there is to branch on.

string format: uri
title
required
string
status
required
integer
detail
required
string
instance

The path of the request that was refused. Absent when the request was refused before it reached the application’s handlers: a 401 for a missing or unusable access token, and a 403 for a service account whose scopes do not reach the route.

string
violations

Present on a 400 raised by request-body validation, and on a 422 that refuses named fields (a malformed slug or namespace prefix). Each entry names the rejected property, so a client can attach the message to the field that caused it rather than showing one error for the whole form.

Array<object>
object
property
required
string
message
required
string

Example generated

{
"type": "https://example.com",
"title": "example",
"status": 1,
"detail": "example",
"instance": "example",
"violations": [
{
"property": "example",
"message": "example"
}
]
}

The model’s import line or the import kept moving while the import was discarded, on a second attempt too (BranchHeadConflictProblem); the import may still be waiting, so read it again before discarding it. Or a merge of the import landed after it was read, and the merged import is not deleted (ImportNotMergeableProblem with merged).

Media typeapplication/problem+json
One of:

A Problem answered when a gated write lost its compare-and-set: the head the write was written against was no longer the ref’s head when the write reached it, so nothing was written. It names the ref and the two heads, and carries no gap.

It stands in for DraftHeadConflictProblem where the gap cannot be walked: a landing whose draft was discarded while the refusal was being built, and a rebase whose swap lost to a change staged while the replay was running. On a rebase the conflict.branchId is the draft’s own ref id rather than the branch it targets, because the ref that moved is the draft.

object
type
required

Present only on a typed refusal, whose own schema requires it and fixes its value. An untyped problem omits it, which RFC 9457 defines as about:blank: the status and title are all there is to branch on.

string format: uri
title
required
string
status
required
integer
detail
required
string
instance

The path of the request that was refused. Absent when the request was refused before it reached the application’s handlers: a 401 for a missing or unusable access token, and a 403 for a service account whose scopes do not reach the route.

string
violations

Present on a 400 raised by request-body validation, and on a 422 that refuses named fields (a malformed slug or namespace prefix). Each entry names the rejected property, so a client can attach the message to the field that caused it rather than showing one error for the whole form.

Array<object>
object
property
required
string
message
required
string
type
required

Stable constant a client branches on, which is what tells this 409 from the others the same routes answer with.

string format: uri
Allowed values: https://modeldesk.io/problems/branch-head-conflict
detail
required

Always the sentence Branch HEAD has advanced since this commit's baseline., whichever ref moved. What a human reads, never parsed.

string
conflict
required
object
branchId
required

The ref whose head the write was gated on.

string format: uuid
baselineCommitId
required

The head the write was written against, which is no longer the current one.

string format: uuid
currentHeadCommitId

The head as it now stands. Absent when the follow-up read that fills it found no ref, which is what a discarded draft leaves behind.

string format: uuid

Example

{
"type": "https://modeldesk.io/problems/branch-head-conflict"
}

Error

Media typeapplication/problem+json

An RFC 9457 problem document, always sent as application/problem+json.

object
type

Present only on a typed refusal, whose own schema requires it and fixes its value. An untyped problem omits it, which RFC 9457 defines as about:blank: the status and title are all there is to branch on.

string format: uri
title
required
string
status
required
integer
detail
required
string
instance

The path of the request that was refused. Absent when the request was refused before it reached the application’s handlers: a 401 for a missing or unusable access token, and a 403 for a service account whose scopes do not reach the route.

string
violations

Present on a 400 raised by request-body validation, and on a 422 that refuses named fields (a malformed slug or namespace prefix). Each entry names the rejected property, so a client can attach the message to the field that caused it rather than showing one error for the whole form.

Array<object>
object
property
required
string
message
required
string

Example generated

{
"type": "https://example.com",
"title": "example",
"status": 1,
"detail": "example",
"instance": "example",
"violations": [
{
"property": "example",
"message": "example"
}
]
}