Skip to content

Render diagrams into the content bundle

POST
/models/{modelId}/content-bundle/diagrams
curl --request POST \
--url https://api.modeldesk.io/models/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0/content-bundle/diagrams \
--header 'Authorization: Bearer <token>'

Triggers a commit-pinned render of all of the model’s diagrams (custom plus every template instance, plus the instances of the local templates localDiagrams names) into content-bundle media. Resolves the commit server-side (from version/commit, else HEAD) and creates a content-bundle-diagrams export job; poll it via GET /models/{modelId}/export-jobs/{jobId} and fetch images via the media endpoint.

modelId
required
string format: uuid
template
string
version
string
commit
string format: uuid
localDiagrams
Array<string>

Ids of diagram templates the model’s metamodel marks local, each drawing one diagram per element of the kinds it roots at. No default list holds their diagrams; naming a template here adds them. Repeat the parameter or separate ids with commas; order and repeats do not matter. Pass the same value to the bundle, the diagram render and the media endpoints. An id that is not a local template of the model’s metamodel is a 400 naming the ones that are.

Accepted

Media typeapplication/json
object
id
required
string format: uuid
type
required

Job kind: diagrams (whole-model diagram ZIP render) or content-bundle-diagrams (commit-pinned per-diagram content-bundle media).

string
templateId
string format: uuid
commit

The commit a content-bundle diagram-media render is pinned to. Present only for content-bundle-diagrams jobs; server-set (read-only on creation).

string format: uuid
localTemplateIds

The local diagram templates a content-bundle-diagrams job renders besides the published diagrams, as the trigger’s localDiagrams named them. Absent for none; server-set (read-only on creation).

Array<string>
status
required
string
Allowed values: PENDING PROCESSING COMPLETED COMPLETED_WITH_ERRORS FAILED
progress
object
completed
required
integer
total
required
integer
currentItem
string
modelId
required
string format: uuid
modelName
string
owner
object
id
required
string format: uuid
type
required

USER is a person, MACHINE a service account, and SYSTEM the platform itself, whose commits (metamodel seeding and re-pins) the commit log hides unless asked for them.

string
Allowed values: USER ORGANIZATION SYSTEM MACHINE
name

The display name, where one is known: a person’s from their account, a service account’s as stored with what it wrote. Left out for the platform and for a person whose account holds no name.

string
metamodelId

The metamodel of the exported model.

string format: uuid
downloadUrl
string
fileSize
integer format: int64
expiresAt
string format: date-time
error
string
failures
Array<object>
object
name
required
string
error
required
string
createdAt
string format: date-time
startedAt
string format: date-time
completedAt
string format: date-time

Example

{
"status": "PENDING",
"owner": {
"type": "USER"
}
}

Bad request (a local diagram template id that is not a local template of the model’s metamodel)

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