Get the changes since a baseline commit
const url = 'https://api.modeldesk.io/models/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0/delta';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/delta \ --header 'Authorization: Bearer <token>'Get the model’s state at its current head relative to a baseline commit. The response is either an incremental delta (the touched and added element revisions, the ids of removed elements, and the walked commit metadata) or a full-state reseed when no usable baseline was given or the walk was not worth it. The response carries an ETag of the head commit, so a conditional request with If-None-Match is answered 304 while the head is unchanged.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”Query Parameters
Section titled “Query Parameters”The ref to read at, a model_branch document id. When omitted, the model’s main branch is read.
Commit id the caller already holds. Omitted, this always yields a full-state reseed.
Responses
Section titled “Responses”OK
A model’s state at a head relative to a baseline the caller holds: either an incremental delta (the touched and added element revisions, the ids of removed elements and the walked commits) or a full-state reseed (every revision at the head, with removedElementIds and commits left out). A client that meets a kind it does not know reseeds.
object
Present, and true, only on the answer to a staged change sent with dryRun: true: the change was validated and applied and nothing it would have written was kept. Every id that write would have minted reads as the max UUID ffffffff-ffff-ffff-ffff-ffffffffffff: commitId, each commit’s id, the root’s revisionId and each revision’s id, and in elementRevisionRefs every child revision the change would have renewed. So the envelope names no commit and no revision that exists, and a client that kept one would find it names nothing. Element ids, the commit’s parentId, authorId, message, requestId and actionTypes, and the revisions’ content are what the change would have produced; an element id the caller left to the server is minted again, differently, when the change is staged for real. A dry run of a change that changed nothing minted nothing, and answers the empty delta of the head that was sent. Absent on every envelope describing a move that happened.
The head the envelope brings the caller to.
The baseline, echoed on a delta. Absent on a full-state reseed.
The model’s root element and its revision at the head, so a client sees a root change without scanning revisions.
object
The touched and added element revisions, keyed by element id. Present, and {} when nothing changed.
object
One stored revision of an element, with the revisions of the elements it owns.
object
object
object
object
object
object
Owning model of the referenced element when it differs from the containing model (cross-model reference, e.g. a lineage base element). Omitted for same-model references.
The values the element holds that its type declares no property for; absent when none.
A value an element holds under no binding its type declares, kept so a round trip loses nothing.
object
object
object
object
Owning model of the referenced element when it differs from the containing model (cross-model reference, e.g. a lineage base element). Omitted for same-model references.
A structure the import holds without an element, kept with its own properties inside the layer of the element that refers to it. A node is held once; any other place that refers to it holds a reference to it instead.
object
The property that links the holding element or the enclosing node to this node; absent on a node no property links to.
The node’s global identity in the format’s own terms; absent on an anonymous node.
A label unique within the model, set only on an anonymous node that is referred to more than once.
Whether this entry only points at the node another entry holds under the same localId.
Whether the node is an ordered list, whose entries are its members in order.
Where an element was derived from: the source and rules models, and per property the source values it read.
object
object
object
object
Owning model of the referenced element when it differs from the containing model (cross-model reference, e.g. a lineage base element). Omitted for same-model references.
object
object
object
Owning model of the referenced element when it differs from the containing model (cross-model reference, e.g. a lineage base element). Omitted for same-model references.
The revision of each owned element, keyed by element id.
object
Elements the baseline has and the head does not. Only on a delta.
The commits walked from the baseline (exclusive) to the head (inclusive). Only on a delta.
A commit as a walk over history lists it: its identity, its provenance and the kinds of action it holds, without the actions themselves.
object
Absent on the initial commit.
The author’s description of the change. Absent on a commit made without one. For a staged change it is the message that was sent, absent when it was blank or left out.
The key of the request that produced the commit, absent on a commit made without one. For a staged change it is the changeRequestId that was sent.
The deduped, sorted type values of the commit’s actions. Empty rather than absent on a commit that records none.
Present, and true, on a merge commit whose actionTypes include a dependency or metamodel-pin type for every change it made to the model’s dependencies and metamodel pin. A merge commit names the elements it changed as element actions whatever they are, so one without it says nothing about those: a client has to assume they may have moved. Absent on every other commit, whose actionTypes always tell.
Example
{ "kind": "delta", "revisions": { "additionalProperty": { "element": { "extensionLayer": [ { "kind": "attribute" } ], "lineage": { "properties": [ { "propertyType": "ATTRIBUTE", "sources": [ { "propertyType": "ATTRIBUTE", "role": "PRIMARY" } ] } ] } } } }}Not modified
Bad request
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" } ]}The model is a platform model, such as a metamodel, which only a platform administrator may read; or the caller is a service account whose scopes do not reach model:read, which is refused before the model is looked at. Any other model the caller may not read (another organization’s, one whose metamodel they hold no active seat for, or an individual-access model someone else created) is answered 404, exactly as a model that does not exist, so a refusal never confirms that such a model exists.
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" } ]}The model does not exist or is not the caller’s to read, answered with the plain problem whatever ref was named. Or ref names a ref that is not there for the caller, answered as RefNotFoundProblem: an unknown id, a ref of another model and another user’s draft all get that answer, in the same words, and only on a model the caller may read.
A Problem answered when a ref the request reads at is not there for the caller, on a resource they may read: a ref id that names nothing, a ref of another resource, and another user’s draft, which reads exactly as a ref that does not exist. The draft routes answer it too when the caller holds no draft.
A 404, as a missing resource is, and told apart from one by its type. A resource the caller cannot read keeps the plain answer it always had, whatever ref was named, so this one never says anything about a resource the caller could not see. To a client it means that the ref it was reading, typically a draft committed or discarded in another session, is gone while the resource stays: it goes back to the branch. The problem names no ref, so the answer for an id that names nothing and for another user’s draft is the same, byte for byte.
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
Stable constant a client branches on, which is what tells this 404 from a resource that is missing or not the caller’s to read.
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
{ "type": "https://modeldesk.io/problems/ref-not-found"}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" } ]}