Skip to content

Materialize a template instance

POST
/models/{modelId}/templates/{templateId}/instances/{rootElementId}
curl --request POST \
--url https://api.modeldesk.io/models/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0/templates/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0/instances/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0 \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{ "orientation": "TOP_TO_BOTTOM", "hierarchyOrientation": "TOP_TO_BOTTOM", "layoutRules": [ { "@type": "LevelRule", "id": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "element": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "refElement": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "type": "SAME_LEVEL" } ], "hierarchyGroups": [ { "id": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "root": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "maxLeft": 0, "maxRight": 0 } ], "published": true }'

Materialize template instance

modelId
required
string format: uuid
templateId
required
string format: uuid
rootElementId
required
string format: uuid
Media typeapplication/json
object
orientation
string
Allowed values: TOP_TO_BOTTOM BOTTOM_TO_TOP
hierarchyOrientation
string
Allowed values: TOP_TO_BOTTOM BOTTOM_TO_TOP
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
published

Whether the stored view leaves the model. Omitted means published. Supplying false with no layout stores the view for the sole purpose of holding it back.

boolean

Created

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 (or conflict if already materialized)

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