Get what a model says about its source
const url = 'https://api.modeldesk.io/models/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0/source';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/models/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0/source \ --header 'Authorization: Bearer <token>'Whether a newer version of the file a model was imported from can be imported into it and, if not, why; the loader that reads the file; the last import merged into the model or, failing that, the import that created it; and the import waiting for review, if any. Needs read access to the model; a model that is gone and one the caller may not read answer the same 404. An import’s source and creator are sent only to a caller who may read that import. The waiting import carries its plan’s counts, computed again on every read.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”Responses
Section titled “Responses”OK
What a model says about the file it was imported from.
object
Whether a newer version of the file can be imported into the model.
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 loader of the import that created the model, which reads every import into it. Absent when no import created the model.
One import as a model’s source facts name it. As lastImport: the last import merged into the model, also after its record was deleted, since its merge stays in the model’s history, or, failing that, the import that created it. As waitingImport: the import whose commit is the head of the model’s import line. sourceName and createdBy are sent only when the caller may read that import itself by its own access rules; otherwise the entry only says that the import exists. For a lastImport merged into the model, the same readers keep both after its record was deleted, since its merge stays in the model’s history.
object
The file name of an upload, or the address of a file fetched from one, reduced to its scheme, host, port and path: user info, query and fragment are never sent. An address that cannot be read that way is sent as (address not shown). Absent when the caller may not read the import.
When the import was made.
When the import’s merge commit landed, for an import merged into the model. Absent for the import that created the model, and for a waiting import.
object
Whether this is the import that created the model rather than one merged into it.
The branch of the model the import goes into, for an import into the model; absent for the import that created it. Sent to every reader of the model.
The merge commit that brought an import merged into the model, whose second parent is the import’s commit. Absent for one merged with nothing to merge, and for any other import.
For the waiting import, what merging it would change, counted by the code GET /imports/{importId}/plan runs, as for a reader: nothing is written. Each backend keeps the counts per branch head and import commit, so a repeated read does not compute them again. Absent for any other import, and when the plan could not be computed within ten seconds or failed.
object
Elements changed where they stand.
Elements moved to another owner, changed or not.
One import as a model’s source facts name it. As lastImport: the last import merged into the model, also after its record was deleted, since its merge stays in the model’s history, or, failing that, the import that created it. As waitingImport: the import whose commit is the head of the model’s import line. sourceName and createdBy are sent only when the caller may read that import itself by its own access rules; otherwise the entry only says that the import exists. For a lastImport merged into the model, the same readers keep both after its record was deleted, since its merge stays in the model’s history.
object
The file name of an upload, or the address of a file fetched from one, reduced to its scheme, host, port and path: user info, query and fragment are never sent. An address that cannot be read that way is sent as (address not shown). Absent when the caller may not read the import.
When the import was made.
When the import’s merge commit landed, for an import merged into the model. Absent for the import that created the model, and for a waiting import.
object
Whether this is the import that created the model rather than one merged into it.
The branch of the model the import goes into, for an import into the model; absent for the import that created it. Sent to every reader of the model.
The merge commit that brought an import merged into the model, whose second parent is the import’s commit. Absent for one merged with nothing to merge, and for any other import.
For the waiting import, what merging it would change, counted by the code GET /imports/{importId}/plan runs, as for a reader: nothing is written. Each backend keeps the counts per branch head and import commit, so a repeated read does not compute them again. Absent for any other import, and when the plan could not be computed within ten seconds or failed.
object
Elements changed where they stand.
Elements moved to another owner, changed or not.
Example
{ "reason": "not-created-by-import", "lastImport": { "status": "INITIALIZED" }, "waitingImport": { "status": "INITIALIZED" }}Not found
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" } ]}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" } ]}