Get a model's content bundle
const url = 'https://api.modeldesk.io/models/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0/content-bundle';const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}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).
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”Query Parameters
Section titled “Query Parameters”Template slug (e.g. conceptueel-toc, logisch) or template id selecting the document shape. Defaults to conceptueel-toc; an unknown value is a 400.
Model version name to pin to (reproducible). Takes precedence over commit.
Commit id to pin to. Used when version is absent; defaults to HEAD.
Fragment address to narrow the response to (that fragment plus its descendants).
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.
Responses
Section titled “Responses”OK
object
object
The pinned model version name; null for a HEAD render.
The commit the bundle was generated from; null for HEAD.
object
The fragment’s slug path ("" for the model root); a unique manifest key.
Addresses of nested file fragments.
object
How the cross-referenced target resolves.
The target’s fragment address (same-model, or the referenced-model stub).
The target’s canonical URI (referenced-model / external).
object
The in-document anchor id for the inline sub-element.
object
The fragment’s payload file path.
Diagram media paths co-located with this fragment: per diagram, its .svg path followed by its .png path.
Rendered text payload per fragment, keyed by fragment address ("" is the model root).
object
Diagram id per realization.media path. Omitted when the model has no diagrams.
object
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
The version of the marker and index convention the index follows.
The commit the bundle was generated from; omitted for HEAD.
Every element with an anchor, files and in-page anchors alike, in fragment-tree order.
object
The in-page anchor the text declares for the element.
The repo-root-relative path of the payload file that carries the anchor.
The element’s type, under the name its metamodel was authored with.
The element’s canonical URI; omitted when it has none.
The same-model elements the element refers to, each once, sorted.
The diagrams that draw the element; empty as served, filled by the pull.
Every diagram the bundle places, in the order of their paths.
object
The repo-root-relative path of the diagram’s SVG.
The elements the diagram draws; empty as served, filled by the pull.
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)
An RFC 9457 problem document, always sent as application/problem+json.
object
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.
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.
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.
object
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)
An RFC 9457 problem document, always sent as application/problem+json.
object
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.
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.
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.
object
Example generated
{ "type": "https://example.com", "title": "example", "status": 1, "detail": "example", "instance": "example", "violations": [ { "property": "example", "message": "example" } ]}default
Section titled “default”Error
An RFC 9457 problem document, always sent as application/problem+json.
object
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.
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.
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.
object
Example generated
{ "type": "https://example.com", "title": "example", "status": 1, "detail": "example", "instance": "example", "violations": [ { "property": "example", "message": "example" } ]}