Skip to content

Update a diagram

POST
/models/{modelId}/diagrams/{diagramId}
curl --request POST \
--url https://api.modeldesk.io/models/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0/diagrams/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0 \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{ "name": "example", "description": [ { "lang": "example", "value": "example" } ], "contextElementId": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "addElementIds": [ "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0" ], "removeElementIds": [ "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0" ], "moveElement": { "elementId": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "beforeElementId": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0" }, "orientation": "TOP_TO_BOTTOM", "hierarchyOrientation": "TOP_TO_BOTTOM", "filter": { "@path": { "relation": "example", "filter": {}, "distinct": true }, "@root": true, "@attr": { "type": "example", "options": {} }, "@type": { "type": "example", "options": {} }, "@value": { "type": "example", "valueMapping": { "path": { "relation": "example", "filter": {}, "distinct": true }, "attribute": [ "example" ], "template": { "expr": "example" }, "map": { "type": "example", "options": {} }, "skipValues": [ "example" ], "default": "example" }, "options": {} }, "@not": {}, "@and": [], "@or": [], "@absent": { "relation": "example", "filter": {}, "distinct": true }, "@present": { "relation": "example", "filter": {}, "distinct": true } }, "edgeCollapse": { "@path": { "relation": "example", "filter": {}, "distinct": true }, "@root": true, "@attr": { "type": "example", "options": {} }, "@type": { "type": "example", "options": {} }, "@value": { "type": "example", "valueMapping": { "path": { "relation": "example", "filter": {}, "distinct": true }, "attribute": [ "example" ], "template": { "expr": "example" }, "map": { "type": "example", "options": {} }, "skipValues": [ "example" ], "default": "example" }, "options": {} }, "@not": {}, "@and": [], "@or": [], "@absent": { "relation": "example", "filter": {}, "distinct": true }, "@present": { "relation": "example", "filter": {}, "distinct": true } }, "published": true }'

Update diagram

modelId
required
string format: uuid
diagramId
required
string format: uuid
Media typeapplication/json
object
name
string
description

Replaces the description whole (PATCH semantics: absent leaves it unchanged, an empty list or null clears it). Each text is stored stripped and one that is then empty is dropped. A second value in one language (or a second without one), a language that is not a language tag, a text over 4000 characters, or more than 8 values is refused. Not supported on a template-backed diagram.

Array<object>

One language-tagged text; lang is null for a text without a language.

object
lang

A language tag such as nl or en.

string
nullable
value
required
string
contextElementId
string format: uuid
addElementIds
Array<string>
removeElementIds
Array<string>
moveElement

Moves one element of a custom diagram’s primary element set to another place in its order, the order its element list shows and its layout follows. Applied after the update’s additions and removals. An element the set does not hold, or one placed before itself, is not moved; an anchor the set does not hold, or none, puts the element last. Not supported on a template-backed diagram.

object
elementId
required
string format: uuid
beforeElementId

The element it goes before; absent puts it last.

string format: uuid
orientation
string
Allowed values: TOP_TO_BOTTOM BOTTOM_TO_TOP
hierarchyOrientation
string
Allowed values: TOP_TO_BOTTOM BOTTOM_TO_TOP
filter

Optional per-diagram edge suppression: a reference whose target matches is not drawn as an edge, while both terms stay nodes and the reference reappears as a row naming its target. Distinct from the metamodel-declared collapse on a connection, which is fixed per diagram type and tests the edge element.

object
>= 1 properties
@path

Condition under which the entry is offered, as a path expression evaluated against the element whose menu is opening. The frontend is the only evaluator; nothing on the backend reads the path beyond carrying it through compilation and conversion. null for an entry that states no condition, which is offered on every element of its type.

One of:
Path expression
string
@root
boolean
@attr
One of:
string
@type
One of:
string
@value
object
type
string
valueMapping
One of:
Constant
options
object
key
additional properties
any
@not
object recursive
@and
Array<object> recursive
@or
Array<object> recursive
@absent

Condition under which the entry is offered, as a path expression evaluated against the element whose menu is opening. The frontend is the only evaluator; nothing on the backend reads the path beyond carrying it through compilation and conversion. null for an entry that states no condition, which is offered on every element of its type.

One of:
Path expression
string
@present

Condition under which the entry is offered, as a path expression evaluated against the element whose menu is opening. The frontend is the only evaluator; nothing on the backend reads the path beyond carrying it through compilation and conversion. null for an entry that states no condition, which is offered on every element of its type.

One of:
Path expression
string
key
additional properties
any
edgeCollapse

Optional per-diagram edge suppression: a reference whose target matches is not drawn as an edge, while both terms stay nodes and the reference reappears as a row naming its target. Distinct from the metamodel-declared collapse on a connection, which is fixed per diagram type and tests the edge element.

object
>= 1 properties
@path

Condition under which the entry is offered, as a path expression evaluated against the element whose menu is opening. The frontend is the only evaluator; nothing on the backend reads the path beyond carrying it through compilation and conversion. null for an entry that states no condition, which is offered on every element of its type.

One of:
Path expression
string
@root
boolean
@attr
One of:
string
@type
One of:
string
@value
object
type
string
valueMapping
One of:
Constant
options
object
key
additional properties
any
@not
object recursive
@and
Array<object> recursive
@or
Array<object> recursive
@absent

Condition under which the entry is offered, as a path expression evaluated against the element whose menu is opening. The frontend is the only evaluator; nothing on the backend reads the path beyond carrying it through compilation and conversion. null for an entry that states no condition, which is offered on every element of its type.

