Skip to content

Rebase your draft

POST
/models/{modelId}/draft/rebase
curl --request POST \
--url https://api.modeldesk.io/models/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0/draft/rebase \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{ "draftHeadId": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "drop": [ "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0" ] }'

Replay the caller’s staged chain onto the current head of the branch the draft targets, and swap the draft onto the result. Every change is re-applied through exactly the step that staged it, so what a replayed change mints is what staging it on the new head would have minted, and the chain keeps its length and its changeRequestIds.

draftHeadId is required: a rebase rewrites the whole chain, so it must not race a session that is still staging into it.

Nothing is left out unless drop names it. A change the new head refuses is reported with its structured errors and its own staged inputs, nothing is written, and the draft stands exactly where it did; repeating the call answers the same refusal until the caller either stages the change differently or names it in drop. The inputs come back in the shape POST /models/{modelId}/draft/changes takes, so correcting a change means posting it again.

A draft already based on the branch head answers 200 and changes nothing, which is what makes a retry harmless. An empty draft rebases to the branch head with an empty chain.

closureChanged and schemaChanged ride on both the 200 and the conflict report. They say whether the commits the branch gained while the draft was open touched the model’s dependencies or its metamodel pin, which is how a client learns that its view of the closure or of the schema is stale.

modelId
required
string format: uuid
Media typeapplication/json

What rebasing a draft takes: the head the caller believes it is rewriting, and the staged changes it wants left out.

object
draftHeadId
required

The draft head the caller believes it is rewriting, compared before anything is replayed. Required, because a rebase rewrites the whole chain and must not race a session that is still staging into it.

string format: uuid
drop

The ids of the staged changes to leave out, each one a commit of the draft’s own chain. An id the chain does not hold is a 400 rather than an id quietly ignored. Absent means empty: the ordinary rebase drops nothing.

Array<string>
<= 500 items

Example generated

{
"draftHeadId": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0",
"drop": [
"2489E9AD-2EE2-8E00-8EC9-32D5F69181C0"
]
}

The draft stands on the branch head, on a chain that was replayed onto it

Media typeapplication/json

Where a rebase left the draft, and what a client has to do about it.

object
draft
required

The draft as it now stands, its baselineCommitId the branch head its chain was replayed onto and its changeCount the chain after the drops.

object
id
required

The draft’s ref id, which is also what ?ref= takes on the read routes.

string format: uuid
targetRefId
required

The branch the draft lands on.

string format: uuid
baselineCommitId
required

The target branch’s head the draft started from.

string format: uuid
headCommitId
required

The draft’s own head, equal to the baseline while nothing is staged.

string format: uuid
changeCount
required

How many changes are staged: the length of the draft’s chain from its head down to its baseline. Computed per read rather than stored, and 0 on a draft nothing has been staged into. A change is the undo grain, so five edits to one element count as five.

integer
createdAt
required
string format: date-time
updatedAt
required
string format: date-time
movesBaseTo

For a dataset draft that moves the dataset to another release of its base, that release’s name; the dataset is pinned to it once the draft lands.

string
handoff

A draft’s most recent handoff for review, set by POST /models/{modelId}/draft/handoff. Absent on a draft never handed off. Neither a commit nor a staged change: it goes with the draft when the draft is committed or discarded, and a staged change, an undo or a rebase leaves it in place.

object
summary
required

The author’s own words about the draft. Written by whoever handed it off, often an agent, so a client renders it as plain text and never as markup.

string
<= 2000 characters
headCommitId
required

The draft head when it was handed off. A headCommitId on the draft other than this one means the draft changed after the handoff.

string format: uuid
at
required

When the draft was handed off.

string format: date-time
dropped
required

The changes the caller asked to leave out, in chain order, and empty when none was. The commits are gone from the chain and nothing points at them any more, so what a client shows is what is here.

Array<object>

One staged change a rebase left out because the caller named it. The change’s inputs are deliberately not here: dropping is a decision the caller takes with the conflict report that carried them already in hand.

object
commitId
required

The staged change that was left out.

string format: uuid
requestId

The changeRequestId it was staged under, absent on a change staged without one.

string
message

The change’s own message, absent on a change staged without one.

string
actionTypes
required

The deduped, sorted type values of the actions the change recorded, as CommitMetadata carries them. A change that recorded none, because it changed nothing on the base it was replayed onto, answers [].

Array<string>
delta
required

The move from the head the caller sent to the head the draft now has, in the same envelope GET /models/{modelId}/delta answers, so a client catches up through the machinery it already has rather than reseeding because its chain was rewritten. Its commits are the fresh chain’s, oldest first. A draft that was already on the branch head answers an empty one whose commitId and baselineCommitId are both the head that was sent.

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

Whether the branch changed the model’s dependencies while the draft was open. True also when the gap between the old baseline and the branch head could not be walked, which is the safe answer rather than a claim that nothing changed.

boolean
schemaChanged
required

Whether the branch changed the model’s metamodel pin while the draft was open. True also when the gap could not be walked.

