Skip to content

Get a model's content bundle

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

Returns the model’s addressable content bundle for a template (document shape): the manifest, the rendered text payloads keyed by fragment address, and a media index (media path -> diagram id). The model is resolved by precedence version > commit > HEAD; address narrows the response to a fragment sub-tree. The result is cached per (model, commit, stack, stack version, template, local diagrams).

modelId
required
string format: uuid
template
string

Template slug (e.g. conceptueel-toc, logisch) or template id selecting the document shape. Defaults to conceptueel-toc; an unknown value is a 400.

version
string

Model version name to pin to (reproducible). Takes precedence over commit.

commit
string format: uuid

Commit id to pin to. Used when version is absent; defaults to HEAD.

address
string

Fragment address to narrow the response to (that fragment plus its descendants).

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.

OK

Media typeapplication/json
object
manifest
required
object
model
required
string
modelVersion

The pinned model version name; null for a HEAD render.

string
metamodel
required
string
metamodelVersion
string
stack
required
string
stackVersion
required
string
generatedFrom

The commit the bundle was generated from; null for HEAD.

string format: uuid
fragments
required
Array<object>
object
address
required

The fragment’s slug path ("" for the model root); a unique manifest key.

string
elementId
required
string format: uuid
uri
string
kind
required
string
title
string
children

Addresses of nested file fragments.

Array<string>
refs
Array<object>
object
case
required

How the cross-referenced target resolves.

string
Allowed values: same-model referenced-model external
elementId
required
string format: uuid
address

The target’s fragment address (same-model, or the referenced-model stub).

string
uri

The target’s canonical URI (referenced-model / external).

string
anchors
Array<object>
object
address
required
string
elementId
required
string format: uuid
kind
required
string
anchor
required

The in-document anchor id for the inline sub-element.

string
realization
required
object
path
required

The fragment’s payload file path.

string
anchor
string
media

Diagram media paths co-located with this fragment: per diagram, its .svg path followed by its .png path.

Array<string>
payloads
required

Rendered text payload per fragment, keyed by fragment address ("" is the model root).

object
key
additional properties
string
mediaIndex

Diagram id per realization.media path. Omitted when the model has no diagrams.

object
key
additional properties
string format: uuid
index

The document’s public index, which a pull writes as index.json beside the fragments: every element the text declares an anchor for, and every diagram the bundle places. Which elements a diagram draws is left out; the pull fills it in from the diagrams’ SVGs. Omitted from a response narrowed to a sub-tree with address.

object
convention
required

The version of the marker and index convention the index follows.

string
generatedFrom

The commit the bundle was generated from; omitted for HEAD.

string format: uuid
elements

Every element with an anchor, files and in-page anchors alike, in fragment-tree order.

Array<object>
object
id
required
string format: uuid
anchor
required

The in-page anchor the text declares for the element.

string
path
required

The repo-root-relative path of the payload file that carries the anchor.

string
title
required
string
kind
required

The element’s type, under the name its metamodel was authored with.

string
uri

The element’s canonical URI; omitted when it has none.

string
refs

The same-model elements the element refers to, each once, sorted.

Array<string>
diagrams

The diagrams that draw the element; empty as served, filled by the pull.

Array<string>
diagrams

Every diagram the bundle places, in the order of their paths.

Array<object>
object
id
required
string format: uuid
path
required

The repo-root-relative path of the diagram’s SVG.

string
title
required
string
elements

The elements the diagram draws; empty as served, filled by the pull.

Array<string>

Example

{
"manifest": {
"fragments": [
{
"refs": [
{
"case": "same-model"
}
]
}
]
}
}

Bad request (unknown template, a local diagram template id that is not a local template of the model’s metamodel, or a commit that belongs to another model)

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 (model, version, commit, or addressed fragment)

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