Skip to content

Get a content bundle image

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

Streams a single rendered diagram file from the content bundle. Every diagram has two media paths: an SVG (vector, with each drawn element’s id stamped on its node or row, no links) and a PNG (raster fallback). path must be a realization.media path from the manifest; it is resolved through the bundle’s media index to the rendered blob for the resolved commit. The format follows the path’s extension, never the Accept header: a .svg path is served as image/svg+xml and a .png path as image/png, byte for byte as rendered. Every media response carries X-Content-Type-Options: nosniff and a Content-Security-Policy that blocks scripts and external loads, so an SVG opened directly in a browser stays a passive image. A path that is unknown, or whose diagram has not been rendered in that format yet, is a 404. A local diagram’s path is in the media index only of the bundle that names its template, so pass the same localDiagrams the bundle request used.

modelId
required
string format: uuid
path
required
string

A realization.media path from the manifest (a key of mediaIndex).

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.

OK (the content type follows the path’s extension)

string format: binary

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 (unknown media path, or the diagram has not been rendered yet)

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