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-workspace-idstringrequired

Workspace identifier for the API.

Path Parameters

batchIdstringrequired

The 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

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

  1. Queued Calls: Calls waiting in the queue are removed and will not be placed
  2. Active Calls: Calls already in progress continue to completion, but no new calls start
  3. Completed Calls: Already completed calls are not affected
  4. History: The stored batch record is marked cancelled

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: the batch doesn't exist, belongs to another workspace, or its 7-day tracking window has passed. Batch progress not found when 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
  • details reflects the counters read just before cancelling

Last updated on