Skip to content

Track validation findings as work items

POST
/models/{modelId}/work-items/findings
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.

modelId
required
string format: uuid
Media typeapplication/json

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
ref
required

The branch or draft the report was read at, and the items are raised on.

string format: uuid
keys
required

The findings by key, in report order.

Array<string>
>= 1 items <= 500 items

Example generated

{
"ref": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0",
"keys": [
"example"
]
}

OK

Media typeapplication/json

What tracking did, one outcome per key of the request, in the request’s order.

object
outcomes
required
Array<object>

What tracking did with one finding of a request, by its key.

object
key
required
string
outcome
required

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.

string
Allowed values: CREATED EXISTING NOT_PRESENT NOT_TRACKABLE
number

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.

integer format: int64

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.

Media typeapplication/problem+json

An RFC 9457 problem document, always sent as application/problem+json.

object
type

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.

string format: uri
title
required
string
status
required
integer
detail
required
string
instance

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.

string
violations

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.

Array<object>
object
property
required
string
message
required
string

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.

Media typeapplication/problem+json

An RFC 9457 problem document, always sent as application/problem+json.

object
type

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.

string format: uri
title
required
string
status
required
integer
detail
required
string
instance

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.

string
violations

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.

Array<object>
object
property
required
string
message
required
string

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.

Media typeapplication/problem+json

An RFC 9457 problem document, always sent as application/problem+json.

object
type

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.

string format: uri
title
required
string
status
required
integer
detail
required
string
instance

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.

string
violations

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.

Array<object>
object
property
required
string
message
required
string

Example generated

{
"type": "https://example.com",
"title": "example",
"status": 1,
"detail": "example",
"instance": "example",
"violations": [
{
"property": "example",
"message": "example"
}
]
}

Error

Media typeapplication/problem+json

An RFC 9457 problem document, always sent as application/problem+json.

object
type

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.

string format: uri
title
required
string
status
required
integer
detail
required
string
instance

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.

string
violations

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.

Array<object>
object
property
required
string
message
required
string

Example generated

{
"type": "https://example.com",
"title": "example",
"status": 1,
"detail": "example",
"instance": "example",
"violations": [
{
"property": "example",
"message": "example"
}
]
}