Resources
Cancel a batch
Stop every unfinished row of a batch. Cancelled rows are not charged.
POST /api/batches/{batchId}/cancelRequires renders:create.
| Name | Type | Required | Description |
|---|---|---|---|
workspace | string | Yes | Workspace slug or id. |
curl -X POST "https://app.kalpana.one/api/batches/$BATCH_ID/cancel" \
--header "x-api-key: $KALPANA_API_KEY" \
--header "Content-Type: application/json" \
--data '{ "workspace": "my-workspace" }'Response
{ "cancelled": 12, "stoppedMessages": 3 }Every pending or processing row becomes cancelled at once. That status is final and never charged. cancelled counts those rows. stoppedMessages counts the queued messages deleted before delivery; one message can carry several rows. A render already under way finishes, but its result is ignored. Rows that already rendered, failed or were cancelled are not changed, so a batch with nothing unfinished returns 0 for both.
When at least one row is cancelled, the batch run has finished and the batch.completed event carries the cancelled count.
Errors
| Status | Cause |
|---|---|
400 | batchId is not a valid id. |
403 | Your role or key lacks renders:create. |
404 | The batch is not in this workspace. |
Was this page helpful?
Updated 4 Nov 2026