Cancel Batch Operation
Cancel a batch call operation and stop any remaining calls from being processed
DELETE
Headers
x-api-keystringrequiredAPI key used for authenticating requests to the API.
x-workspace-idstringrequiredWorkspace identifier for the API.
Path Parameters
batchIdstringrequiredThe unique identifier of the batch call operation to cancel
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/batch-calls/batch_7891011121314" \
-H "x-api-key: YOUR_API_KEY" \
-H "x-workspace-id: YOUR_WORKSPACE_ID"
Example Response
{
"batchId": "batch_7891011121314",
"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: All calls waiting in the queue are immediately cancelled and will not be processed
- Active Calls: Currently active calls will continue to completion but no new calls will start
- Completed Calls: Already completed calls are not affected
- Batch Status: The batch status is updated to "cancelled"
- History: The cancellation is recorded in the batch history
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 with the specified ID500- Server error during cancellation process
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
- You will still be charged for completed calls
- Active calls at the time of cancellation will finish normally
- The batch cannot be restarted after cancellation
