Create an import
const url = 'https://api.modeldesk.io/imports';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"metamodel":"2489E9AD-2EE2-8E00-8EC9-32D5F69181C0","metamodelVersion":"example","metamodelExtensions":["2489E9AD-2EE2-8E00-8EC9-32D5F69181C0"],"metamodelExtensionVersions":{"additionalProperty":"example"},"metamodelAddOns":["2489E9AD-2EE2-8E00-8EC9-32D5F69181C0"],"metamodelAddOnVersions":{"additionalProperty":"example"},"loader":"example","resolveImports":true,"source":{"type":"upload","filename":"example","binaryData":"example"},"owner":{"id":"2489E9AD-2EE2-8E00-8EC9-32D5F69181C0","type":"USER","name":"example"},"referringModelId":"2489E9AD-2EE2-8E00-8EC9-32D5F69181C0","targetModelId":"2489E9AD-2EE2-8E00-8EC9-32D5F69181C0","targetBranchId":"2489E9AD-2EE2-8E00-8EC9-32D5F69181C0","accessMode":"SHARED"}'};
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/imports \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "metamodel": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "metamodelVersion": "example", "metamodelExtensions": [ "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0" ], "metamodelExtensionVersions": { "additionalProperty": "example" }, "metamodelAddOns": [ "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0" ], "metamodelAddOnVersions": { "additionalProperty": "example" }, "loader": "example", "resolveImports": true, "source": { "type": "upload", "filename": "example", "binaryData": "example" }, "owner": { "id": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "type": "USER", "name": "example" }, "referringModelId": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "targetModelId": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "targetBranchId": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "accessMode": "SHARED" }'Create model import. Without targetModelId the import creates a model once it is completed. With targetModelId it imports a newer version of the file into the model an earlier import of it created: the loader is that import’s, and the metamodel, its version, the extensions and the add-ons with their versions are those of the target branch (targetBranchId, the model’s main branch when absent), taken by the server. Such a request may leave metamodel, metamodelVersion, the extensions, the add-ons and loader out; stating any of them differently is refused. It needs what an import needs and write access to the model, its owner must be the model’s owner, and it is refused before anything is stored. The import is shared or individual as the model is. An upload is read in the request; once the import is READY its parse is committed to the model’s import line and importCommitId names the commit. A file that changes nothing on the line writes no commit, and importCommitId names the line’s head instead, so an import with an importCommitId is always prepared. A file at an address is read by the import job, which commits it the same way, after checking that the person who created the import may still change the model. Each commit is made on the line’s head it was matched against; the commit, its record on the import and the deletion of the other READY imports into the model land together or not at all, so the last import to land is the one waiting. A new import that fails to read or to commit leaves the earlier one waiting. An import waits for review when it is READY and its importCommitId is the head of the model’s import line; a READY one whose commit is no longer the head was superseded. A parse that cannot be committed puts the import in ERROR with a message that says why.
Authorizations
Section titled “Authorizations”Request Body
Section titled “Request Body”An import. Without targetModelId, metamodel, metamodelVersion, metamodelExtensionVersions and loader are required. With targetModelId the server takes them from the model and the target branch, and a request that states any of them differently is refused with 422.
object
The metamodel to import into. Required unless targetModelId is sent.
The release of metamodel to import into, by version name. Required unless targetModelId is sent: the server never falls back to the latest release on an import’s behalf.
The release of each extension in metamodelExtensions, by version name, keyed by extension id. Every extension needs an entry, and a missing one is refused; send {} when there are no extensions.
object
The add-ons the imported model adds to its metamodel, in the order their profiles apply. Each must be offered for metamodel and listed once.
The standard version per add-on id; required for every add-on listed.
object
The loader to read the source with, by name; see GET /model-loaders. Required unless targetModelId is sent, when it is the loader of the import that created the model.
Whether to read the documents the source imports, such as the vocabularies an RDF file names with owl:imports. false reads the file on its own: nothing it imports is fetched or taken from what an earlier import kept, and each term it uses without defining it becomes an element of the model that stands for that term. Use it for a file meant to stand alone, such as shapes shipped as a platform model. A loader that reads no imports reads the file the same either way. Omitting it means true.
Where an import reads its file from.
A file sent with the request.
object
The file’s name, which some loaders read the format from.
The file’s bytes.
A file the server fetches.
object
object
USER is a person, MACHINE a service account, and SYSTEM the platform itself, whose commits (metamodel seeding and re-pins) the commit log hides unless asked for them.
The display name, where one is known: a person’s from their account, a service account’s as stored with what it wrote. Left out for the platform and for a person whose account holds no name.
The model whose unresolved references this import is meant to answer, carried from its references panel. Completing the import adds the imported model to it as a dependency. Omit for an import started from the imports page.
The existing model to import into: one a completed import of an earlier version of the file created, with a loader that can match a newer file with the model’s elements. Omit for an import that creates a model. owner must be the model’s owner, and referringModelId must be left out.
The branch of targetModelId to import into; the model’s main branch when absent. Only sent with targetModelId.
Who inside the owning organization may reach a model. Optional on creation and update: a creation that omits it takes the owner organization’s default access mode (falling back to SHARED).
Responses
Section titled “Responses”Created
object
object
True when a model can be created on the metamodel only together with an extension that concretizes it.
Absent on an ordinary information metamodel. DATA_SCHEMA marks one whose models the platform derives for datasets: it is never offered where models are created, imported or picked.
The display name of the tower this metamodel is the root of. Authored on the root only. Presentation data: it changes no resolution, validation or dependency behavior.
One line describing the tower, authored on its root beside towerName.
The metamodel’s task line, what a user makes with a model of it.
True when the metamodel exists only for other metamodels to build on, so no one creates or imports a model on it directly. Absent means false.
The language tag of the language the metamodel’s standard is written in, in lower case. Authored on a base metamodel only; omitted when the standard declares none.
The version of the standard the metamodel implements. A release is named after it, or 1.0.0 when the metamodel declares none.
The declared base metamodel that application profiles of this metamodel are built to profile, propagated from a family extension’s binding. Absent on a base metamodel and on any metamodel carrying no family binding.
True when the metamodel is an add-on: a model adds its profiles on top of its own metamodel, so no one creates or imports a model on it directly. Absent means false.
The release of the metamodel the import reads into. Absent only on imports older than version pinning.
Where an import reads its file from.
A file sent with the request.
object
The file’s name, which some loaders read the format from.
The file’s bytes.
A file the server fetches.
object
object
USER is a person, MACHINE a service account, and SYSTEM the platform itself, whose commits (metamodel seeding and re-pins) the commit log hides unless asked for them.
The display name, where one is known: a person’s from their account, a service account’s as stored with what it wrote. Left out for the platform and for a person whose account holds no name.
Who inside the owning organization may reach a model. Optional on creation and update: a creation that omits it takes the owner organization’s default access mode (falling back to SHARED).
object
The model a completed import created.
The existing model the import goes into. Absent for an import that creates a model.
The branch of targetModelId the import merges into. Absent when the import names no target.
The model whose unresolved references sent the user here, when the import was started from a references panel. Completing such an import adds the imported model to this one as a dependency, and the import page uses it to offer the resolve and the way back. Absent for an import nobody was referred from.
What completing an import did about the model that sent the user to it. Exactly one field is set. The dependency answers rules the import never had to satisfy — the referring model may admit no dependency on this metamodel, or belong to another owner — and failing the completion over one of them would throw away a model the user has already reviewed and named, so the import completes either way and records which happened.
object
The dependency created on the referring model. Absent when none was.
Why no dependency was created. Absent when one was.
A compiled metamodel, documented in full under Get a metamodel (GET /metamodels/{metamodelId}).
object
A compiled metamodel extension, documented in full under Get a metamodel extension (GET /metamodel-extensions/{extensionId}).
object
The release of each extension, by version name, keyed by extension id.
object
The add-ons the imported model adds to its metamodel, in order.
The add-ons, compiled at their pinned releases, in order. An add-on whose release is no longer registered is left out.
A compiled metamodel, documented in full under Get a metamodel (GET /metamodels/{metamodelId}).
object
The pinned standard version per add-on id.
object
The existing model the import goes into. Absent for an import that creates a model.
The branch of targetModelId the import merges into. Absent when the import names no target.
The import that created targetModelId; its loader is the one this import parses with. Absent when the import names no target.
The commit holding this import’s parse on the target model’s import line. Absent until that commit is written, and when the import names no target.
The merge commit that brought this import into targetBranchId. Absent until the import is merged, and when the import names no target.
The model whose unresolved references sent the user here, when the import was started from a references panel. Completing such an import adds the imported model to this one as a dependency, and the import page uses it to offer the resolve and the way back. Absent for an import nobody was referred from.
What completing an import did about the model that sent the user to it. Exactly one field is set. The dependency answers rules the import never had to satisfy — the referring model may admit no dependency on this metamodel, or belong to another owner — and failing the completion over one of them would throw away a model the user has already reviewed and named, so the import completes either way and records which happened.
object
The dependency created on the referring model. Absent when none was.
Why no dependency was created. Absent when one was.
What completing the import did about the model’s lineage, when the imported file declares the model it was generated from: one entry per model the imported one was generated from, and one per earlier import’s model that was generated from this one. Absent until the import completes, and for an import whose file declares no lineage.
What completing an import did about one model the imported model was generated from, or one model generated from it. Completing an import whose file names its source looks for an earlier import of that source by the same owner, and declares the newer model based on the older one, with a link per element pair the file declares. Exactly one of correspondenceId and notCreated is set. The model is already created and named when this runs, so a link that cannot be made never fails the completion: it is recorded here with the reason.
object
SOURCE when the completed import’s model is based on an earlier import’s model; DERIVED when an earlier import’s model is now based on the completed import’s model.
The source tool’s identity of the model looked for: the source’s for SOURCE, the completed import’s own for DERIVED. Opaque; meant for matching, not for display.
The model the derived one is based on. Absent when no earlier import of the source was found.
The model that holds the correspondence, the one based on the other.
The correspondence created on the derived model. Absent when none was.
The element links written.
The element pairs the file declares that were left out, because one of the two elements is not in its model.
Why no correspondence was created, as a sentence. Absent when one was.
object
INFO entries are informational — something the reader should know that is not a defect, notably the “unverifiable” verdicts of profile resolution. An INFO entry never makes a model invalid.
The other element a finding is about, where it concerns two: the element whose key or value this one repeats, or the dependency element publishing the same IRI.
A hash of the value the finding was about. Sent with modelElementId (as elementId, left out for a model-level finding), code and property to POST /models/{modelId}/dismissals to dismiss the finding; the dismissal holds while the value hashes the same.
Who dismissed this warning or informational finding and when, where a dismissal of the model names it by element, code, property and fingerprint, so while the value it was about is unchanged. Never on an error, nor on a finding on an element another model answers for.
object
Who dismissed it: a person (USER) with their current name. name is absent where nothing answers to the id any more, such as an erased user.
object
USER is a person, MACHINE a service account, and SYSTEM the platform itself, whose commits (metamodel seeding and re-pins) the commit log hides unless asked for them.
The display name, where one is known: a person’s from their account, a service account’s as stored with what it wrote. Left out for the platform and for a person whose account holds no name.
What exactly a finding is about, when its check can report more than one finding at the same code, element and property: a relation target, an offending value (with its language tag for a language string) or an identifier the check is about. Exactly one of target, value and name is present, language only beside value.
object
The finding’s identity across validation runs: the lowercase hex SHA-256 of the canonical JSON of code, modelElementId (as elementId), property and subject, each left out when absent, keys sorted and no whitespace. Neither valueIndex nor the message is part of it. Present on every entry of a validation result.
Example
{ "metamodel": { "kind": "DATA_SCHEMA" }, "source": { "type": "upload" }, "status": "INITIALIZED", "owner": { "type": "USER" }, "accessMode": "SHARED", "lineageOutcomes": [ { "direction": "SOURCE" } ], "logEntries": [ { "logLevel": "WARN", "dismissed": { "by": { "type": "USER" } } } ]}Bad request. Also returned when metamodel names a layer-only metamodel, one that exists only for other metamodels to build on, whose problem detail names the metamodels in its tower to use instead; or an add-on, which is added to a model of another metamodel.
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 caller may not create an import for owner, holds no seat for its metamodel, or may not change the model targetModelId names, answered with the plain problem. Or the caller is an agent acting for a person and the owning organization has not enabled the agent’s AI platform, answered as AgentPlatformNotEnabledProblem, or caps agents below proposing, answered as AgentLevelNotAllowedProblem; or the import would supersede an import of another origin waiting in the model and the person has not granted committing, answered as AgentChangeNotOwnProblem.
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 tried to take back or land a staged change it did not stage itself, the person’s or another agent’s, and the person did not grant it the right to commit: an undo of such a change, a rebase that drops one, or a landing of a draft that holds one, on any branch. A change is the agent’s own when its changeRequestId names the agent’s session. Nothing was changed. Such an agent leaves the change to the person, who decides what becomes of it in the app.
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 landing elsewhere, which a branch of the agent’s own avoids.
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-level-not-allowed"}targetModelId names no model the caller may read (a deleted model included), or targetBranchId is not a branch of it (RefNotFoundProblem; a draft and a generated ref are no branch to import into).
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 into a model is refused (ImportIntoModelRefusedProblem, naming its reason), or a version pin is missing or unknown, or targetBranchId is sent without targetModelId.
A Problem answered when an import into a model is refused before anything is stored, or when an import into a model is asked to complete. A 422, told apart by its type from the plain 422 a missing or unknown version pin answers.
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 into a model is refused. not-created-by-import: no completed import without a target created the model (it was created in ModelDesk, duplicated, built by a mapping, or arrived by bundle without its import record). loader-cannot-import-into-model: the loader that created the model cannot match a newer file with its elements. first-commit-not-found: the model’s history no longer starts at the commit its import wrote. loader-differs, metamodel-differs, metamodel-version-differs, extensions-differ, add-ons-differ: the request states one of these differently from the model and its target branch. owner-differs: the import’s owner is not the model’s owner. referring-model-not-allowed: the request names referringModelId. pin-without-version: the target branch’s pin records no version name. remote-source-needs-a-person: a service account named a file’s address instead of uploading it. targeted-import-cannot-complete: the complete route was called on an import into a model.
The model the import goes into.
Example
{ "type": "https://modeldesk.io/problems/import-into-model-refused", "reason": "not-created-by-import"}The caller is an agent acting for a person, and either the models the person’s agents created in the last hour, or the last day, reach the bound (AgentCreationRateLimitedProblem), or the import names an address and the person’s agents already made the server fetch as many documents within the hour as the bound allows (AgentFetchRateLimitedProblem). Nothing was stored. The import job charges each document it fetches for an agent’s import, an upload’s too, and fails the import at the first one past the bound.
A Problem answered when an agent acting for a person asked to create a model while the models that person created through an agent in the last hour, or the last day, already reach the bound. The bound is counted in the database, so it holds across instances; it is a count before the insert, so requests in flight together may pass it by as many as arrive at once. The person creates more models in the app or at a shell.
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.
The number of creations the bound admits within window.
The time the bound counts over, in seconds.
A Problem answered when an agent acting for a person would make the server fetch one document more than that person’s agents may within the hour, whether the agent named its address or an uploaded document did; an address refused before any connection counts as one. A guardrail against the server being used to send requests to third parties, counted on each server instance in memory, not a quota. The agent sends the documents’ content instead, or tries again 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.
The number of documents the bound admits within window.
The time the bound counts over, in seconds.
Example
{ "type": "https://modeldesk.io/problems/agent-creation-rate-limited"}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" } ]}