Skip to content

Stage a change

POST
/models/{modelId}/draft/changes
curl --request POST \
--url https://api.modeldesk.io/models/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0/draft/changes \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{ "actions": [ { "type": "ELEMENT_CREATE", "creation": { "id": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "elementId": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "owner": { "id": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "relation": "example" }, "type": "example", "attributes": { "additionalProperty": [ "example" ] }, "relations": { "additionalProperty": { "additionalProperty": [ { "id": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "owned": true, "modelId": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0" } ] } }, "ownedElements": { "additionalProperty": [] } } } ], "draftHeadId": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "changeRequestId": "example", "message": "example", "dryRun": false, "branchId": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0" }'

Stage one change into the caller’s own draft. The actions are applied in order on one working state and land as a single micro-commit or not at all, so an action may name what an earlier action of the same change created.

The draft is opened on first use, on the branch branchId names or the model’s main branch when it is omitted, and only by a change that has something to commit: a change every action of which was a no-op leaves a caller who held no draft still holding none. draftHeadId is required on every call, the first included, and is the target branch’s head while there is no draft yet. A caller holds one draft per model: once they hold one, a change that names a branch must name the one that draft targets, and a change that names none goes into it.

The response is the same delta envelope GET /models/{modelId}/delta?ref={draftId}&baseline={draftHeadId} answers for the pair, so a client applies it through the machinery it already has. A change that changed nothing answers an empty delta whose commitId and baselineCommitId are both the head that was sent.

A draft holds only as many staged changes as a delta may walk. A change that would take it past that is refused with the ChangeValidationProblem, carrying one error with the code chain-too-long and no actionIndex, because the refusal is about the draft rather than about one action. The remedy is to commit the draft, not to split the change.

With dryRun: true the change is tried and not kept. It runs the path a change runs, from the write check and the write scope through validation and application to the commit the change would record, and stops short of writing it: draftHeadId is compared by reading the head, and the draft and the commit are described rather than written. It answers what the change would have answered, or the same 400 and 409 a change would have met, writes nothing and takes no write lock: no staged change, no element revision, no moved head, and no draft for a caller who holds none, so a change sent beside it is never held up by it. Because the head is read rather than gated, a change that lands between that read and the answer is not seen; the answer was true of the head that was sent, and the change sent after it meets the compare-and-set as any change does. The envelope carries dryRun: true, every id the write would have minted reads as the max UUID (see DeltaEnvelope.dryRun), and Draft-Ref names a draft only when the caller already held one. A dry run is not counted as a staged change. Sending the same change again without dryRun stages it, and it lands as the dry run said unless the draft moved in between, which the compare-and-set refuses; only the ids of elements the caller left to the server to mint differ.

A dry run is bounded in time: one that has not finished within its timeout (30 seconds unless configured otherwise) is given up and answered 503 with the dry-run-timeout problem. Nothing was written and nothing was judged, so it can be sent again.

A dry run of a DEPENDENCY_CREATE or DEPENDENCY_UPDATE still resolves the target it names and warms the dependency cache with that target’s closure, as the change itself would before staging. Those rows derive from released content; the model, its refs and its drafts are left as they were.

A DEPENDENCY_CREATE, DEPENDENCY_UPDATE or DEPENDENCY_DELETE stands alone in its change. Each changes the dependencies the rest of a change would be checked against, so a change holding one beside any other action is refused with the ChangeValidationProblem, carrying one error with the code closure-action-must-stand-alone and no actionIndex. The remedy is to send the dependency action as a change of its own and the actions that rely on it in the next one, which starts from the dependencies it left.

modelId
required
string format: uuid
Media typeapplication/json

One change to stage: the edits, the draft head they were written against, the caller’s own name for the request, optionally what the change is in the caller’s words, and whether to keep it at all. The actions are applied in order on one working state, so an action may name what an earlier action of the same change created, and they land together or not at all.

object
actions
required

The edits to stage, in the order they are to be applied.

