POST /v1/runs/{runId}/cancel

Cancel a run this client started; 404 covers cross-tenant ids and another client's runs.

Stops a run by its id. Only the API client whose key started the run may cancel it — the client, not the key, so a rotated key cancels what its predecessor started. Every other caller gets 404. A running run is told to stop and ends itself as cancelled with what it had produced committed, so status in the answer is the status BEFORE the stop took effect: poll GET /v1/runs/{runId} for cancelled. A run still queued by /runs/submit is cancelled on the spot. A run started by /runs/submit reads pending until it ends, also while it is being worked on, so cancelled: true with status: pending is such a run told to stop. cancelled: false means this call stopped nothing — the run had already ended, or is paused on an approval (decide it instead) or on its tasks, or is a task another run dispatched — and is not an error. If status is not a final one the run is still going: a cancel sent while Amy is being updated can miss a live run, so ask again. Every call is audit-logged.

Request

Path & query

NameInTypeRequired
runIdpathuuidrequired

Example

shell
curl -X POST https://api.askamy.co.za/v1/runs/{runId}/cancel \
  -H "X-Api-Key: $AMY_API_KEY"

Responses

StatusDescriptionBody
200OKCancelRunResponse
401UnauthorizedProblemDetails
404Not FoundProblemDetails

Schemas

CancelRunResponse

FieldTypeRequired
cancelledboolean required
statusstring required

ProblemDetails

FieldTypeRequired
typestring | nulloptional
titlestring | nulloptional
statusinteger | nulloptional
detailstring | nulloptional
instancestring | nulloptional