List a project's cases of an agent's test set
const url = 'https://example.com/v1/agents/example/test-set/cases?projectId=2489E9AD-2EE2-8E00-8EC9-32D5F69181C0&include=retired&limit=25';const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request GET \ --url 'https://example.com/v1/agents/example/test-set/cases?projectId=2489E9AD-2EE2-8E00-8EC9-32D5F69181C0&include=retired&limit=25' \ --header 'Authorization: Bearer <token>'Cursor-paginated, newest added first. A retired case comes back only with include=retired. Needs read on the project.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”AgentId — dotted namespace (acme.drafting).
Query Parameters
Section titled “Query Parameters”The project whose cases to read: the agent’s set, narrowed to that project’s cases.
retired: retired cases too. Left out, active ones only.
Comma-separated correction and hand. Left out, both.
1..100. Default 25.
Where the previous page ended: its nextCursor, as it came. A runtime that seals cursors takes one only for the same list, filters and caller, within a day; otherwise 400 bad-input, and the list starts again without it. Absent → first page.
Responses
Section titled “Responses”Page of cases.
object
object
A correction’s case has the correction’s id; a hand case’s starts case-.
correction: a correction of the run. hand: added by hand.
The run’s project.
The agent version the run ran.
One part for each part its correction gave a verdict on; at least one.
object
right: it calls the same tools the corrected run called, by name, in any order (args aren’t compared). wrong: it calls every shouldCall tool (with its args where given) and none of mustNotCall, checked exactly, without a model.
object
object
The partial set of top-level argument fields to compare, by value. Fields left out are not compared; an empty object asks only that the tool was called. At most 4000 characters in canonical JSON.
object
A judging model checks it. right: it says what the corrected run’s answer said. wrong: it does what shouldSay or why asks.
object
A ranked answer’s items, scored as weightedPrecisionAtK.
object
The caller’s stable id for the item, such as a matched case’s id, never the item’s own text.
Where the item is in the run’s output, as a JSON Pointer (RFC 6901), e.g. /matches/2.
The item’s position in the ranked list (0 = first).
Who made the correction, or added the case.
object
A user id, or for a service token its token or session id.
When the case last changed: its addedAt until it’s retired.
Present on a retired case: it stays listed, and no test run checks it.
object
Who asserted a correction: the authenticated caller, never a typed name.
object
A user id, or for a service token its token or session id.
Present (true) on an expert’s case: a correction’s case when the correction was recorded while its group was restricted, and every hand case, since adding one needs publish on the agent, or write on its project when more than one project serves the agent. A test run weighted experts-only grades only these. Absent from older servers.
Opaque cursor. Treat as opaque on the client.
Example
{ "data": [ { "kind": "correction", "expect": { "decisions": { "verdict": "right" }, "answer": { "verdict": "right" }, "items": [ { "verdict": "right" } ] }, "addedBy": { "kind": "user" }, "retired": { "by": { "kind": "user" } }, "expert": true } ]}projectId is missing or not a project id (a UUID), or include or kind names something else.
object
object
Stable machine-readable discriminant. Values match domain error codes (see docs/API-ROUTE-CONVENTIONS.md §4.3).
Optional, kind-specific.
object
Server-assigned request id; also echoed via X-Request-Id header.
Examplegenerated
{ "error": { "code": "example", "message": "example", "details": {}, "requestId": "example" }}Missing / malformed / expired / revoked bearer token.
object
object
Stable machine-readable discriminant. Values match domain error codes (see docs/API-ROUTE-CONVENTIONS.md §4.3).
Optional, kind-specific.
object
Server-assigned request id; also echoed via X-Request-Id header.
Examplegenerated
{ "error": { "code": "example", "message": "example", "details": {}, "requestId": "example" }}agent-not-found.
object
object
Stable machine-readable discriminant. Values match domain error codes (see docs/API-ROUTE-CONVENTIONS.md §4.3).
Optional, kind-specific.
object
Server-assigned request id; also echoed via X-Request-Id header.
Examplegenerated
{ "error": { "code": "example", "message": "example", "details": {}, "requestId": "example" }}The database was too busy to answer in time (database-busy); Retry-After (whole seconds) says when to try again.
object
object
Stable machine-readable discriminant. Values match domain error codes (see docs/API-ROUTE-CONVENTIONS.md §4.3).
Optional, kind-specific.
object
Server-assigned request id; also echoed via X-Request-Id header.
Examplegenerated
{ "error": { "code": "example", "message": "example", "details": {}, "requestId": "example" }}See also
POST /v1/agents/{agentId}/test-set/cases: Add a case to an agent's test setGET /v1/agents/{agentId}: Fetch the highest version of an agentGET /v1/agents/{agentId}/projects: List the projects an agent runs in, and what runs in eachGET /v1/agents/{agentId}/versions: List versions of an agent- An agent's test set
- Error code
agent-not-found - Error code
database-busy - Every error code