Skip to content

Update an element

POST
/models/{modelId}/elements/{elementId}
curl --request POST \
--url https://api.modeldesk.io/models/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0/elements/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0 \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{ "attributes": { "additionalProperty": [ "example" ] }, "relations": { "additionalProperty": { "additionalProperty": [ { "id": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "owned": true, "modelId": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0" } ] } }, "externalElements": [ { "id": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "type": "example", "external": true, "attributes": { "additionalProperty": [ "example" ] }, "relations": { "additionalProperty": { "additionalProperty": [ { "id": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "owned": true, "modelId": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0" } ] } }, "extensionLayer": [ { "kind": "attribute", "key": "example", "lexicalValue": "example", "typeIdentifier": "example", "qualifiers": { "additionalProperty": "example" } } ], "lineage": { "sourceModels": [ { "modelId": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "commitId": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0" } ], "rulesModels": [ { "modelId": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "commitId": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0" } ], "generatedBy": { "id": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "owned": true, "modelId": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0" }, "properties": [ { "propertyName": "example", "propertyType": "ATTRIBUTE", "sources": [ { "sourceModelId": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "sourceElementId": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "sourceProperty": "example", "propertyType": "ATTRIBUTE", "role": "PRIMARY" } ], "usedRule": { "id": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "owned": true, "modelId": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0" } } ] } } ], "extensionLayer": [ { "kind": "attribute", "key": "example", "lexicalValue": "example", "typeIdentifier": "example", "qualifiers": { "additionalProperty": "example" } } ] }'

Update model element

modelId
required
string format: uuid
elementId
required
string format: uuid
Media typeapplication/json

The attributes and relations to write on one element. An absent key is left as it stands and an empty value drops the key, so a relation is cleared by sending it empty. An update that changes nothing and brings no external element is a no-op rather than an error.

object
attributes
object
key
additional properties
array
relations

The relations to write, keyed by relation name. Each value is the relation’s target refs keyed by group, with @@ naming the group of an ungrouped relation.

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
externalElements

Whole elements the written relations point at that live outside this model, carried along so the reference resolves to something. Each must have external set to true, or the action is refused with the code invalid-value; one the model already holds is left alone rather than replaced.

Array<object>
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
extensionLayer

The element’s whole extension layer after the update: the values it holds that its type declares no property for. Absent leaves the layer as it stands, an empty array clears it, and an array replaces it entry for entry, in its order. A metamodel may refuse an entry it cannot write back, with a code of its own naming the entry’s key as the property.

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

OK

Media typeapplication/json
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

Example

{
"extensionLayer": [
{
"kind": "attribute"
}
],
"lineage": {
"properties": [
{
"propertyType": "ATTRIBUTE",
"sources": [
{
"propertyType": "ATTRIBUTE",
"role": "PRIMARY"
}
]
}
]
}
}

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

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