One of:
Path expression
string
@present

Condition under which the entry is offered, as a path expression evaluated against the element whose menu is opening. The frontend is the only evaluator; nothing on the backend reads the path beyond carrying it through compilation and conversion. null for an entry that states no condition, which is offered on every element of its type.

One of:
Path expression
string
key
additional properties
any
published

Whether the diagram leaves the model (PATCH semantics: absent leaves it unchanged, null returns it to the default, which is published). Allowed on a template-backed diagram as well as on a custom one.

boolean

OK

Media typeapplication/json
object
id
required
string format: uuid
name
string
description
required

What the diagram shows, one text per language and at most one without; empty when it has none. Only a custom diagram carries one.

Array<object>

One language-tagged text; lang is null for a text without a language.

object
lang

A language tag such as nl or en.

string
nullable
value
required
string
contextElementId
string format: uuid
layoutType
string
Allowed values: LAYERED
diagramTypeId
string format: uuid
templateId
string format: uuid
rootElementId
string format: uuid
orientation
string
Allowed values: TOP_TO_BOTTOM BOTTOM_TO_TOP
hierarchyOrientation
string
Allowed values: TOP_TO_BOTTOM BOTTOM_TO_TOP
elementSets
Array<object>
object
id
required
string format: uuid
elementIds
required
Array<string>
filter

Optional per-diagram edge suppression: a reference whose target matches is not drawn as an edge, while both terms stay nodes and the reference reappears as a row naming its target. Distinct from the metamodel-declared collapse on a connection, which is fixed per diagram type and tests the edge element.

object
>= 1 properties
@path

Condition under which the entry is offered, as a path expression evaluated against the element whose menu is opening. The frontend is the only evaluator; nothing on the backend reads the path beyond carrying it through compilation and conversion. null for an entry that states no condition, which is offered on every element of its type.

One of:
Path expression
string
@root
boolean
@attr
One of:
string
@type
One of:
string
@value
object
type
string
valueMapping
One of:
Constant
options
object
key
additional properties
any
@not
object recursive
@and
Array<object> recursive
@or
Array<object> recursive
@absent

Condition under which the entry is offered, as a path expression evaluated against the element whose menu is opening. The frontend is the only evaluator; nothing on the backend reads the path beyond carrying it through compilation and conversion. null for an entry that states no condition, which is offered on every element of its type.

One of:
Path expression
string
@present

Condition under which the entry is offered, as a path expression evaluated against the element whose menu is opening. The frontend is the only evaluator; nothing on the backend reads the path beyond carrying it through compilation and conversion. null for an entry that states no condition, which is offered on every element of its type.

One of:
Path expression
string
key
additional properties
any
layoutRules
Array
One of: discriminator: @type
LevelRule
object
@type
required
string
Allowed values: LevelRule
id
string format: uuid
element
required
string format: uuid
refElement
required
string format: uuid
type
required
string
Allowed values: SAME_LEVEL BELOW ABOVE
hierarchyGroups
Array<object>
object
id

Absent on a creation whose id the server is to mint, and on an update, whose target is named beside it. Always present on a group that exists.

string format: uuid
root
required
string format: uuid
maxLeft

How many siblings spread to the left of the root. Omitted, none.

integer
0
maxRight

How many siblings spread to the right of the root. Omitted, none.

integer
0
edgeCollapse

Optional per-diagram edge suppression: a reference whose target matches is not drawn as an edge, while both terms stay nodes and the reference reappears as a row naming its target. Distinct from the metamodel-declared collapse on a connection, which is fixed per diagram type and tests the edge element.

object
>= 1 properties
@path

Condition under which the entry is offered, as a path expression evaluated against the element whose menu is opening. The frontend is the only evaluator; nothing on the backend reads the path beyond carrying it through compilation and conversion. null for an entry that states no condition, which is offered on every element of its type.

One of:
Path expression
string
@root
boolean
@attr
One of:
string
@type
One of:
string
@value
object
type
string
valueMapping
One of:
Constant
options
object
key
additional properties
any
@not
object recursive
@and
Array<object> recursive
@or
Array<object> recursive
@absent

Condition under which the entry is offered, as a path expression evaluated against the element whose menu is opening. The frontend is the only evaluator; nothing on the backend reads the path beyond carrying it through compilation and conversion. null for an entry that states no condition, which is offered on every element of its type.

One of:
Path expression
string
@present

Condition under which the entry is offered, as a path expression evaluated against the element whose menu is opening. The frontend is the only evaluator; nothing on the backend reads the path beyond carrying it through compilation and conversion. null for an entry that states no condition, which is offered on every element of its type.

One of:
Path expression
string
key
additional properties
any
published

Whether this diagram leaves the model. Absent means published, so every diagram authored before the field existed is published. A diagram held back (false) is excluded from the content bundle, from the diagram ZIP and from the public catalog, and no generated Markdown references its image. It stays visible and editable in the application either way — publication is not visibility.

boolean
default: true

Example

{
"layoutType": "LAYERED",
"orientation": "TOP_TO_BOTTOM",
"hierarchyOrientation": "TOP_TO_BOTTOM",
"layoutRules": [
{
"@type": "LevelRule",
"type": "SAME_LEVEL"
}
],
"hierarchyGroups": [
{
"maxLeft": 0,
"maxRight": 0
}
],
"published": true
}

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