Skip to content

Check one of an agent's duties now

POST
/api/v1/agents/{name}/duties/{duty}/check
curl --request POST \
--url http://localhost:11044/api/v1/agents/example/duties/example/check \
--header 'X-Embabel-Api-Key: <X-Embabel-Api-Key>'

Reads the duty’s violations view, records upheld, lapsed or unknown, and runs its repair on each violation. Off duty, it runs observing.

name
required
string

The agent’s name

duty
required
string

The duty’s name

What the check found

Media typeapplication/json

What one check of an agent’s duty found: whether the condition it keeps true holds, since when it has not, and what its repair did. Answered by POST /agents/{name}/duties/{duty}/check

object
agent
required

Name of the agent that holds the duty

string
agentVersion

The agent’s signed version number that governed the check; null when no signed version governs it

integer format: int32
checkedAt
required

ISO-8601 instant the check ran

string format: date-time
duty
required

Name of the duty checked, as the agent declares it

string
lapsedSince

ISO-8601 instant this lapse began: the first check that found violations, carried across later lapsed, neglected and unknown checks. Null when upheld, or unknown with no lapse before it

string format: date-time
notes
required

Source warnings that left the rows sound, such as a cost note from a realm’s producer

Array<string>
onDemand
required

True when somebody asked for this check, as this endpoint does; false for a check on the duty’s own schedule

boolean
onFallbacks
required

True when a model the duty’s view relies on failed and the result stands on a second read with the agent’s fallback models

boolean
reason

Why the state is unknown: the view errored or was not found, a source warned its rows may be wrong or short, or its models failed with no fallback that worked. Null for every other state

string
repairFailures
required

How many of those repair runs failed or threw

integer format: int32
repaired
required

Violating rows the repair routine was run on, at most 25 per check; 0 when the duty declares no repair or its routine does not exist

integer format: int32
state
required

upheld (the duty’s view returned no rows), lapsed (it returned violations), neglected (lapsed, and during this lapse a request its repair raised was rejected and none approved), or unknown (the view could not be read cleanly; see reason)

string
Allowed values: upheld lapsed neglected unknown
violations
required

Rows the duty’s view returned, each one a violation; 0 when upheld or unknown

integer format: int32
wouldHaveCalled
required

Tools the repair tried to call and was refused, each named once: what it would have changed had the check not run observing

Array<string>

Example

{
"state": "upheld"
}

No authenticated principal

One of:

A refusal with a machine-readable code and a plain-language message. ApiErrorAdvice answers it for a failed validation, a missing resource or a conflicting state, and some controllers answer it directly

object
code
required

Machine-readable key to branch on, such as validation_failed, unknown_field, not_found or conflict. Open: a surface may answer codes of its own

string
detail

Extra context where there is some, such as the fields a body may carry; null otherwise

string
message
required

A plain-language explanation, written to be shown. Never carries an exception message

string

Example generated

{
"code": "example",
"detail": "example",
"message": "example"
}

No signed agent of that name holds such a duty