Four bounds hold a change, and none implies another. At most 1000 actions; within that, at most 100 namespace, dependency, alignment, layout-rule or hierarchy-group actions, each of which is validated against the whole model rather than against the elements it names; ELEMENT_PASTE actions from at most 10 models other than this one, counted by distinct sourceModelId, since each is read whole before the change is applied; and at most 8 MiB once the change’s actions are serialized for storage, which is what bounds a single action of unbounded size, such as one deep nested creation, one bulk update or one paste, whose stored form is the whole subtree it copied. A change over any of the four is refused with the ChangeValidationProblem, carrying one error with the code change-too-large, no actionIndex, and a message naming which bound it is over; the first three are refused before any model is read, the size as soon as a paste takes the change past it. The remedy for all four is to split it into several changes.

Array
>= 1 items <= 1000 items

One staged edit, discriminated by its own type. Each variant wraps the payload its per-action endpoint already accepts, so an edit has one request shape however it is made: the ids the edit is addressed by, and then at most one payload property. A layout rule and a hierarchy group are owned by a diagram and addressable only through it, so those variants name the diagram beside the child; a template instance is addressed by its template and its root element, so materializing one names both beside the diagram it becomes.

The listed types are the whole of what this route stages. A type outside them is not a malformed body and is not ignored: it is read, and the change is refused with the ChangeValidationProblem, carrying one error with the code not-stageable, the action’s actionIndex and the actionType that was sent, so the caller learns which of its actions to drop. Every other write path keeps its own endpoint and commits directly: an external dependency, the metamodel pin, a base model and a release among them. Diagrams, namespaces, attribute templates and internal dependencies keep theirs as well, for a caller that does not stage.

A paste is staged as its request, ELEMENT_PASTE, and stored as the subtree it resolved to, which a draft’s micro-commit keeps under the type ELEMENT_PASTE_RESOLVED. A dependency’s creation and repin are staged as DEPENDENCY_CREATE and DEPENDENCY_UPDATE and stored as what they resolved to against the model they pin, under DEPENDENCY_CREATE_RESOLVED and DEPENDENCY_UPDATE_RESOLVED, a repin keeping members of connected elements as copies under DEPENDENCY_UPDATE_KEEPING_COPIES_RESOLVED. The disconnection of an element from its dependency is staged as DEPENDENCY_DISCONNECT and stored, with the id of every copy it writes, under DEPENDENCY_DISCONNECT_RESOLVED. Those stored forms are not among the listed types: posted to this route they are refused with not-stageable like any other type outside them, because accepting one would skip the read that produced it, the paste’s source read and metamodel check, or the authorized read of the model a dependency pins.

One of: discriminator: type
ELEMENT_CREATE

Creates an element, with the elements nested under it, or adopts an existing one under a new owner when creation.elementId names it.

object
type
required
string
Allowed value: ELEMENT_CREATE
creation
required

An element to create, or an existing one to adopt under a new owner.

elementId decides which. Set, the payload adopts the element it names and creates nothing, so type and ownedElements are ignored, at every depth. Absent, an element is created and type is required. A payload that adopts has to name its owner at the top level; nested under ownedElements the owner is the parent and the relation it sits under, unless it names another. A creation that names no owner is placed on the model’s root element under its @element relation.

object
id

The id the new element is to receive. Omitted, the server mints one. Supplying it is what lets a later action of the same staged change name this element; an id that already exists is refused. Only a staged change honours it: the direct element-create route drops it, and every nested one, and mints its own. Distinct from elementId, which names an element that is already there and asks for it to be adopted.

string format: uuid
elementId

An element of this model to adopt under owner instead of creating one. It has to exist in the state the change is applied to and be this model’s own: one held by a dependency or by the metamodel is answered element-not-found, because it is not this model’s to place. A nested entry whose owner already holds the element through that relation is not adopted again, only listed in the relation it sits under, at its position.

string format: uuid
owner
object
id
required
string format: uuid
relation
required
string
type

The type of the element to create. Required unless elementId adopts one instead.

string
attributes
object
key
additional properties
array
relations

The element’s outgoing relations, keyed by relation name. Each value is the relation’s target refs keyed by group, with @@ naming the group of an ungrouped relation.

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
ownedElements

