Get a content bundle image
const url = 'https://api.modeldesk.io/models/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0/content-bundle/media?path=example';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/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.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”Query Parameters
Section titled “Query Parameters”A realization.media path from the manifest (a key of mediaIndex).
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 (the content type follows the path’s extension)
Bad request (a local diagram template id that is not a local template of the model’s metamodel)
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 (unknown media path, or the diagram has not been rendered yet)
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" } ]}