Merge a branch
const url = 'https://api.modeldesk.io/models/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0/branches/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0/merge';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"source":"2489E9AD-2EE2-8E00-8EC9-32D5F69181C0","message":"example","expectedHeadId":"2489E9AD-2EE2-8E00-8EC9-32D5F69181C0","expectedSourceHeadId":"2489E9AD-2EE2-8E00-8EC9-32D5F69181C0","resolutions":[{"elementId":"2489E9AD-2EE2-8E00-8EC9-32D5F69181C0","take":"target","fields":{"additionalProperty":"target"}}],"takeOthers":"target","selection":{"leaveOut":[{"elementId":"2489E9AD-2EE2-8E00-8EC9-32D5F69181C0","fields":["example"]}],"only":[{"elementId":"2489E9AD-2EE2-8E00-8EC9-32D5F69181C0","fields":["example"]}]}}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://api.modeldesk.io/models/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0/branches/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0/merge \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "source": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "message": "example", "expectedHeadId": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "expectedSourceHeadId": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "resolutions": [ { "elementId": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "take": "target", "fields": { "additionalProperty": "target" } } ], "takeOthers": "target", "selection": { "leaveOut": [ { "elementId": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "fields": [ "example" ] } ], "only": [ { "elementId": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "fields": [ "example" ] } ] } }'Merge the source branch into this one. The server compares both branches with their merge base element by element: an element only one side changed takes that side’s version, and an element both changed the same way, or both deleted, stays as it is. An element both changed differently, or one deleted and the other changed, is a conflict, and so is a change standing on an element the other side deleted: one made under an owner it deleted, or one holding a relation to an element it deleted. Adding or removing a relation changes the element that holds it, with one exception: an owner whose member lists both branches changed merges by combining them. Each merged list is this branch’s list, without the members the source removed, followed by the members the source added, in the source’s order, so two branches that each add members to one package, or each add a top-level element, merge. The owner is still a conflict when both branches changed something else about it differently, or put the members both kept in two different orders. One conflict refuses the whole merge with nothing written, and the problem lists every conflicting element with its reason, what each branch holds for it (whether it holds the element, as what type, and every attribute and relation the two disagree on, with the merge base’s value beside theirs), the names of every element those values reference, and the three commits the merge was computed from.
A refusal is resolved by sending the merge again with resolutions, one per conflict, and both heads the refusal names as expectedHeadId and expectedSourceHeadId. A resolution is only meaningful at the heads the refusal reported, since it chooses between the versions that refusal showed, so resolutions sent without both heads are refused before anything is read, and a branch that moved since is refused as BranchHeadConflictProblem. Each resolution takes the element from this branch (target), from the source (source), or from this branch with the fields it names taken from either side (fields); it chooses between what the two branches hold and never carries a value of its own. The merge is computed again from the branches as they are, and only a merge that is refused again reads the resolutions. They are applied as edits through the same updater a change made by hand goes through, over the state the merge would otherwise land: an element taken from the side that deleted it is deleted with its members, one taken from the side that holds it alone is created under the owner that side gives it, with the members that side holds under it, and every other one is updated to the version taken, its relations carried into their other ends. A member list taken from one side sets the order of the members the owner holds, and never takes one away or brings one in: a member comes and goes by its own resolution. A resolution the updater refuses refuses the merge again with every conflict and, under rejected, the updater’s reason for each refused resolution; nothing is written, and the caller changes those choices. A conflict left without a resolution refuses the merge as before. Committing a fix on either branch and merging again still resolves a refusal too.
A selection leaves changes the merge composes by itself out of it (leaveOut), or names the only ones it takes (only), per element or per attribute and relation key. It is sent only together with both expectedHeadId and expectedSourceHeadId, or refused as InvalidSelectionProblem with heads-required before anything is read; an empty leaveOut is the full merge and needs no head. The merge is computed as without one, resolutions included, and each change left out is then applied as the edit that takes the state the merge would land back to this branch’s version, through the same updater a change made by hand goes through. An element left out whole lands as this branch holds it: unchanged where this branch holds it, absent where it does not, still present where the source removed it, and under the owner this branch gives it where the source moved it. An entry with fields merges the element, a move included, with each named key keeping this branch’s value (leaveOut), or takes only the named keys from the source (only); with only, every change no entry names is left out. A relation with a declared inverse is one change with two ends, the relation and the inverse the updater wrote on the other element: it is left out or taken at both ends together, whichever end the selection names, whole or by the relation’s key. An only list taking one end with the key takes it at both, and the other end, unnamed, keeps the inverse. Containment follows the owner, whether or not the request names the members: leaving out a removal keeps everything the removed element owns that the source removed with it, and leaving out an addition leaves out everything the source added under it. An only entry taking an element the source added under an owner it also added, with no entry for that owner, is refused with owner-not-selected. A key that holds members sets only their order; a member comes and goes with its own entry and its owner’s. An entry for an element the merge lands as this branch already holds it changes nothing and is ignored. An entry naming an element neither branch holds, an element the branches conflict on (which resolutions and takeOthers decide), fields of an element only one branch holds, or a key neither branch’s version of the element holds, is refused as InvalidSelectionProblem naming the rule and the element; nothing is applied. Leaving out a change the updater cannot apply, such as keeping a reference to an element the merge removes, refuses the merge as MergeConflictProblem with the updater’s reason for each refused entry under rejected, its elementId the element the entry names; for a merge with no conflict, conflicts is empty. A change that lands referring to an element the source added and the selection leaves out refuses the merge the same way, with the code needs-left-out-element on the referring element, the relation as property, and the element it needs in the message. Nothing is written. The merge commit has the same two parents with or without a selection, so a later merge of the same source does not offer a change left out again, unless the source changes that element since, when it is a conflict.
The model’s dependencies and metamodel pins are merged by rules of their own. A dependency both branches added on one model, or one document read through one metamodel, is one dependency, this branch’s, and the source’s references to its own follow it. What each branch declares and pins is merged three-way: a dependency or pin both branches pinned at different commits is a conflict with the reason pinned-differently, resolved per element by taking one side’s pin whole, and one branch declaring a model the other only brings along declares it. The dependencies a declaration brings along, and the managed dependencies a metamodel pin brings, are derived from what the merged model declares and pins, never merged or offered as conflicts of their own. A reference the merged model holds into content of a dependency it no longer holds, which the merge base or either branch held, is a conflict with the reason dependency-removed on the element holding it, and a resolution that lands such a reference is refused under rejected with dependency-removed. The merged model then passes the rules every write is held to, and one it breaks refuses the merge with that rule’s own problem.
A clean merge, and a resolved one, lands as one commit with two parents, this branch’s head first and the source’s head second, also when this branch has not moved since the two diverged. Its actions name every element the merge created, changed or deleted on this branch, so its diff against its first parent is what the merge brought: each dependency it added, changed or removed as a DEPENDENCY_CREATE, DEPENDENCY_UPDATE or DEPENDENCY_DELETE of its own, and the metamodel pins it moved as one METAMODEL_PIN_UPDATE, in place of an element action. The source branch is neither moved nor deleted. A draft on this branch sees its branch advance, as it does when anyone lands on it. A merge into main keeps the index of which models depend on which in step with what main declares.
expectedHeadId, when sent, must still be this branch’s head, or the merge is refused before anything is read. expectedSourceHeadId, when sent, must still be the source’s head, or the merge is refused naming the source: a source that moved holds versions the resolutions were not chosen from.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”The branch to merge into.
Request Bodyrequired
Section titled “Request Bodyrequired”What merging a branch into the one the route names takes: the branch to merge, what the merge commit is called, optionally the heads the caller expects the two branches at, and, when it resolves a refusal, the side each conflict it names is taken from and the side for every conflict it does not, and optionally the changes kept out of the merge or the only ones let in.
object
The branch to merge from, another branch of the same model.
What the merge commit is called in history. Optional, and a blank or whitespace-only message is stored as absent, as a landing’s is.
The head the caller last saw on the branch merged into. When sent, a branch that has moved past it refuses the merge with BranchHeadConflictProblem before anything is read. When omitted, the merge lands on whatever the branch holds.
The head the caller last saw on the branch merged from. When sent, a source that has moved past it refuses the merge with BranchHeadConflictProblem naming the source, since it holds versions the caller never saw. A caller resolving a refusal sends the sourceCommitId the refusal names. When omitted, the merge takes whatever the source holds.
The side each conflict of a refused merge is taken from, one per conflict, as the refusal’s conflicts name them. Sent only together with both expectedHeadId and expectedSourceHeadId, or refused as InvalidResolutionProblem with heads-required. Read only when the merge is refused again: a merge that is clean by now lands as if none were sent. A resolution naming an element the merge does not refuse, or one named twice, is refused as InvalidResolutionProblem; a conflict left without one refuses the merge as MergeConflictProblem, unless takeOthers covers it.
The side one conflicting element is taken from. A choice between what the two branches hold, never a value: what lands is the chosen side’s version of the element.
object
The conflicting element, as the refusal’s conflicts name it.
target: the element as the branch merged into holds it, or its absence where that branch does not hold it. source: the same from the branch merged from. fields: the target’s version with the fields fields names taken from the side each names, for an element both branches hold as the same type.
For take: fields only, and then at least one: the side each named attribute or relation key is taken from. A key the source does not hold is removed when taken from it. Every key must be one either branch’s version of the element holds, and no longer than 1024 characters; the refusal’s fields lists the ones the two disagree on.
object
The side every conflict no resolution names is taken from whole: target or source, as take reads them. A request that sends it resolves every conflict, so a merge with more conflicts than resolutions may hold can land: name the exceptions in resolutions and take the rest from one side. Sent only together with both expectedHeadId and expectedSourceHeadId, or refused as InvalidResolutionProblem with heads-required; read only when the merge is refused again, so a merge that is clean by now lands as if it were not sent. The server reads fields too, as take does, and refuses it as InvalidResolutionProblem with fields-unexpected before anything is read, since fields are taken per element.
The changes a merge keeps out, or the only ones it lets in, among the changes it composes by itself. Exactly one of leaveOut and only is sent: both, or neither, is refused as InvalidSelectionProblem with both-lists or no-list. The model merge applies it; the dataset merge does not, and refuses a well-formed one with not-supported. Omit the whole selection, or send an empty leaveOut, to merge everything. A selection chooses between what the two branches hold and never carries a value. A conflicting element is resolved by resolutions and takeOthers, never by the selection. An element named by two entries, across the list, is refused with duplicate.
object
The elements whose changes the merge leaves out. An element named whole lands as the branch merged into holds it, or stays absent where that branch does not hold it; one named with fields is merged with each named key keeping that branch’s value. An empty list leaves nothing out, which is the full merge.
One element a selection names, whole or by some of its keys.
object
The element the entry is about.
The attribute and relation keys the entry is limited to. Omitted, the entry names the whole element; an empty list names nothing and is refused as InvalidSelectionProblem with fields-empty, and a key named twice is refused with duplicate.
The only elements whose changes the merge takes from the branch merged from, every other element staying as the branch merged into holds it. An element named with fields takes only the named keys from the source. An empty list takes nothing and is refused with nothing-selected.
One element a selection names, whole or by some of its keys.
object
The element the entry is about.
The attribute and relation keys the entry is limited to. Omitted, the entry names the whole element; an empty list names nothing and is refused as InvalidSelectionProblem with fields-empty, and a key named twice is refused with duplicate.
Responses
Section titled “Responses”The merge landed as one two-parent commit on this branch
A landed merge: the two-parent commit it recorded, and the three commits it was computed from.
object
The merge commit, in the shape a walked commit is listed in. Its parentId is targetCommitId, and its actionTypes describe what the merge brought to the branch it landed on.
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.
The common ancestor the two branches were compared against.
The head the merge landed on, the merge commit’s first parent. A head other than the one the caller last saw means someone landed on the branch in the meantime, and their work is part of the merge.
The source branch’s head that was merged, the merge commit’s second parent.
Example generated
{ "commit": { "id": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "parentId": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "authorId": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "message": "example", "requestId": "example", "createdAt": "2026-04-15T12:00:00Z", "actionTypes": [ "example" ], "closureRecorded": true }, "mergeBaseId": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "targetCommitId": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "sourceCommitId": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0"}The body is missing source, a resolution’s elementId or take, or is over a length or count cap, or source is this same branch, all answered with the plain problem. Or resolutions are sent without both expectedHeadId and expectedSourceHeadId, answered as InvalidResolutionProblem with heads-required before anything is read, as is takeOthers; takeOthers: fields is answered with fields-unexpected before anything is read too. Or the merge is refused again and a resolution cannot be applied as sent, answered as InvalidResolutionProblem naming the rule it broke and its element; nothing is applied. Beyond the heads, resolutions sent with a merge that is clean by now are not read, so they are not refused. Or the merged model breaks a rule the model as a whole is held to at every write, such as two declarations under one name, answered with the plain problem whose detail is that rule’s message, the one the preview lists among its blockers; nothing is written. Or selection sends both lists or neither, names an element or a field twice, or sends an empty fields list or an empty only list, answered as InvalidSelectionProblem before anything is read; or a non-empty selection is sent without both heads, answered as InvalidSelectionProblem with heads-required before anything is read; or an entry names an element neither branch holds, an element the branches conflict on, fields of an element only one branch holds, a key neither branch’s version holds, or, in only, an added element whose added owner no entry takes, answered as InvalidSelectionProblem naming the rule and the element; nothing is applied.
A Problem answered when a merge is refused again and one of the resolutions sent with it cannot be applied as sent. Nothing was applied and nothing was written. Only the first broken rule is named, in the order the resolutions were sent.
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 400 from the plain one a body that cannot be read is refused with.
The rule the resolution broke. not-a-conflict: it names an element the merge does not refuse. duplicate: it names an element another resolution already names. fields-missing: it takes fields and names none. fields-unexpected: it names fields without taking fields, or takes a field from fields, or takeOthers is fields. unknown-field: it names a field neither branch’s version of the element holds, or one longer than 256 characters. not-on-both-sides: it takes fields on an element one branch does not hold. type-differs: it takes fields on an element the two branches hold as different types. heads-required: resolutions or takeOthers were sent without both expectedHeadId and expectedSourceHeadId.
The element the resolution that broke the rule names. Absent for heads-required, which is about the resolutions as a whole, and for fields-unexpected on takeOthers, which names no element.
A Problem answered when a merge request’s selection cannot be read as sent. Nothing was merged. A rule about the selection as a whole is checked before any entry, and only one broken rule is named.
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 400 from the plain one a body that cannot be read is refused with.
The rule the selection broke. both-lists: it sends both leaveOut and only. no-list: it sends neither. duplicate: it names an element another entry already names, or an entry names a field twice. fields-empty: an entry sends an empty fields list; omit fields to name the whole element. nothing-selected: only is an empty list, which takes nothing. conflicting-element: an entry names an element the two branches conflict on, which resolutions and takeOthers decide. unknown-element: an entry names an element neither branch holds. unknown-field: an entry names a key neither branch’s version of the element holds. not-on-both-sides: an entry names fields of an element only one branch holds, which is added or removed whole. owner-not-selected: an only entry takes an element the source added under an owner it also added, and no entry takes that owner. heads-required: a selection with entries was sent without both expectedHeadId and expectedSourceHeadId. not-supported: the merge the route runs does not apply a selection, as the dataset merge does not.
The element the entry that broke the rule names. Absent for both-lists, no-list, nothing-selected, heads-required and not-supported, which are about the selection as a whole.
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/invalid-resolution", "rule": "not-a-conflict"}The model is theirs to read but not to change, answered with the plain problem. Or the caller is an agent acting for a person who did not grant it the right to commit, answered as AgentCommitNotGrantedProblem before anything is read: a merge lands on a shared branch, so such an agent merges nothing and leaves the merge to the person. Or the caller is an agent acting for a person, and the merge into main would reach people outside the organization, answered as AgentPublishNotGrantedProblem with nothing written, whatever else the agent was granted. 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.
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
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 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.
A Problem answered when an agent acting for a person reached a model whose owning organization has not enabled the AI platform the agent runs on, which its token names. Model content reaches the platform an agent runs on, so the organization decides: until an organization admin turns the platform on in the organization’s AI agent platforms setting, every route on the model refuses the agent, conditional reads and the events stream included, and the model list and every page that names other models leave the organization’s models out. A change of the setting applies to new requests within a minute; an events stream that is already open ends at its token’s expiry, at most ten minutes later.
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 403 from the plain one the same routes answer for a model the caller may not read.
A Problem answered when an agent acting for a person tried to land work on a shared branch, and the person did not grant it the right to commit: a merge, or a draft landing on a branch whose name does not start with agent/ (in any case). Nothing was written. Such an agent lands its draft on a branch of its own, which a person reviews and merges.
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 403 from the plain one the same routes answer for a model the caller may not change.
A Problem answered when an agent acting for a person made a request that reaches people outside the person’s organization, and its token holds no permission to publish: a release; a landing on main that would change whether the model, or its working version, is public; any landing on main of a model whose working version is public; and a landing on main that changes the metadata of a public model. The commit permission does not cover these; the person grants publishing as a permission of its own, and the organization that owns the model has to let agents reach that far too. Nothing was written. Without the permission an agent commits on a branch of its own, which a person reviews and merges.
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 403 from the plain one the same routes answer for a model the caller may not change, and from the refusal of a commit, which another permission lifts.
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/agent-level-not-allowed"}The model does not exist, answered with the plain problem, or branchId or source names no branch of it, answered as RefNotFoundProblem. A draft is not a branch, so naming one reads as naming nothing.
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"}One of four, each told apart by type, and none writes anything. The branches disagree on at least one element and the request does not resolve every one, or the updater refused a resolution or a selection entry, and the problem describes every conflict and lists the refused choices under rejected; the source holds nothing this branch does not already have; the two heads have several closest common ancestors, after a criss-cross merge, so there is no base to merge over, answered as AmbiguousMergeBaseProblem naming them, which no merge of these two branches settles; or this branch’s head is not the expectedHeadId that was sent, or moved while the merge was being computed, or the source’s head is not the expectedSourceHeadId that was sent, which is answered as BranchHeadConflictProblem whose conflict.branchId names the branch that moved, and is safe to retry once the caller has read that branch again.
A Problem answered when the two branches of a merge disagree on at least one element and the request did not resolve every conflict, or the updater refused a resolution or a selection entry it sent. Nothing was written. Every conflict rides at once, described, so a caller resolves them all in one more call: it sends the merge again with a resolution per conflict and the two heads this problem names. Every member is always written.
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 409 from the other two a merge answers with.
Every conflicting element, in element-id order, whether resolved or not. Empty only for a merge with no conflict whose selection the updater refused, which rejected then reports.
One element a merge could not take from either branch, why, and what each branch holds for it: enough to choose a side without reading either branch. The names of the elements its values reference are on the problem’s resolvedNames.
object
What the branch merged into holds for the element.
object
Whether the branch holds the element at all.
The element’s type on that branch, absent when it does not hold the element. An element the two branches hold as different types is resolved by taking one side whole.
The ids of the elements that own it on that branch, in id order. Empty for the model’s root, and for an element the branch does not hold. Two branches that placed one element under different owners show it here, with nothing among its fields to tell them apart; taking the element from a side places it under that side’s owners. resolvedNames names them.
What the branch merged from holds for the element.
object
Whether the branch holds the element at all.
The element’s type on that branch, absent when it does not hold the element. An element the two branches hold as different types is resolved by taking one side whole.
The ids of the elements that own it on that branch, in id order. Empty for the model’s root, and for an element the branch does not hold. Two branches that placed one element under different owners show it here, with nothing among its fields to tell them apart; taking the element from a side places it under that side’s owners. resolvedNames names them.
Every attribute and relation the target’s and the source’s version hold differently, attributes first and each kind by key. A relation counts as held differently when its groups or the ownership of its references differ too, even where its target ids read the same. A side that does not hold the element has no values, so every field the other side holds is listed. Empty when the two versions differ in nothing a field carries, such as their type or their owners alone. A pinned-differently conflict lists the pin alone, as one field, @commitId, or @location for an external dependency, whose values are the pins as a reader names them: the version name where the pin is a release, otherwise Snapshot followed by the first eight characters of the pinned commit’s id, and for an external dependency its document, the address or the name an upload arrived under with the first eight characters of its content’s hash. A pin is taken whole: a resolution taking fields of one takes the side it names for that field, and the target’s where it names none.
One attribute or relation of a conflicting element, as the merge base, the target and the source hold it. A value is absent where that version does not hold the key or the element; a stored empty value reads as absent.
object
The attribute or relation key, as the element stores it.
Whether the key is one of the element’s attributes or one of its relations.
The value at the merge base, absent where the base did not hold the element or the key. Shaped as target is.
The value on the branch merged into. An attribute’s value is the list of values it stores; a relation’s is the ids of its targets, group after group, in stored order, which resolvedNames names.
The value on the branch merged from, shaped as target is.
On a pinned-differently conflict on the pin of the model’s metamodel or of one of its extensions only: how many managed dependencies of the branch merged into each side’s pin changes. The built-in elements a pin brings along follow the pin, so they are never conflicts of their own.
object
How many taking the target’s pin changes, which is none, as they already follow it.
How many taking the source’s pin changes.
both-changed: both branches changed the element, differently. changed-and-deleted: one branch deleted it and the other changed it. owner-deleted: one branch created or changed it under an owner the other deleted, which is also the reason when the other deleted the element together with that owner. target-deleted: one branch changed it while it references an element the other deleted. pinned-differently: the element is a dependency, or the model’s metamodel or extension pin, and the two branches pin it at different commits; taking a side takes that side’s pin, and the dependencies it brings along follow it rather than being reported on their own. dependency-removed: the element refers to content of a dependency the other branch removed, so the merged model would hold a reference nothing resolves; a reference that resolved neither at the merge base nor on either branch was already dangling and is not reported. An element is reported once. An inverse relation is written into both of its ends, so one added on one side to an element the other side changed is both-changed. An owned member added on one side to an owner the other side changed is not: member lists combine, and the owner is both-changed only when both sides changed something other than its member lists, differently.
The common ancestor the two branches were compared against.
The head of the branch merged into, as the merge read it. A resolution sends it as expectedHeadId.
The head of the branch merged from, as the merge read it. A resolution sends it as expectedSourceHeadId.
Display name by element id for every conflicting element, every owner its sides name and every element a relation value of the conflicts names, read on whichever branch holds it, else at the merge base, else in the metamodel. An element only a dependency holds is left out, for the client to name.
object
The resolutions and selection entries the updater refused, one per element, in element-id order, each about the element the resolution or entry names. Empty when no choice was sent, or the merge was refused only for a conflict left without one. At most 20 are reported: once that many have failed, the rest are not tried. An entry with code repair-invalid is not about a choice: it names an element no conflict covers, one the merge itself had to repair to stand beside the chosen versions, which then breaks a rule, the message and property saying which. No resolution is to blame for it, and every other resolution was still applied; the way through is choosing differently around that element, or a commit on either branch.
A resolution the updater refused, in the shape every refusal of a change is reported in: code and message are the updater’s own, and property the attribute or relation it refused where it named one. elementId is always present and is the conflicting element the resolution was for, whichever element the updater was looking at; the message names that one. actionIndex and actionType never appear. Among the codes: element-not-found for a version that relates to an element the merged model does not hold, owner-not-found for an element created under, or kept beneath, an owner that is gone, already-owned and multiplicity-violated as a change made by hand meets them, and updater-rejected for a refusal that names no code of its own, and needs-left-out-element for a selection that keeps a change referring to an element the source added and the selection leaves out, about the referring element. One code names no resolution: repair-invalid, whose elementId is an element the merge repaired rather than a conflicting one, refused because the merged state breaks a rule there.
object
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.
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.
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.
The sentence a human reads. Reworded freely, never parsed.
The element the failure is about, where the refusal named one.
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.
The attribute or relation the failure is about, where the refusal named one.
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
The member, an element of the version the dependency leaves.
The name it is listed under, its type when nothing names it.
Its type, as stored.
The element that holds the member, one whose type represents a model and that is connected to the dependency.
The name the element that holds the member is listed under, its type when nothing names it.
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
The name it is listed under, its type when nothing names it.
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.
object
The key the reference is stored under.
The name the metamodel shows for the relation; absent when it declares none.
A Problem answered when the source branch holds no commit the target does not already have: its head is the merge base of the two. Nothing was written.
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 409 from the others a merge answers with.
A Problem answered when the two heads have several closest common ancestors, as they do after a criss-cross merge: each branch was merged into the other from a head that did not yet hold the other merge. There is then no single base to compare or merge over, and a merge over any one of them can undo, without a conflict, a deletion the other side made since. Nothing was written. A merge of the same two branches, in either direction, answers the same; one history has to be made to contain the other first, by creating one branch again from the other’s head.
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 409 from the others the merge and compare routes answer with.
The common ancestors no other common ancestor descends from, in id order: the two pre-merge heads of a criss-cross.
A Problem answered when a gated write lost its compare-and-set: the head the write was written against was no longer the ref’s head when the write reached it, so nothing was written. It names the ref and the two heads, and carries no gap.
It stands in for DraftHeadConflictProblem where the gap cannot be walked: a landing whose draft was discarded while the refusal was being built, and a rebase whose swap lost to a change staged while the replay was running. On a rebase the conflict.branchId is the draft’s own ref id rather than the branch it targets, because the ref that moved is the draft.
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 409 from the others the same routes answer with.
Always the sentence Branch HEAD has advanced since this commit's baseline., whichever ref moved. What a human reads, never parsed.
object
The ref whose head the write was gated on.
The head the write was written against, which is no longer the current one.
The head as it now stands. Absent when the follow-up read that fills it found no ref, which is what a discarded draft leaves behind.
Example
{ "type": "https://modeldesk.io/problems/merge-conflict", "conflicts": [ { "fields": [ { "kind": "attribute" } ], "reason": "both-changed" } ]}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" } ]}