VocalDocscontracts 1.65.0

Cancel a Process instance

POST /v1/processes/{process_id}/cancel

PropertyValue
Operationcancel_process
GroupProcesses
Scopeprocesses:write
Route classcontrol
IdempotencyIdempotency-Key accepted: a retry with the same key replays the first answer
AuditAudited processes.process.cancel (mutation)
Released in1.62.0
Phase 0 hostServed (the hosted api pins 1.65.0)

Moves the instance to cancelling and writes its cancel command, and answers 202 with it and the completed effects a cancel cannot undo (1.62.0; section 9.7): the runner stops at the step's next safe point, the instance's open human tasks are cancelled, and the instance ends cancelled. An instance already cancelling is answered as it stands; one that ended is process_not_active.

Request

Set VOCAL_API to the base URL of your API and VOCAL_API_KEY to an API key with the processes:write scope (Authentication and keys). Replace each placeholder, such as agt_... or <name>, with your own value.

curl -X POST "$VOCAL_API/v1/processes/prc_.../cancel" \
  -H "Authorization: Bearer $VOCAL_API_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{}'

Parameters

NameInTypeRequiredDescription
process_idpathProcessInstanceIdyesThe id of a Process instance: prc_ and the row's UUIDv7 in 26 Crockford base32 characters. Opaque and safe to log.
idempotency-keyheaderstringnoA client-chosen key, kept 24 hours per Organization, environment and route. A replay returns the stored response.

Request body

Content type application/json, required: ProcessCancelRequest.

FieldTypeRequiredDescription
reasonstringnoA snake_case code the Audit event records; never free text.

Responses

StatusContent typeShapeError codes
202application/jsonProcessCancellation
400application/jsonErrorEnvelopeinvalid_request
401application/jsonErrorEnvelopeunauthenticated
403application/jsonErrorEnvelopeforbidden
404application/jsonErrorEnvelopenot_found
409application/jsonErrorEnvelopeprocess_not_active, idempotency_in_progress, idempotency_key_reused
429application/jsonErrorEnveloperate_limited
500application/jsonErrorEnvelopeinternal_error

Fields of the 202 answer

The shape is ProcessCancellation.

FieldTypeRequiredDescription
instanceProcessInstanceyes
not_compensablearray of NotCompensableEffectyes
object"process_cancellation"yes