Skip to main content
POST /api/v1/forward/batches/{batch_id}/cancel Once cancellation is initiated, Forward drains the queue, marks pending tasks as cancelled, and calls CancelSession on every running task.

Headers

Path parameters

Example request

Example response

HTTP 200 OK
The response is a snapshot at cancellation time: if running tasks remain, status is the intermediate cancelling; otherwise it is cancelled directly. Cancelling a batch already in a terminal state returns the current object idempotently.

Response fields

Cancellation flow

  1. Batch already in a terminal state: returns 200 idempotently, no operation performed.
  2. CAS transitions the status validating|queued|processing → cancelling.
  3. Drain the Redis queue and bulk-mark pending tasks as cancelled.
  4. Call CancelSession on each running task.
  5. If no running tasks remain, trigger finalize immediately; otherwise wait for the last CompleteTask to drive finalize.

Error codes

Notes

  • Cancellation is asynchronous. A cancelling response means the request was accepted; poll the batch detail to confirm the terminal state.
  • Cancelling a batch already in a terminal state is idempotent and returns 200.

Get a batch

Get output file