Elements to create under this one, keyed by the relation that owns them. Each is a creation in its own right, so id, elementId and further nesting reach every node of the tree. Ignored on a payload that adopts.

object
key
additional properties
Array<object> recursive
draftHeadId
required

The draft head the caller believes it is editing, compared before anything is applied. Required on every call, the first included: before a draft exists it is the target branch’s head, so one rule covers both a draft that moved and a branch that moved before there was a draft.

string format: uuid
changeRequestId
required

The caller’s own key for this request, stored on the micro-commit it mints and opaque to the server. Never parsed, only compared, which is what lets a caller recognise its own change in the gap a lost compare-and-set hands back.

string
>= 1 characters <= 200 characters
message

What the change is, in the caller’s words. Optional, and capped as a landing’s message is. Stored as the micro-commit’s message and served wherever the draft’s chain is listed: the commits of this route’s envelope, GET /models/{modelId}/commits?ref={draftId}, the gap a 409 carries, and a rebase’s dropped and delta, since a rebase carries it over to the commit that re-records the change. A blank message is stored as none. It never reaches the branch: the landing commit carries the message its own request sends.

string
<= 2000 characters
dryRun

Try the change without keeping it. Validated and applied exactly as a staged change is, and checked against draftHeadId by reading the head, with the commit it would record built and never written: the answer is the envelope the change would have produced, marked dryRun: true, or the refusal it would have met. Nothing is written and no write lock is taken. The scope and the write check are a staged change’s, because a dry run reaches everything a change does short of keeping it.

boolean
branchId

The branch the change is meant for. While the caller holds no draft, the change opens one on this branch, or on the model’s main branch when it is omitted, and draftHeadId is compared with that branch’s head; an id that is not a branch of the model is answered as RefNotFoundProblem. A caller holds one draft per model, so while they hold one, a named branch must be the one it targets: any other is refused as opening a draft on a second branch is, with DraftTargetTakenProblem naming the branch the open draft targets. Omitted while they hold one, the change goes into that draft.

string format: uuid

The change was staged, or was a no-op, or, under dryRun, would have been staged and was not

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"
}
]
}
]
}
}
}
}
}
Draft-Ref
string format: uuid

The draft the change is staged in, so a caller whose change opened it learns its id without a second call. Absent when the call left no draft behind: a no-op change, or a dry run, sent by a caller who had none.

Paste-Dropped-References
string
/^[0-9]+=[0-9]+(,[0-9]+=[0-9]+)*$/
Example
0=2,3=1

How many references each ELEMENT_PASTE of the change could not carry over, as actionIndex=count pairs joined by commas, in action order, for the pastes that dropped any: 0=2,3=1. A reference is dropped when it points at an element that was neither copied along nor visible from the target, and each count is the droppedReferenceCount the per-action paste answers with. Absent when no paste of the change dropped one, which includes every change that holds no paste. A header rather than part of the body, because the body is a delta envelope, which carries revisions, and a dropped reference is one no revision shows.

Disconnect-Dropped-References
string
/^[0-9]+=[0-9]+(,[0-9]+=[0-9]+)*$/
Example
0=2,3=1

How many references each DEPENDENCY_DISCONNECT of the change, and each DEPENDENCY_UPDATE keeping missing members as copies, left out, as actionIndex=count pairs joined by commas, in action order, for the actions that left any out: 0=2,3=1, the grammar of Paste-Dropped-References. A reference is left out when a member’s copy would point at an element of a model this one does not depend on, an owned child the version lacks, or a term that is no candidate where it lands. Absent when no action left one out. Each reference is named on the stored input, under droppedReferences, and before a disconnection by POST /models/{modelId}/elements/{elementId}/disconnect-preview.

The change was refused and nothing was written. The problem carries one errors entry per reason, each naming the action it belongs to and, where the refusal knew them, the element and the property. Or the caller holds a draft on another branch than the one branchId names, answered as DraftTargetTakenProblem with the targetRefId of the draft they hold. Or the caller is an agent acting for a person, and changeRequestId is not mcp-<session>-<uuid> with the agent’s own session, answered with the plain problem before anything is read: an agent stages under no other origin’s name.

