Skip to content

Delete a model dependency

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

Delete model dependency

modelId
required
string format: uuid
dependencyId
required
string format: uuid

OK

Media typeapplication/json

What removing a dependency did. An edge whose target another import still provides keeps its content and loses only its declaration, leaving it in place as a transitive edge.

object
outcome
required
string
Allowed values: REMOVED DEMOTED
dependency
required
One of: discriminator: type
INTERNAL
object
id
required
string format: uuid
type
required
string
Allowed value: INTERNAL
name
required
string
modelId
required
string format: uuid
commitId
required
string format: uuid
versionRef

The pin as authored: @HEAD to track the target’s head, or a version name. Absent on edges older than the field, which track the head.

string
transitive

Whether the edge is derived from another import’s closure rather than declared.

boolean
providedVia
Array<object>

A direct dependency whose import closure also provides this edge’s target.

object
dependencyId
required
string format: uuid
name
required
string

Example

{
"outcome": "REMOVED",
"dependency": {
"type": "INTERNAL"
}
}

The dependency cannot be removed: elements are connected to it, answered as ChangeValidationProblem with one dependency-connected error per connected element naming it (elementId, elementName), checked first, also where another dependency brings the target along and the edge would otherwise be demoted; or elements of the model refer into it.

Media typeapplication/problem+json
Any of:

A Problem that additionally carries errors when a staged change was refused, with nothing written. Its own type is what tells it from the plain 400 of a malformed body. Separate from Problem.violations, which stays what it is: request-body validation, one entry per rejected field of the request itself.

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 a refused change from the plain 400 of a malformed body.

string format: uri
Allowed values: https://modeldesk.io/problems/change-validation-failed
errors
required

Every reason the change was refused, not only the first, so a whole change can be corrected in one round trip. Never empty: a refusal carries at least one reason. A later entry may still be a consequence of an earlier failing action, which the messages say rather than hide. An entry’s actionIndex counts into the change’s own actions.

Array<object>
>= 1 items

One reason a change was not applied, in the form an agent can correct itself from: which action was at fault, what kind of fault it was, and which element and property it was about. The same shape wherever a refusal is reported, so one piece of client code renders all of them.

code and message answer different readers. The code is a stable constant a client branches on without parsing prose; the message is the human sentence and may be reworded at any time. Every member a throw site did not know is left off the wire rather than sent as null, so a reader never has to tell “not applicable” from “unknown”.

object
actionIndex

Where the failing action sits in the change’s own action list, counted from zero. Absent, together with actionType, when the fault belongs to the change as a whole rather than to one of its actions.

integer
actionType

The type of the failing action, exactly as the caller sent it, which for a not-stageable refusal is a type no variant answers to. Absent together with actionIndex.

string
code
required

A stable kebab-case constant a client branches on rather than parsing the message.

A refusal of the change as a whole carries one of not-stageable, updater-rejected, write-rejected, chain-too-long, change-too-large or closure-action-must-stand-alone. That list is closed, except where the errors member carrying this error names one more of its own. A refusal about one element or one of its properties carries an element-level code from the same namespace instead, such as element-not-found, owner-not-found, already-exists, unknown-property, invalid-target, multiplicity-violated or invalid-value, and a refused dependency action one of dependency-target-not-found, dependency-exists, dependency-in-use, dependency-connected, members-missing-in-version, dependency-not-direct, dependency-version-differs, dependency-snapshot-missing, dependency-metamodel-not-allowed or dependency-not-found, and a relation a change writes into content of a dependency the model no longer holds, which a rebase meets after the branch removed that dependency, dependency-removed, naming the referring element and the relation. A DEPENDENCY_CONNECT or DEPENDENCY_DISCONNECT may carry copy-not-replaceable, element-connected, element-not-connected or connection-changed, and a write that would set, change or clear an element’s connection other than through those two connection-not-writable. That second set is stable in the sense that a code is never reused for something else, but it is open: new ones are added as refusals learn to name themselves, so a client treats one it does not recognise as a refusal it cannot special-case rather than as a malformed response.

string
message
required

The sentence a human reads. Reworded freely, never parsed.

string
elementId

The element the failure is about, where the refusal named one.

string format: uuid
elementName

The name elementId is listed under, where the refusal read it: the connected element a dependency-connected error names, the member a members-missing-in-version error names.

string
property

The attribute or relation the failure is about, where the refusal named one.

string
missingMember

On a members-missing-in-version error: a member a connected element holds by reference that the version its dependency moves to lacks, the element that holds it, and what uses it.

object
memberId
required

The member, an element of the version the dependency leaves.

string format: uuid
memberName
required

The name it is listed under, its type when nothing names it.

string
memberType
required

Its type, as stored.

string
holderId
required

The element that holds the member, one whose type represents a model and that is connected to the dependency.

string format: uuid
holderName
required

The name the element that holds the member is listed under, its type when nothing names it.

string
missingChild

For a member the new version still holds: the owned child of it that the version lacks and the model uses, which makes the member count as missing. Absent for a member the version lacks itself.

object
id
required
string format: uuid
name
required

The name it is listed under, its type when nothing names it.

string
type
required
string
uses
required

The model’s elements referring to the member or one of its owned children, through an authored relation or a term reference, each once per relation, in element id order. The member relation of the element that holds it holds the member rather than using it and is not listed.

Array<object>
object
elementId
required
string format: uuid
elementName
required
string
relation
required

The key the reference is stored under.

string
relationLabel

The name the metamodel shows for the relation; absent when it declares none.

string
errorCounts

Present only when errors was cut short at its bound: every reason found, counted by code, so a client can say how many there are without parsing detail. A refused DEPENDENCY_UPDATE with many missing members answers its first ones in errors and their total under members-missing-in-version; POST /models/{modelId}/dependencies/{dependencyId}/version-change-preview lists them all.

object
key
additional properties
integer

Example

{
"type": "https://modeldesk.io/problems/change-validation-failed"
}

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"
}
]
}

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"
}
]
}