Cancel Batch Operation
Cancel a batch call operation and stop any remaining calls from being processed
Headers
x-workspace-idstringrequiredWorkspace identifier for the API.
Path Parameters
batchIdstringrequiredThe 10-character batch ID to cancel
Cancellation needs the batch's live tracking, which is kept for 7 days. After that, cancelling a batch that already ran returns 404 Batch not found. A scheduled batch that hasn't started can be cancelled.
Response
batchIdstringThe ID of the cancelled batch
statusstringNew status of the batch (will be "cancelled")
messagestringConfirmation message about the cancellation
detailsobjectSummary of the cancellation impact
Example Usage
curl -X DELETE "https://api.trillet.ai/v1/api/batch-calls/k3j9x0a1bq" \
-H "x-api-key: YOUR_API_KEY" \
-H "x-workspace-id: YOUR_WORKSPACE_ID"
Example Response
{
"batchId": "k3j9x0a1bq",
"status": "cancelled",
"message": "Batch cancelled successfully",
"details": {
"completedCalls": 95,
"failedCalls": 5,
"cancelledCalls": 50,
"totalCalls": 150
}
}
Cancellation Behavior
When you cancel a batch operation:
- Queued Calls: Calls waiting in the queue are removed and will not be placed
- Active Calls: Calls already in progress continue to completion, but no new calls start
- Completed Calls: Already completed calls are not affected
- History: The stored batch record is marked
cancelled
Error Responses
errorstringError message describing what went wrong
messagestringAdditional context about the error
idstringThe batch ID that was not found (for 404 errors)
Common Error Codes:
404-Batch not found: the batch doesn't exist, belongs to another workspace, or its 7-day tracking window has passed.Batch progress not foundwhen its counters can't be read.500- Server error during cancellation process
To stop a single contact instead of the whole batch, use Cancel Batch Job or Cancel Batch Contact.
Use Cases
- Stop a batch operation that was started with incorrect data
- Cancel remaining calls when you've achieved your campaign goals
- Emergency stop for batch operations
- Cost control by stopping long-running batches
Important Notes
- Cancellation cannot be undone, and the batch cannot be restarted
- Calls that were already placed are billed as usual
- Active calls at the time of cancellation finish normally
detailsreflects the counters read just before cancelling
Last updated on