Create an alignment link
const url = 'https://api.modeldesk.io/models/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0/working-sets/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0/links';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"sourceElementId":"2489E9AD-2EE2-8E00-8EC9-32D5F69181C0","targetElementId":"2489E9AD-2EE2-8E00-8EC9-32D5F69181C0","linkElement":{"id":"2489E9AD-2EE2-8E00-8EC9-32D5F69181C0","elementId":"2489E9AD-2EE2-8E00-8EC9-32D5F69181C0","owner":{"id":"2489E9AD-2EE2-8E00-8EC9-32D5F69181C0","relation":"example"},"type":"example","attributes":{"additionalProperty":["example"]},"relations":{"additionalProperty":{"additionalProperty":[{"id":"2489E9AD-2EE2-8E00-8EC9-32D5F69181C0","owned":true,"modelId":"2489E9AD-2EE2-8E00-8EC9-32D5F69181C0"}]}},"ownedElements":{"additionalProperty":[]}}}'};
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/working-sets/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0/links \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "sourceElementId": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "targetElementId": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "linkElement": { "id": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "elementId": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "owner": { "id": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "relation": "example" }, "type": "example", "attributes": { "additionalProperty": [ "example" ] }, "relations": { "additionalProperty": { "additionalProperty": [ { "id": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "owned": true, "modelId": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0" } ] } }, "ownedElements": { "additionalProperty": [] } } }'Create alignment link
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”Request Body
Section titled “Request Body”object
An element to create, or an existing one to adopt under a new owner.
elementId decides which. Set, the payload adopts the element it names and creates nothing, so type and ownedElements are ignored, at every depth. Absent, an element is created and type is required. A payload that adopts has to name its owner at the top level; nested under ownedElements the owner is the parent and the relation it sits under, unless it names another. A creation that names no owner is placed on the model’s root element under its @element relation.
object
The id the new element is to receive. Omitted, the server mints one. Supplying it is what lets a later action of the same staged change name this element; an id that already exists is refused. Only a staged change honours it: the direct element-create route drops it, and every nested one, and mints its own. Distinct from elementId, which names an element that is already there and asks for it to be adopted.
An element of this model to adopt under owner instead of creating one. It has to exist in the state the change is applied to and be this model’s own: one held by a dependency or by the metamodel is answered element-not-found, because it is not this model’s to place. A nested entry whose owner already holds the element through that relation is not adopted again, only listed in the relation it sits under, at its position.
object
The type of the element to create. Required unless elementId adopts one instead.
object
The element’s outgoing relations, keyed by relation name. Each value is the relation’s target refs keyed by group, with @@ naming the group of an ungrouped relation.
object
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.
Elements to create under this one, keyed by the relation that owns them. Each is a creation in its own right, so id, elementId and further nesting reach every node of the tree. Ignored on a payload that adopts.
object
Example generated
{ "sourceElementId": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "targetElementId": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "linkElement": { "id": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "elementId": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "owner": { "id": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "relation": "example" }, "type": "example", "attributes": { "additionalProperty": [ "example" ] }, "relations": { "additionalProperty": { "additionalProperty": [ { "id": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "owned": true, "modelId": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0" } ] } }, "ownedElements": { "additionalProperty": [] } }}Responses
Section titled “Responses”Created
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.
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.
object
object
Example
{ "createdBy": { "type": "USER" }, "assignedTo": { "type": "USER" }}Bad request
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" } ]}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" } ]}