Skip to main content
POST
Cancel a pending tool test
Requires tools:update for the exact workspace/tool/test. Returns the saved test state. Repeated cancellation is safe and does not create a retry.
Cancellation prevents new dispatch but cannot undo an effect already started. Immutable preparation, attempts, receipts and terminal history are retained. Cancelling takes no body and no Idempotency-Key, so beyond the account-wide 401 (missing, invalid or expired key, or a key without tools:update) it has only four failures: 403 WORKFLOW_TOOL_TEST_DENIED, 404 WORKFLOW_TOOL_TEST_NOT_FOUND (check both ids), 404 WORKFLOW_TOOL_ARCHIVED (the tool is archived, so a test of it cannot be cancelled; a test it already ran still reads with GET /tools/{id}/tests/{test_id} — restore it to test it again) and 503 WORKFLOW_TOOL_TEST_UNAVAILABLE (retry). A test that has already finished is not a conflict — you get its saved state back, so read it with GET /tools/{id}/tests/{test_id} to see where it ended up. See Error Codes.

Authorizations

Authorization
string
header
required

Your Yappr API key (e.g. ypr_live_...). Generate one in the dashboard under Settings → API Keys. No key is 401 MISSING_KEY; a key that is not one of ours, or is revoked, is 401 INVALID_KEY; an expired one is 401 EXPIRED_KEY. A valid key without the scope an operation needs is 403 INSUFFICIENT_SCOPE on every operation, and the message names the scope. Every response, a 401 included, carries X-RateLimit-Limit, X-RateLimit-Remaining and X-RateLimit-Reset: the budget is 60 requests a minute per API key. Every 429, whatever its code, carries Retry-After (whole seconds, never zero): the per-key budget's RATE_LIMIT asks for what is left of the minute, a route's daily cap (RATE_LIMITED) for the time until that cap resets. All four headers are listed in Access-Control-Expose-Headers, so a browser can read them. A path the API does not serve (an unknown sub-path, an id left empty) is 404 ROUTE_NOT_FOUND, and a method a served path does not take is 405 METHOD_NOT_ALLOWED with an Allow header; both are answered before any scope check, and nothing is read or changed. A trailing slash is ignored where it cannot be an id left empty (POST /calls/ is POST /calls) and refused where it can (GET /calls/). A doubled slash inside a path is merged into one before the request reaches the API (GET //calls is GET /calls).

Path Parameters

id
string<uuid>
required
test_id
string<uuid>
required

Response

Idempotent saved test state after cancellation.

test_id
string<uuid>
required
run_id
string<uuid>
required

Shared journal identity only; this ID does not grant access to call history.

tool_id
string<uuid>
required
revision_id
string<uuid>
required
phase
enum<string>
required
Available options:
before,
during,
after
channel
enum<string>
required
Available options:
phone,
web
policy
enum<string>
required
Available options:
mock,
allowlist
status
enum<string>
required

blocked — nothing was sent. failed — the endpoint refused it, or answered 2xx with a body the tool could not use; its delivery reads failed too. unknown — no answer came back; its delivery reads unknown too.

Available options:
accepted,
prepared,
running,
succeeded,
failed,
blocked,
pending,
unknown,
cancelled
redaction
object
required
created_at
string<date-time>
deadline_at
string<date-time>
completed_at
string<date-time> | null
error_code
string | null

Why a settled test did not succeed — the same code as outcome.error_code once its request has settled.

invocation_id
string | null
attempt_id
string<uuid> | null
receipt_id
string | null
receipt_settled_test
boolean

Distinguishes the receipt that settled this test from a later receipt.

resolution
enum<string> | null

Set only when no answer came back (a timeout or dropped connection); an endpoint that answered with an error settles failed with no resolution.

Available options:
manual_reconciliation_required,
null
replayed
boolean
delivery_id
string<uuid> | null

The delivery this real HTTP test's request made (GET /deliveries/{id}), with the same verdict; POST /deliveries/{id}/retry sends it again. Null when no request left (mock, connected-app action, refused before sending) and on tests settled before 2026-09-25.

outcome
object | null

Bounded redacted display projection, never raw vendor evidence or an execution input. A late outcome does not rewrite settled test status. An endpoint that answered with an error (4xx or 5xx) reads status and effect_status failed with error_code downstream_http_error and its http_status. One that answered 2xx with a body the tool could not use reads status failed, effect_status succeeded, and error_code output_schema_invalid, invalid_json_response or response_too_large (a body over 256 KB, or one with more values than Yappr holds that no cut can fit). blocked means nothing was sent.