Test runs
Test runs

Cancel a test run

Cancel an in-flight test batch (the one run_all_tests returned). Queued runs never start; calls already in flight finish and keep their verdicts; the batch ends as 'cancelled'. Use this immediately when the operator wants a runaway or mis-configured sweep stopped, every queued run that never starts is credits saved. Fails cleanly if the batch already finished.

POST
/workspaces/{workspace}/agents/{agent}/test-runs/{batch}/cancel

Authorization

bearerAuth
AuthorizationBearer <token>

A personal access token from Settings > API tokens.

In: header

Path Parameters

workspace*string

Workspace slug (GET /me lists yours).

agent*string

Agent slug within the workspace.

batch*string

Header Parameters

Idempotency-Key?string

A key you choose, such as a UUID, that makes this POST safe to retry. Within 24 hours the same key and request answers with the first successful answer and runs nothing, the same key with a different request answers 422 idempotency_key_reused, and a key whose request is still running answers 409 idempotency_key_in_use. A failed request keeps nothing, so the same key runs it again.

Length1 <= length <= 255

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

application/problem+json

application/problem+json

application/problem+json

application/problem+json

application/problem+json

application/problem+json

application/problem+json

curl -X POST "https://example.com/workspaces/string/agents/string/test-runs/string/cancel" \  -H "Content-Type: application/json" \  -d '{}'
{
  "batchId": "string",
  "property1": null,
  "property2": null
}
{
  "type": "http://example.com",
  "title": "string",
  "status": 0,
  "detail": "string",
  "code": "string",
  "errors": [
    {
      "path": "string",
      "message": "string"
    }
  ],
  "estimate": {},
  "retryAfterSeconds": 0
}
{
  "type": "http://example.com",
  "title": "string",
  "status": 0,
  "detail": "string",
  "code": "string",
  "errors": [
    {
      "path": "string",
      "message": "string"
    }
  ],
  "estimate": {},
  "retryAfterSeconds": 0
}
{
  "type": "http://example.com",
  "title": "string",
  "status": 0,
  "detail": "string",
  "code": "string",
  "errors": [
    {
      "path": "string",
      "message": "string"
    }
  ],
  "estimate": {},
  "retryAfterSeconds": 0
}
{
  "type": "http://example.com",
  "title": "string",
  "status": 0,
  "detail": "string",
  "code": "string",
  "errors": [
    {
      "path": "string",
      "message": "string"
    }
  ],
  "estimate": {},
  "retryAfterSeconds": 0
}
{
  "type": "http://example.com",
  "title": "string",
  "status": 0,
  "detail": "string",
  "code": "string",
  "errors": [
    {
      "path": "string",
      "message": "string"
    }
  ],
  "estimate": {},
  "retryAfterSeconds": 0
}
{
  "type": "http://example.com",
  "title": "string",
  "status": 0,
  "detail": "string",
  "code": "string",
  "errors": [
    {
      "path": "string",
      "message": "string"
    }
  ],
  "estimate": {},
  "retryAfterSeconds": 0
}
{
  "type": "http://example.com",
  "title": "string",
  "status": 0,
  "detail": "string",
  "code": "string",
  "errors": [
    {
      "path": "string",
      "message": "string"
    }
  ],
  "estimate": {},
  "retryAfterSeconds": 0
}

Update a test scenario PATCH

Patch an existing test-harness scenario. Every field is optional, only the fields you send change. Resolve the scenarioId with list_scenarios first. Use this to rewrite the caller agent's instructions brief, tighten the expected-outcome judge prompt, rename it, move it between folders, retag it, switch connectionMode (bridge / phone), switch toolMode (mock / real, where real lets a run call the customer's live API), set or clear callerModel (the caller agent's LLM override), or change its attachments: metricIds (which catalogue metrics grade it), personaId (the simulated caller's persona, voice scenarios), testProfileId (caller-identity fixture data), language, workflowChecks (checks on the agent's pre-call, hang-up and post-call functions) and callSetup (how the call starts: inbound, lead callback or campaign call). workflowChecks and callSetup replace the stored value whole, so read the scenario with get_scenario first. This edits the TEST HARNESS only, it never changes the agent's own behaviour.

Get one run's transcript GET

Read what happened in one eval run, both what was SAID and what was DONE. Use this to debug a failing run beyond the judge's reasoning: get_test_results tells you WHICH rubric failed; this shows the exchange and the tool calls that failed it. Returns `turns` ([{role, content}]) and `toolCalls` ([{name, args, ok, detail}], compacted, the raw tool payload is not included), each as JSON inside an untrusted-data block once it holds anything, plus the run's `status`, `channel`, and its linked `sessionId` (pass that to get_call_metrics for the metric grid). IMPORTANT, `toolCalls` ABSENT means no tool record was captured for this run, so you cannot conclude anything about whether a tool fired; `toolCalls: []` means the record exists and the agent called nothing, which IS a finding. A phone-mode run copies its turns and tool calls from the call it was linked to; one that was never linked has neither and says so, with the sessionId to read instead when there is one. The run must belong to the current agent.