Trillet AI logo

Cancel Batch Operation

Cancel a batch call operation and stop any remaining calls from being processed

DELETEhttps://api.trillet.ai/v1/api/batch-calls/{batchId}

Headers

x-api-keystringrequired

API key used for authenticating requests to the API.

x-workspace-idstringrequired

Workspace identifier for the API.

Path Parameters

batchIdstringrequired

The unique identifier of the batch call operation to cancel

Response

batchIdstring

The ID of the cancelled batch

statusstring

New status of the batch (will be "cancelled")

messagestring

Confirmation message about the cancellation

detailsobject

Summary 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:

  1. Queued Calls: All calls waiting in the queue are immediately cancelled and will not be processed
  2. Active Calls: Currently active calls will continue to completion but no new calls will start
  3. Completed Calls: Already completed calls are not affected
  4. Batch Status: The batch status is updated to "cancelled"
  5. History: The cancellation is recorded in the batch history

Error Responses

errorstring

Error message describing what went wrong

messagestring

Additional context about the error

idstring

The batch ID that was not found (for 404 errors)

Common Error Codes:

  • 404 - Batch not found with the specified ID
  • 500 - 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