Track validation findings as work items
const url = 'https://api.modeldesk.io/models/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0/work-items/findings';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"ref":"2489E9AD-2EE2-8E00-8EC9-32D5F69181C0","keys":["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/work-items/findings \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "ref": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "keys": [ "example" ] }'Validates the model at ref once and, for each key that run reports as a warning or an error, creates a work item of type finding, or answers the live finding item that already tracks it, raised on whichever ref. Only keys travel: an item’s title, problem, anchor and finding record come from the server’s own run. A key the run does not report answers NOT_PRESENT, an information-only finding NOT_TRACKABLE. A key named twice is answered once. Up to 500 keys per request; a larger selection is sent in batches. Every reader of the model with a seat may track, on a branch or on their own draft.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”Request Bodyrequired
Section titled “Request Bodyrequired”Tracking findings of a model’s validation report by key. What the items say comes from the server’s own validation of the model at ref; a larger selection is sent in several requests, in report order.
object
The branch or draft the report was read at, and the items are raised on.
The findings by key, in report order.
Example generated
{ "ref": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "keys": [ "example" ]}Responses
Section titled “Responses”OK
What tracking did, one outcome per key of the request, in the request’s order.
object
What tracking did with one finding of a request, by its key.
object
CREATED: a finding item was created for it. EXISTING: a live finding item already tracks it, raised on whichever ref. NOT_PRESENT: the validation at the request’s ref did not report it. NOT_TRACKABLE: it is information only, which is not tracked.
The number of the item that tracks the finding; present with CREATED, and with EXISTING when the caller may see the item: an item raised on another member’s live draft answers EXISTING without a number.
Example
{ "outcomes": [ { "outcome": "CREATED" } ]}Invalid input: no keys or more than 500, or a ref that is not a branch of the model or the caller’s draft.
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 is a member of the organization without a seat (on the model’s metamodel, for a model’s routes), or is a service account, which no work item route admits.
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 model is not there for the caller: it does not exist, belongs to another organization, is another member’s individual model, or its organization does not have work items. Also the answer for an item number the caller may not see.
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" } ]}