Skip to content

Create a model dependency

POST
/models/{modelId}/dependencies
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

modelId
required
string format: uuid
Media typeapplication/json
object
type
required
string
Allowed values: INTERNAL EXTERNAL MANAGED
modelId

The model to depend on. Required for an internal dependency.

string format: uuid
versionRef

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.

string
location

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.

string format: uri
filename

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.

string
binaryData

The uploaded document’s bytes. Required with filename.

string
loader

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.

string
metamodelId

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.

string format: uuid

Created

Media typeapplication/json
object
One of:
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
model
required
object
rootElementId
required
string format: uuid
elements
required
object
key
additional properties
object
id
required
string format: uuid
type
required
string
external
boolean
attributes
object
key
additional properties
array
relations
object
key
additional properties
object
key
additional properties
Array<object>
object
id
required
string format: uuid
owned
required
boolean
modelId

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.

string format: uuid
extensionLayer

The values the element holds that its type declares no property for; absent when none.

Array

A value an element holds under no binding its type declares, kept so a round trip loses nothing.

One of: discriminator: kind
attribute
object
kind
required
string
Allowed value: attribute
key
string
lexicalValue
string
typeIdentifier
string
qualifiers
object
key
additional properties
string
lineage

Where an element was derived from: the source and rules models, and per property the source values it read.

object
sourceModels
Array<object>
object
modelId
string format: uuid
commitId
string format: uuid
rulesModels
Array<object>
object
modelId
string format: uuid
commitId
string format: uuid
generatedBy
object
id
required
string format: uuid
owned
required
boolean
modelId

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.

string format: uuid
properties
Array<object>
object
propertyName
string
propertyType
string
Allowed values: ATTRIBUTE RELATION
sources
Array<object>
object
sourceModelId
string format: uuid
sourceElementId
string format: uuid
sourceProperty
string
propertyType
string
Allowed values: ATTRIBUTE RELATION
role
string
Allowed values: PRIMARY VALUE_READ
usedRule
object
id
required
string format: uuid
owned
required
boolean
modelId

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.

string format: uuid
dependencyModels
object
key
additional properties
object recursive
droppedReferences

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.

Array<object>

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
elementId
required

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.

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
targetId
required
string format: uuid
reason
required
string
Allowed values: TARGET_NOT_REACHABLE OWNED_CHILD_MISSING TERM_REFERENCE_NOT_A_CANDIDATE

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

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 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).

Media typeapplication/problem+json
Any of:

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
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 403 from the plain one the same routes answer for a model the caller may not change.

string format: uri
Allowed values: https://modeldesk.io/problems/agent-commit-not-granted

Example

{
"type": "https://modeldesk.io/problems/agent-commit-not-granted"
}

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 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.

Media typeapplication/problem+json

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
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.

string format: uri
Allowed values: https://modeldesk.io/problems/agent-fetch-rate-limited
limit
required

The number of documents the bound admits within window.

integer
window
required

The time the bound counts over, in seconds.

integer

Example

{
"type": "https://modeldesk.io/problems/agent-fetch-rate-limited"
}

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