Media typeapplication/problem+json
Any of:

A Problem that additionally carries errors when a staged change was refused, with nothing written. Its own type is what tells it from the plain 400 of a malformed body. Separate from Problem.violations, which stays what it is: request-body validation, one entry per rejected field of the request itself.

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 a refused change from the plain 400 of a malformed body.

string format: uri
Allowed values: https://modeldesk.io/problems/change-validation-failed
errors
required

Every reason the change was refused, not only the first, so a whole change can be corrected in one round trip. Never empty: a refusal carries at least one reason. A later entry may still be a consequence of an earlier failing action, which the messages say rather than hide. An entry’s actionIndex counts into the change’s own actions.

Array<object>
>= 1 items

One reason a change was not applied, in the form an agent can correct itself from: which action was at fault, what kind of fault it was, and which element and property it was about. The same shape wherever a refusal is reported, so one piece of client code renders all of them.

code and message answer different readers. The code is a stable constant a client branches on without parsing prose; the message is the human sentence and may be reworded at any time. Every member a throw site did not know is left off the wire rather than sent as null, so a reader never has to tell “not applicable” from “unknown”.

object
actionIndex

Where the failing action sits in the change’s own action list, counted from zero. Absent, together with actionType, when the fault belongs to the change as a whole rather than to one of its actions.

integer
actionType

The type of the failing action, exactly as the caller sent it, which for a not-stageable refusal is a type no variant answers to. Absent together with actionIndex.

string
code
required

A stable kebab-case constant a client branches on rather than parsing the message.

A refusal of the change as a whole carries one of not-stageable, updater-rejected, write-rejected, chain-too-long, change-too-large or closure-action-must-stand-alone. That list is closed, except where the errors member carrying this error names one more of its own. A refusal about one element or one of its properties carries an element-level code from the same namespace instead, such as element-not-found, owner-not-found, already-exists, unknown-property, invalid-target, multiplicity-violated or invalid-value, and a refused dependency action one of dependency-target-not-found, dependency-exists, dependency-in-use, dependency-connected, members-missing-in-version, dependency-not-direct, dependency-version-differs, dependency-snapshot-missing, dependency-metamodel-not-allowed or dependency-not-found, and a relation a change writes into content of a dependency the model no longer holds, which a rebase meets after the branch removed that dependency, dependency-removed, naming the referring element and the relation. A DEPENDENCY_CONNECT or DEPENDENCY_DISCONNECT may carry copy-not-replaceable, element-connected, element-not-connected or connection-changed, and a write that would set, change or clear an element’s connection other than through those two connection-not-writable. That second set is stable in the sense that a code is never reused for something else, but it is open: new ones are added as refusals learn to name themselves, so a client treats one it does not recognise as a refusal it cannot special-case rather than as a malformed response.

string
message
required

The sentence a human reads. Reworded freely, never parsed.

string
elementId

The element the failure is about, where the refusal named one.

string format: uuid
elementName

The name elementId is listed under, where the refusal read it: the connected element a dependency-connected error names, the member a members-missing-in-version error names.

string
property

The attribute or relation the failure is about, where the refusal named one.

string
missingMember

On a members-missing-in-version error: a member a connected element holds by reference that the version its dependency moves to lacks, the element that holds it, and what uses it.

object
memberId
required

The member, an element of the version the dependency leaves.

string format: uuid
memberName
required

The name it is listed under, its type when nothing names it.

string
memberType
required

Its type, as stored.

string
holderId
required

The element that holds the member, one whose type represents a model and that is connected to the dependency.

string format: uuid
holderName
required

The name the element that holds the member is listed under, its type when nothing names it.

string
missingChild

For a member the new version still holds: the owned child of it that the version lacks and the model uses, which makes the member count as missing. Absent for a member the version lacks itself.

object
id
required
string format: uuid
name
required

The name it is listed under, its type when nothing names it.

string
type
required
string
uses
required

