Check one of an agent's duties now
const url = 'http://localhost:11044/api/v1/agents/example/duties/example/check';const options = {method: 'POST', headers: {'X-Embabel-Api-Key': '<X-Embabel-Api-Key>'}};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}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.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”The agent’s name
The duty’s name
Responses
Section titled “Responses”What the check found
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
Name of the agent that holds the duty
The agent’s signed version number that governed the check; null when no signed version governs it
ISO-8601 instant the check ran
Name of the duty checked, as the agent declares it
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
Source warnings that left the rows sound, such as a cost note from a realm’s producer
True when somebody asked for this check, as this endpoint does; false for a check on the duty’s own schedule
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
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
How many of those repair runs failed or threw
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
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)
Rows the duty’s view returned, each one a violation; 0 when upheld or unknown
Tools the repair tried to call and was refused, each named once: what it would have changed had the check not run observing
Example
{ "state": "upheld"}No authenticated principal
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
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
Extra context where there is some, such as the fields a body may carry; null otherwise
A plain-language explanation, written to be shown. Never carries an exception message
The body the servlet error dispatch answers for a status raised by an exception rather than written by the endpoint. Every failure except 404, which answers the not-found HTML page
object
The status’s standard reason phrase, such as Bad Request or Forbidden
The request path that failed
The HTTP status code, repeated from the status line
Example generated
{ "code": "example", "detail": "example", "message": "example"}No signed agent of that name holds such a duty