boolean

Example

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

The body is missing a required member, or drop names a change the draft’s chain does not hold. An unknown id is refused rather than ignored, because a caller that mistyped one would otherwise be told its change was dropped when it is still staged.

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 theirs to read but not to change. Or the caller is an agent acting for a person who did not grant it the right to commit, and drop names a change staged elsewhere, by the person or another agent, or one the chain does not hold, answered as AgentChangeNotOwnProblem with nothing changed. 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 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, answered with the plain problem, or the caller holds no draft on it, answered as RefNotFoundProblem: to a client that is the news a read at a gone ref brings, that the draft it was working in, perhaps committed or discarded in another session, is no longer there.

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

Either a staged change the caller had not named cannot be applied on the branch head, in which case the problem carries every refusal with the inputs that produced it and nothing was written, or the draftHeadId is no longer the draft’s head, in which case it carries the gap exactly as a refused change does. The two are told apart by type.

A third shape carries neither, under a type of its own. The head is compared before the replay and again against the model that was loaded, but the swap’s own compare-and-set can still lose to a change staged while the replay was running, and that answers the BranchHeadConflictProblem: conflict and no gap, whose branchId is the draft’s own ref id. The draft still holds its old chain, and the commits the lost swap left behind are unreachable and swept as garbage.

Media typeapplication/problem+json
One of:

A Problem answered when a rebase met staged changes it could not re-apply on the branch head and which the caller had not asked to drop. Nothing was written and nothing was swapped: the draft stands exactly where it did, and repeating the call answers the same refusal until the caller either stages the change differently or names it in drop.

Every refusal rides at once rather than the first one only, because resolving them one per round trip is resolving one per round trip.

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 stale head the same route answers with. There is no flat code beside it: the codes that matter are the ones inside each conflict’s errors.

string format: uri
Allowed values: https://modeldesk.io/problems/rebase-conflict
conflicts
required

One entry per staged change that could not be applied, in chain order.

Array<object>

One staged change a rebase could not re-apply, named well enough for its owner to choose between correcting it and dropping it.

object
sourceCommitId
required

The staged change that was refused, and the id to put in drop to leave it out.

string format: uuid
requestId

The changeRequestId the change was staged under, absent on a change staged without one. What a client recognises its own edit by.

string
description
required

Why the change was refused, in words a caller can show. Reworded freely, never parsed.

string
actionTypes
required

The type of each of the change’s inputs, each once and in the order they appear, so a client can say what the change was without reading its inputs. These are staged-action types, the discriminator inputs carry, and not the ModelAction types a commit records; the two overlap without being the same vocabulary.

Array<string>
errors
required

Every reason the change was refused, in the same shape a refused change carries in ChangeValidationProblem, so the same client code renders both. An entry’s actionIndex counts into the change’s own inputs. Empty when the refusal named no structured reason, in which case description is what there is.

One code reaches a client here and nowhere else: not-replayable, for a stored change that kept no inputs and so has nothing to re-apply on another head. It is reported rather than skipped, because a change silently left out of a rebase is staged work lost, and its owner resolves it by naming the change in drop. Another is met only on a rebase: changed-on-branch, for a change that writes a key of an element the branch gave another value since the draft’s baseline, or deletes an element the branch changed, naming the element and, for a write, the attribute or relation.

Array<object>

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

The change’s own resolved inputs, every id it created already written into them, in the shape POST /models/{modelId}/draft/changes takes. Correcting the change means posting these back, amended. The exceptions are the actions stored in the form they resolved to: a paste, as the subtree it copied, under the type ELEMENT_PASTE_RESOLVED, and a dependency’s creation and repin, as the target and pin they were resolved against, under DEPENDENCY_CREATE_RESOLVED and DEPENDENCY_UPDATE_RESOLVED (a repin keeping members of connected elements as copies under DEPENDENCY_UPDATE_KEEPING_COPIES_RESOLVED, with the copy ids and the references left out), and an element’s disconnection from its dependency, as the members, the copy ids and the references left out it was resolved to, under DEPENDENCY_DISCONNECT_RESOLVED, whose droppedReferences names each reference the disconnection left out. Those forms are refused as not-stageable when posted back: re-staging one means sending its request again, a paste, a DEPENDENCY_CREATE or DEPENDENCY_UPDATE naming the target, or a DEPENDENCY_DISCONNECT naming the element. They are the draft owner’s own uncommitted edit and are served to nobody else: the draft is resolved from the caller’s identity and never from an id in a request.

Array

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

Whether the branch changed the model’s dependencies while the draft was open. True also when the gap could not be walked, which is the safe answer rather than a claim that nothing changed.

boolean
schemaChanged
required

Whether the branch changed the model’s metamodel pin while the draft was open. True also when the gap could not be walked.

boolean

Example

{
"type": "https://modeldesk.io/problems/rebase-conflict",
"conflicts": [
{
"inputs": [
{
"type": "ELEMENT_CREATE"
}
]
}
]
}

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