The model’s elements referring to the member or one of its owned children, through an authored relation or a term reference, each once per relation, in element id order. The member relation of the element that holds it holds the member rather than using it and is not listed.

Array<object>
object
elementId
required
string format: uuid
elementName
required
string
relation
required

The key the reference is stored under.

string
relationLabel

The name the metamodel shows for the relation; absent when it declares none.

string
errorCounts

Present only when errors was cut short at its bound: every reason found, counted by code, so a client can say how many there are without parsing detail. A refused DEPENDENCY_UPDATE with many missing members answers its first ones in errors and their total under members-missing-in-version; POST /models/{modelId}/dependencies/{dependencyId}/version-change-preview lists them all.

object
key
additional properties
integer

Example

{
"type": "https://modeldesk.io/problems/change-validation-failed"
}

The model is theirs to read but not to change. Or a staged action is behind a feature of its own that the caller’s organization lacks: the whole change is refused with FeatureNotEnabledProblem naming that feature, which a client tells from an access refusal by its type. An ALIGNMENT_CREATE from an organization without alignment answers feature: alignment, and nothing of the change is staged. Or the caller is an agent acting for a person, and the organization that owns the model has not enabled the agent’s AI platform, answered as AgentPlatformNotEnabledProblem. Or the caller is an agent acting for a person, and a paste reads from a model of another owner than this one, answered with the plain problem and nothing staged. Or the caller is an agent acting for a person, and the request reaches further than the maximum level the organization that owns the model lets agents reach, answered as AgentLevelNotAllowedProblem with nothing written, whatever the agent was granted.

Media typeapplication/problem+json
Any of:

A Problem answered when an agent acting for a person made a request that reaches further than the maximum level the organization that owns the model lets agents reach, set in the organization’s AI agent platforms setting: staging into a draft or working on a branch where the maximum is read, a merge, a landing on a branch that is not an agent’s own, or taking back or landing another’s staged change where it is propose, and anything that reaches people outside the organization where it is below publish. The person’s grant does not lift it, since a grant spans the person’s organizations and the maximum is each organization’s own; an organization admin can raise it. Nothing was written. A change of the setting applies to new requests within a minute.

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 403 from the plain one the same routes answer for a model the caller may not change, and from the refusals a permission the person grants lifts.

string format: uri
Allowed values: https://modeldesk.io/problems/agent-level-not-allowed

Example

{
"type": "https://modeldesk.io/problems/agent-level-not-allowed"
}

The model does not exist or is not the caller’s to read, answered with the plain problem. Or the caller holds no draft and branchId names no branch of the model, answered as RefNotFoundProblem: an unknown id, a draft and a generated branch all read as naming nothing.

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

The draftHeadId is no longer the current head. The problem carries the gap, so a caller that finds its own changeRequestId in commits knows its change was applied and does not send it twice.

Media typeapplication/problem+json

A Problem that additionally carries the gap, answered when the draftHeadId a change or an undo was written against is no longer the draft’s head. Listing what landed in between is what makes a retry safe: a caller that finds its own changeRequestId in commits knows its change was applied and does not send it twice.

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 409 from the other.

string format: uri
Allowed values: https://modeldesk.io/problems/draft-head-conflict
conflict
required
object
branchId
required
string format: uuid
baselineCommitId
required

The head the caller sent, which is no longer the current one.

string format: uuid
currentHeadCommitId

The head as it now stands. Absent when the follow-up read that fills it did not succeed.

string format: uuid
ancestor
required

Whether the head the caller sent is still on the chain below the current one. False when an undo popped it, a rebase rewrote the chain, or a commit closed the draft. A client that reads false reseeds instead of replaying.

boolean
commits

The chain from the current head down to the head the caller sent, exclusive, newest first. Absent when ancestor is false, because there is then no gap to list.

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

{
"type": "https://modeldesk.io/problems/draft-head-conflict"
}

A dry run did not finish within its timeout and was given up, with problem type https://modeldesk.io/problems/dry-run-timeout. Nothing was written and the request can be sent again. Only a dry run is bounded this way.

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