Create a model dependency
const url = 'https://api.modeldesk.io/models/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0/dependencies';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"type":"INTERNAL","modelId":"2489E9AD-2EE2-8E00-8EC9-32D5F69181C0","versionRef":"example","location":"https://example.com","filename":"example","binaryData":"example","loader":"example","metamodelId":"2489E9AD-2EE2-8E00-8EC9-32D5F69181C0"}'};
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 \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "type": "INTERNAL", "modelId": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "versionRef": "example", "location": "https://example.com", "filename": "example", "binaryData": "example", "loader": "example", "metamodelId": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0" }'Create model dependency
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”Request Body
Section titled “Request Body”object
The model to depend on. Required for an internal dependency.
Pin selector for an internal dependency: omit or @HEAD to track the target’s head, or a version name to pin that version. Ignored for an external dependency.
The address to dereference the document from. Exactly one of location and filename is given for an external dependency; naming both, or neither, is refused rather than resolved by precedence, since a silent preference would acquire the document the caller did not mean.
The name of the file the document was uploaded as, given with binaryData instead of location. It names the dependency, and it is what a second upload is refused by: a corrected file submitted under a name the model already holds is the same acquisition made again, not a second one. The dependency’s own location is urn:upload:<sha-256>/<filename> — derived from the bytes, because the cached snapshot every later read resolves through is stored under it, and a location keyed on the name alone would serve one upload’s content to another’s model.
The uploaded document’s bytes. Required with filename.
Which loader reads the document, by name, for the acquisition where the metamodel alone does not say: UML is served by an XMI reader and an EAP reader, an application profile from a file by a DSV reader and a SHACL one, and each parses the bytes into a different model. Omit wherever a single loader claims the metamodel for the source at hand, which is every other case; a request that needs one and omits it is refused with the names to choose from.
The metamodel the document at location is interpreted through. Valid only with type: EXTERNAL, and only for a metamodel the owning model is allowed to depend on; omit to interpret the document as the owning model’s own metamodel.
Responses
Section titled “Responses”Created
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
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" } ]}The model is the caller’s to read but not to change, answered with the plain problem. Or the caller is an agent acting for a person: the person has not granted committing, which this route needs since it commits to main directly (AgentCommitNotGrantedProblem), or the owning organization has not enabled the agent’s AI platform (AgentPlatformNotEnabledProblem) or caps agents below acting (AgentLevelNotAllowedProblem).
A Problem answered when an agent acting for a person tried to land work on a shared branch, and the person did not grant it the right to commit: a merge, or a draft landing on a branch whose name does not start with agent/ (in any case). Nothing was written. Such an agent lands its draft on a branch of its own, which a person reviews and merges.
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 this 403 from the plain one the same routes answer for a model the caller may not change.
A Problem answered when an agent acting for a person made a request that reaches further than the maximum level the organization that owns the model lets agents reach, set in the organization’s AI agent platforms setting: staging into a draft or working on a branch where the maximum is read, a merge, a landing on a branch that is not an agent’s own, or taking back or landing another’s staged change where it is propose, and anything that reaches people outside the organization where it is below publish. The person’s grant does not lift it, since a grant spans the person’s organizations and the maximum is each organization’s own; an organization admin can raise it. Nothing was written. A change of the setting applies to new requests within a minute.
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 this 403 from the plain one the same routes answer for a model the caller may not change, and from the refusals a permission the person grants lifts.
A Problem answered when an agent acting for a person reached a model whose owning organization has not enabled the AI platform the agent runs on, which its token names. Model content reaches the platform an agent runs on, so the organization decides: until an organization admin turns the platform on in the organization’s AI agent platforms setting, every route on the model refuses the agent, conditional reads and the events stream included, and the model list and every page that names other models leave the organization’s models out. A change of the setting applies to new requests within a minute; an events stream that is already open ends at its token’s expiry, at most ten minutes later.
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 this 403 from the plain one the same routes answer for a model the caller may not read.
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/agent-commit-not-granted"}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" } ]}The caller is an agent acting for a person, and the person’s agents already made the server fetch as many documents within the hour as the bound allows, answered as AgentFetchRateLimitedProblem: before anything is fetched for a dependency that names an address, or at the first document past the bound that the address or an uploaded document names in turn. Nothing was stored.
A Problem answered when an agent acting for a person would make the server fetch one document more than that person’s agents may within the hour, whether the agent named its address or an uploaded document did; an address refused before any connection counts as one. A guardrail against the server being used to send requests to third parties, counted on each server instance in memory, not a quota. The agent sends the documents’ content instead, or tries again later.
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.
The number of documents the bound admits within window.
The time the bound counts over, in seconds.
Example
{ "type": "https://modeldesk.io/problems/agent-fetch-rate-limited"}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" } ]}