Update a model dependency
const url = 'https://api.modeldesk.io/models/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0/dependencies/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"versionRef":"example","keepMissingMembersAsCopies":false}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://api.modeldesk.io/models/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0/dependencies/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0 \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "versionRef": "example", "keepMissingMembersAsCopies": false }'Update model dependency
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”Request Body
Section titled “Request Body”Re-pins an internal or managed dependency. An external dependency has no pin to move.
object
The new pin: omit or @HEAD to re-resolve the target’s current head, or a version name of the target to pin that version.
When elements connected to the dependency hold members by reference that the new pin lacks, keep each as an owned copy of the version left, in the element that held it, with the model’s references pointing at it. Without it such a repin is refused with the ChangeValidationProblem, one members-missing-in-version error per member and holding element, each carrying missingMember, and nothing is written.
Responses
Section titled “Responses”OK
object
object
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.
Whether the edge is derived from another import’s closure rather than declared.
A direct dependency whose import closure also provides this edge’s target.
object
object
The metamodel the document at location was interpreted through. Absent means the owning model’s own metamodel, which is what every edge created before this field existed relied on.
Whether the edge is derived from another import’s closure rather than declared.
A direct dependency whose import closure also provides this edge’s target.
object
A dependency the platform attaches to an instance model for each pinned metamodel or extension release that carries a built-in element model. Shaped like an internal dependency, plus the pin it was sourced from. Never transitive.
object
The metamodel or extension whose pinned release sourced this dependency.
The version name of that release.
Always false; present for symmetry with the other dependency types.
A direct dependency whose import closure also provides this edge’s target.
object
object
object
object
object
object
object
object
Owning model of the referenced element when it differs from the containing model (cross-model reference, e.g. a lineage base element). Omitted for same-model references.
The values the element holds that its type declares no property for; absent when none.
A value an element holds under no binding its type declares, kept so a round trip loses nothing.
object
object
object
object
Owning model of the referenced element when it differs from the containing model (cross-model reference, e.g. a lineage base element). Omitted for same-model references.
A structure the import holds without an element, kept with its own properties inside the layer of the element that refers to it. A node is held once; any other place that refers to it holds a reference to it instead.
object
The property that links the holding element or the enclosing node to this node; absent on a node no property links to.
The node’s global identity in the format’s own terms; absent on an anonymous node.
A label unique within the model, set only on an anonymous node that is referred to more than once.
Whether this entry only points at the node another entry holds under the same localId.
Whether the node is an ordered list, whose entries are its members in order.
Where an element was derived from: the source and rules models, and per property the source values it read.
object
object
object
object
Owning model of the referenced element when it differs from the containing model (cross-model reference, e.g. a lineage base element). Omitted for same-model references.
object
object
object
Owning model of the referenced element when it differs from the containing model (cross-model reference, e.g. a lineage base element). Omitted for same-model references.
object
On the answer to a version change that kept members of connected elements as owned copies: the references those copies, or elements referring to a kept member, left out. Absent everywhere else.
A reference that writing members of a connected element as owned copies would leave out, or left out: by a disconnection or by a version change keeping copies.
object
The element that loses the reference: the member or owned child a copy would be made of, by its id in the version depended on, or an element of the model whose term reference points at a member.
The key the reference is stored under.
The name the metamodel shows for the relation; absent when it declares none.
Example
{ "type": "INTERNAL", "model": { "elements": { "additionalProperty": { "extensionLayer": [ { "kind": "attribute" } ], "lineage": { "properties": [ { "propertyType": "ATTRIBUTE", "sources": [ { "propertyType": "ATTRIBUTE", "role": "PRIMARY" } ] } ] } } } }, "droppedReferences": [ { "reason": "TARGET_NOT_REACHABLE" } ]}Bad request; or the new pin lacks members that connected elements hold and keepMissingMembersAsCopies is not set, answered as ChangeValidationProblem with one members-missing-in-version error per member and holding element.
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
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.
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.
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.
object
Stable constant a client branches on, which is what tells a refused change from the plain 400 of a malformed body.
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.
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
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.
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.
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.
The sentence a human reads. Reworded freely, never parsed.
The element the failure is about, where the refusal named one.
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.
The attribute or relation the failure is about, where the refusal named one.
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
The member, an element of the version the dependency leaves.
The name it is listed under, its type when nothing names it.
Its type, as stored.
The element that holds the member, one whose type represents a model and that is connected to the dependency.
The name the element that holds the member is listed under, its type when nothing names it.
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
The name it is listed under, its type when nothing names it.
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.
object
The key the reference is stored under.
The name the metamodel shows for the relation; absent when it declares none.
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
An RFC 9457 problem document, always sent as application/problem+json.
object
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.
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.
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.
object
Example
{ "type": "https://modeldesk.io/problems/change-validation-failed"}Not found
An RFC 9457 problem document, always sent as application/problem+json.
object
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.
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.
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.
object
Example generated
{ "type": "https://example.com", "title": "example", "status": 1, "detail": "example", "instance": "example", "violations": [ { "property": "example", "message": "example" } ]}default
Section titled “default”Error
An RFC 9457 problem document, always sent as application/problem+json.
object
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.
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.
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.
object
Example generated
{ "type": "https://example.com", "title": "example", "status": 1, "detail": "example", "instance": "example", "violations": [ { "property": "example", "message": "example" } ]}