Skip to content

Get the changes since a baseline commit

GET
/models/{modelId}/delta
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.

modelId
required
string format: uuid
ref
string format: uuid

The ref to read at, a model_branch document id. When omitted, the model’s main branch is read.

baseline
string format: uuid

Commit id the caller already holds. Omitted, this always yields a full-state reseed.

OK

Media typeapplication/json

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
kind
required
string
Allowed values: delta full-state
dryRun

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.

boolean
commitId
required

The head the envelope brings the caller to.

string format: uuid
baselineCommitId

The baseline, echoed on a delta. Absent on a full-state reseed.

string format: uuid
rootElement
required

The model’s root element and its revision at the head, so a client sees a root change without scanning revisions.

object
elementId
required
string format: uuid
revisionId
required
string format: uuid
revisions
required

The touched and added element revisions, keyed by element id. Present, and {} when nothing changed.

object
key
additional properties

One stored revision of an element, with the revisions of the elements it owns.

object
id
required
string format: uuid
modelId
required
string format: uuid
element
required
object
id
required
string format: uuid
type
required
string
external
boolean
attributes
object
key
additional properties
array
relations
object
key
additional properties
object
key
additional properties
Array<object>
object
id
required
string format: uuid
owned
required
boolean
modelId

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.

string format: uuid
extensionLayer

The values the element holds that its type declares no property for; absent when none.

Array

A value an element holds under no binding its type declares, kept so a round trip loses nothing.

One of: discriminator: kind
attribute
object
kind
required
string
Allowed value: attribute
key
string
lexicalValue
string
typeIdentifier
string
qualifiers
object
key
additional properties
string
lineage

Where an element was derived from: the source and rules models, and per property the source values it read.

object
sourceModels
Array<object>
object
modelId
string format: uuid
commitId
string format: uuid
rulesModels
Array<object>
object
modelId
string format: uuid
commitId
string format: uuid
generatedBy
object
id
required
string format: uuid
owned
required
boolean
modelId

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.

string format: uuid
properties
Array<object>
object
propertyName
string
propertyType
string
Allowed values: ATTRIBUTE RELATION
sources
Array<object>
object
sourceModelId
string format: uuid
sourceElementId
string format: uuid
sourceProperty
string
propertyType
string
Allowed values: ATTRIBUTE RELATION
role
string
Allowed values: PRIMARY VALUE_READ
usedRule
object
id
required
string format: uuid
owned
required
boolean
modelId

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.

string format: uuid
elementRevisionRefs

The revision of each owned element, keyed by element id.

object
key
additional properties
string format: uuid
removedElementIds

Elements the baseline has and the head does not. Only on a delta.

Array<string>
commits

The commits walked from the baseline (exclusive) to the head (inclusive). Only on a delta.

Array<object>

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
id
required
string format: uuid
parentId

Absent on the initial commit.

string format: uuid
authorId
required
string format: uuid
message

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.

string
requestId

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.

string
createdAt
required
string format: date-time
actionTypes
required

The deduped, sorted type values of the commit’s actions. Empty rather than absent on a commit that records none.

Array<string>
closureRecorded

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.

boolean

Example

{
"kind": "delta",
"revisions": {
"additionalProperty": {
"element": {
"extensionLayer": [
{
"kind": "attribute"
}
],
"lineage": {
"properties": [
{
"propertyType": "ATTRIBUTE",
"sources": [
{
"propertyType": "ATTRIBUTE",
"role": "PRIMARY"
}
]
}
]
}
}
}
}
}

Not modified

Bad request

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

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.

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

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.

Media typeapplication/problem+json
Any of:

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
type
required

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
type
required

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.

string format: uri
Allowed values: https://modeldesk.io/problems/ref-not-found

Example

{
"type": "https://modeldesk.io/problems/ref-not-found"
}

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