Get what merging an import would do
const url = 'https://api.modeldesk.io/imports/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0/plan';const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request GET \ --url https://api.modeldesk.io/imports/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0/plan \ --header 'Authorization: Bearer <token>'What merging an import that waits for review into the branch it goes into would do, computed as the branch merge computes it with the model’s import line, held to the import’s commit, as its source; nothing is written and nothing is stored, so every read computes it again. changes is the diff from the branch’s head to the state the merge would land with every conflict standing as the branch holds it, in the shape the branch diff route answers, owners whose members changed and the closure’s elements included, so a review places each change as it does for a branch: a change the branch already holds, such as a pin both sides share, is not listed, and importing the unchanged file lists nothing. counts counts the changes a merge selection can act on. conflicts, resolvedNames, closureChanges and blockers are the merge preview’s; blockers is always empty for a caller who may read the model and may not write it. sourceName and createdBy are sent only to a caller who may read the import by its own access rules, as on the model’s source route.
Needs read access to the model the import goes into; an unknown import and one into a model the caller may not read answer the same 404. An import whose parse is not on the import line yet is prepared on this read for a caller who may write the model: at once for the person who created the import, and for any other writer once it has gone unprepared for ten minutes. The commit is always the creator’s. A reader’s read writes nothing.
An import that is not waiting for review has no plan and is answered with its state as ImportNotMergeableProblem: not-prepared (its file is still being read, or its parse is not on the import line yet), superseded (a newer import into the model committed on top of it), merged (with mergeCommitId when its merge landed a commit), failed (with the import’s errorMessage for a caller who may read the import by its own access rules), deleted (it was discarded), or creates-model (it creates a model rather than going into one).
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”Responses
Section titled “Responses”OK
What merging an import that waits for review into the branch it goes into would do, computed as the merge computes it with nothing written.
object
The branch the import goes into.
object
The common ancestor of the branch’s head and the import’s commit; the import’s commit itself when the branch already holds it.
The branch’s head the plan was computed from, which a merge may hold as expectedHeadId.
The import’s commit on the model’s import line, the merge commit’s second parent, which a merge may send as expectedSourceHeadId.
The changes the merge would make to the branch, from its head (parentCommitId) to the state the merge would land with every conflict standing as the branch holds it; commitId is the import’s commit. elements is left out when it is empty, as on the branch diff.
object
Null for initial commits.
object
Element name resolved at commit time.
Changed attributes only.
object
object
Attribute values before the change. Null for ADDED elements.
Attribute values after the change. Null for REMOVED elements.
Changed relations only.
object
One relation that differs between the two states. before and after carry the relation whole, so a reader can show the targets it kept beside the ones it gained or lost, and a relation whose targets were only reordered differs in them alone. An empty list is omitted: an ADDED element’s relation carries no before, a REMOVED element’s no after.
object
Element IDs of the relation’s targets before the change, in order.
Element IDs of the relation’s targets after the change, in order.
Element IDs of newly added relation targets.
Element IDs of removed relation targets.
Display label by element ID for every element the diff names: each entry, every target a changed relation holds before or after the change, and the elements its diagram actions name. An element neither state nor the current model holds is left out.
object
Every element of the state the merge would land whose stored form differs from the branch’s head, whole, by id, in the form a model state gives its elements. Laid over the branch’s state at targetCommitId, with the elements changes lists as REMOVED taken away, it gives the landing state exactly: each element changes lists as added or modified, owners whose members changed included, and any element whose stored form differs in what a diff entry does not show, such as a reference’s owned flag or group. With conflicts, the landing state is the one with every conflict standing as the branch holds it, as for changes. Empty when nothing would change.
object
object
object
object
object
object
Owning model of the referenced element when it differs from the containing model (cross-model reference, e.g. a lineage base element). Omitted for same-model references.
The values the element holds that its type declares no property for; absent when none.
A value an element holds under no binding its type declares, kept so a round trip loses nothing.
object
object
object
object
Owning model of the referenced element when it differs from the containing model (cross-model reference, e.g. a lineage base element). Omitted for same-model references.
A structure the import holds without an element, kept with its own properties inside the layer of the element that refers to it. A node is held once; any other place that refers to it holds a reference to it instead.
object
The property that links the holding element or the enclosing node to this node; absent on a node no property links to.
The node’s global identity in the format’s own terms; absent on an anonymous node.
A label unique within the model, set only on an anonymous node that is referred to more than once.
Whether this entry only points at the node another entry holds under the same localId.
Whether the node is an ordered list, whose entries are its members in order.
Where an element was derived from: the source and rules models, and per property the source values it read.
object
object
object
object
Owning model of the referenced element when it differs from the containing model (cross-model reference, e.g. a lineage base element). Omitted for same-model references.
object
object
object
Owning model of the referenced element when it differs from the containing model (cross-model reference, e.g. a lineage base element). Omitted for same-model references.
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 display name of every element the conflicts name, by id.
object
One change a merge would make to the dependencies of the branch it lands on. A pin is named as a reader names it: the version name where the pin is a release, and otherwise Snapshot followed by the first eight characters of the pinned commit’s id. An external dependency’s pin is its document: the address it is read from, or the name an upload arrived under followed by the first eight characters of its content’s hash.
object
added: the merge adds a dependency the branch does not declare. removed: it removes one the branch declares. repinned: it moves one the branch declares to another pin. metamodel-repinned: it moves the pin of the model’s metamodel. extension-repinned: it moves the pin of one of the model’s metamodel extensions, named by the extension. A dependency the model holds only because another brings it along, and a managed one, follows what is declared and pinned and is never named on its own.
The name of the model depended on, of the document an external dependency reads, or of the metamodel or extension whose pin moves.
The pin the branch merged into holds. Present on a repin, absent on an addition, and optional on a removal.
The pin the merge lands. Present on an addition and a repin, absent on a removal.
What would refuse the merge on grounds no choice of side resolves, as the merge preview names it; always empty for a caller who may not write the model.
How many changes merging an import would make to its branch, by kind, and how many conflicts there are. Counted by the rule a merge selection acts on, so each counted change is one a selection can leave out: an element added, removed, moved, or changed in a field or in the order of its members. An owner whose only difference is which members it holds is not counted (its members are), and neither are dependency edges, external placeholders or the root’s dependency list, which closureChanges reports. changes lists more than is counted, in the shape the branch diff route answers, so a review can place every change.
object
Elements changed where they stand.
Elements moved to another owner, changed or not.
How much of the model the file speaks for; every import into a model is whole.
The file name or address the import read, in the form the source route sends it. Absent when the caller may not read the import by its own access rules.
object
When the import was made.
Example
{ "changes": { "elements": [ { "diffType": "ADDED" } ] }, "landed": { "additionalProperty": { "extensionLayer": [ { "kind": "attribute" } ], "lineage": { "properties": [ { "propertyType": "ATTRIBUTE", "sources": [ { "propertyType": "ATTRIBUTE", "role": "PRIMARY" } ] } ] } } }, "conflicts": [ { "fields": [ { "kind": "attribute" } ], "reason": "both-changed" } ], "closureChanges": [ { "kind": "added" } ], "scope": "whole"}The caller is an agent acting for a person and the organization that owns the model the import goes into has not enabled the agent’s AI platform, answered as AgentPlatformNotEnabledProblem.
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.
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-platform-not-enabled"}No such import, or one into a model the caller may not read, or, for one that creates a model, one the caller may not read by its own access rules.
An RFC 9457 problem document, always sent as application/problem+json.
object
Present only on a typed refusal, whose own schema requires it and fixes its value. An untyped problem omits it, which RFC 9457 defines as about:blank: the status and title are all there is to branch on.
The path of the request that was refused. Absent when the request was refused before it reached the application’s handlers: a 401 for a missing or unusable access token, and a 403 for a service account whose scopes do not reach the route.
Present on a 400 raised by request-body validation, and on a 422 that refuses named fields (a malformed slug or namespace prefix). Each entry names the rejected property, so a client can attach the message to the field that caused it rather than showing one error for the whole form.
object
Example generated
{ "type": "https://example.com", "title": "example", "status": 1, "detail": "example", "instance": "example", "violations": [ { "property": "example", "message": "example" } ]}The import is not waiting for review (ImportNotMergeableProblem, naming its state).
A Problem answered when an import is not waiting for review, so it has no plan and cannot be merged. A 409; 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
Why an import has no plan and cannot be merged. not-prepared: its file is still being read, or its parse is not on the model’s import line yet. superseded: a newer import into the model committed on top of it. merged: it was merged already. failed: it failed. deleted: it was discarded. creates-model: it creates a model rather than going into one. not-ready and other-commit: it stopped being the import the merge read while the merge ran.
For merged, the merge commit; absent when the import was merged with nothing to merge.
For failed, what the import failed with; sent only to a caller who may read the import by its own access rules, since the text can name the file’s address.
Example
{ "type": "https://modeldesk.io/problems/import-not-mergeable", "reason": "not-prepared"}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" } ]}