GET
/
v1
/
api
/
batch-calls
/
{batchId}
curl --request GET \
  --url https://api.trillet.ai/v1/api/batch-calls/{batchId} \
  --header 'x-api-key: <api-key>' \
  --header 'x-workspace-id: <x-workspace-id>'
{
  "id": "<string>",
  "status": "<string>",
  "isComplete": true,
  "totalCalls": 123,
  "progress": {
    "waiting": 123,
    "active": 123,
    "completed": 123,
    "failed": 123,
    "total": 123,
    "startTime": 123,
    "lastCompletedTime": 123,
    "completedTime": 123,
    "averageCallDuration": 123,
    "recent_calls": [
      {}
    ]
  },
  "timestamp": 123,
  "error": "<string>",
  "message": "<string>"
}

Headers

x-api-key
string
required

API key used for authenticating requests to the API.

x-workspace-id
string
required

Workspace identifier for the API.

Path Parameters

batchId
string
required

The unique identifier of the batch call operation

Response

id
string

The batch ID

status
string

Current status of the batch operation

  • queued - Batch is waiting to be processed
  • processing - Calls are currently being made
  • completed - All calls have been completed
  • cancelled - Batch was cancelled
  • failed - Batch failed due to an error
isComplete
boolean

Whether the batch operation has finished

totalCalls
number

Total number of calls in the batch

progress
object

Detailed progress information

timestamp
number

Timestamp of when this status was retrieved

Example Usage

curl -X GET "https://api.trillet.ai/v1/api/batch-calls/batch_7891011121314" \
  -H "x-api-key: YOUR_API_KEY" \
  -H "x-workspace-id: YOUR_WORKSPACE_ID"

Example Response

{
  "id": "batch_7891011121314",
  "status": "processing",
  "isComplete": false,
  "totalCalls": 150,
  "progress": {
    "waiting": 45,
    "active": 5,
    "completed": 95,
    "failed": 5,
    "total": 150,
    "startTime": 1703097600000,
    "lastCompletedTime": 1703101200000,
    "completedTime": null,
    "averageCallDuration": 45.2,
    "recent_calls": [
      {
        "jobId": "call_123",
        "status": "completed",
        "phone_number": "+1234567890",
        "completedAt": 1703101200000
      }
    ]
  },
  "timestamp": 1703101300000
}

Error Responses

error
string

Error message describing what went wrong

message
string

Additional context about the error

Common Error Codes:

  • 404 - Batch not found with the specified ID
  • 500 - Server error retrieving batch information

Status Monitoring

You can poll this endpoint to monitor the progress of your batch calls. The response includes detailed metrics about call completion rates, timing information, and recent call results.