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 OKstatus 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
- Batch already in a terminal state: returns
200idempotently, no operation performed. - CAS transitions the status
validating|queued|processing → cancelling. - Drain the Redis queue and bulk-mark pending tasks as
cancelled. - Call
CancelSessionon each running task. - If no running tasks remain, trigger
finalizeimmediately; otherwise wait for the lastCompleteTaskto drivefinalize.
Error codes
Notes
- Cancellation is asynchronous. A
cancellingresponse 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.