Skip to main content
POST
Cancel task run
Submit a cancellation request for a run that is still PENDING or RUNNING. You can optionally include a reason to help with audit trails. The response returns the current run payload; subsequent polling on GET /public/v1/task-runs/{runId} reflects the final status.

Request

Path parameters

  • runId — UUID of the run to cancel.

Body fields

  • reason (string, optional) — Free-form text recorded on the run for auditing.

Example

Responses

  • 202 Accepted — Cancellation was accepted. The response includes the run payload reflecting the latest state. Runs that already reached a terminal status are returned unchanged.
  • 400 Bad Request — Invalid run ID.
  • 401 Unauthorized — Missing or malformed API key.
  • 404 Not Found — The run does not belong to the authenticated organization.

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Path Parameters

runId
string<uuid>
required

UUID of the run to cancel.

Body

application/json
reason
string

Optional cancellation reason recorded for auditing.

Maximum string length: 1024

Response

Cancellation accepted.

run
object
required