Encode a public model in a format
const url = 'https://api.modeldesk.io/public/models/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0/encoding?format=2489E9AD-2EE2-8E00-8EC9-32D5F69181C0';const options = {method: 'GET'};
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/public/models/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0/encoding?format=2489E9AD-2EE2-8E00-8EC9-32D5F69181C0'The model at its latest release written in one of its metamodel’s formats, encoded from what the public model read serves and nothing more, as the catalog’s Source view shows it. An encoder’s refusal answers as it does for the editor. Needs no sign-in.
Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”Query Parameters
Section titled “Query Parameters”The slug of the organization the read is scoped to. A model another organization owns then answers the same 404 as one that is not publicly visible, so a catalog served on an organization’s own domain shows the source of that organization’s models alone. Without it, any public model is read.
The snapshot of the model to serve, URL-encoded: the name of one of its releases, or @working (exactly, case-sensitive) for its working version, the head of its main branch, when its owner publishes it. Absent, its default snapshot: the latest release, or the working version for a model without a release that publishes it. A pin that matches nothing the model offers answers the same 404 as a model that is not publicly visible. On the resolve operation it names a snapshot the hit’s model has to offer, while the hit itself is found at the latest release.
Responses
Section titled “Responses”The encoding. Carries Cache-Control: public, max-age=300 (max-age=60 when the snapshot served is the working version) and no entity tag: its dependency content comes from other models, released and unpublished on their own schedule.
object
object
Position in a listing of formats, lowest first.
The encoded files. Most formats produce one; a format that splits a model across files produces several.
object
The file’s text.
Where each element ended up in contents, as an RFC 6901 JSON Pointer keyed by element id, so a reader can highlight the section of the output an element produced. Recording is opt-in per encoder: an encoder that records nothing leaves this empty, and only formats whose output is JSON can carry pointers at all.
object
object
INFO entries are informational — something the reader should know that is not a defect, notably the “unverifiable” verdicts of profile resolution. An INFO entry never makes a model invalid.
The other element a finding is about, where it concerns two: the element whose key or value this one repeats, or the dependency element publishing the same IRI.
A hash of the value the finding was about. Sent with modelElementId (as elementId, left out for a model-level finding), code and property to POST /models/{modelId}/dismissals to dismiss the finding; the dismissal holds while the value hashes the same.
Who dismissed this warning or informational finding and when, where a dismissal of the model names it by element, code, property and fingerprint, so while the value it was about is unchanged. Never on an error, nor on a finding on an element another model answers for.
object
Who dismissed it: a person (USER) with their current name. name is absent where nothing answers to the id any more, such as an erased user.
object
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.
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.
What exactly a finding is about, when its check can report more than one finding at the same code, element and property: a relation target, an offending value (with its language tag for a language string) or an identifier the check is about. Exactly one of target, value and name is present, language only beside value.
object
The finding’s identity across validation runs: the lowercase hex SHA-256 of the canonical JSON of code, modelElementId (as elementId), property and subject, each left out when absent, keys sorted and no whitespace. Neither valueIndex nor the message is part of it. Present on every entry of a validation result.
Example
{ "logEntries": [ { "logLevel": "WARN", "dismissed": { "by": { "type": "USER" } } } ]}Headers
Section titled “Headers”The model is not publicly visible, does not exist, or belongs to an organization other than the one orgSlug names; the three are indistinguishable.
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" } ]}