Trillet AI logo

List Batch Calls

Get a paginated list of all calls within a batch operation with optional status filtering

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

Headers

x-workspace-idstringrequired

Workspace identifier for the API.

Path Parameters

batchIdstringrequired

The 10-character batch ID.

Query Parameters

pagenumberdefault: 1

Page number for pagination (1-based)

limitnumberdefault: 20

Number of results per page. No maximum is enforced.

statusstringdefault: all

Filter calls by status. Any other value matches the job's status exactly.

  • all - Return all calls regardless of status
  • waiting - Calls waiting in the queue
  • active - Calls being placed
  • completed - Dial jobs that finished
  • failed - Dial jobs that failed
  • cancelled - Jobs cancelled individually

While the batch is tracked (7 days), jobs are read from the live queue. After that, the list is rebuilt from the stored batch record: id may then be the phone number when no job ID was stored, call.duration is filled in where known, and statuses come from the stored per-number results.

Response

jobsarray

Jobs in the batch.

paginationobject

Pagination information

Example Usage

# Get first page of all calls
curl -X GET "https://api.trillet.ai/v1/api/batch-calls/k3j9x0a1bq/calls" \
  -H "x-api-key: YOUR_API_KEY" \
  -H "x-workspace-id: YOUR_WORKSPACE_ID"

# Get failed calls only, page 2
curl -X GET "https://api.trillet.ai/v1/api/batch-calls/k3j9x0a1bq/calls?status=failed&page=2&limit=50" \
  -H "x-api-key: YOUR_API_KEY" \
  -H "x-workspace-id: YOUR_WORKSPACE_ID"

Example Response

{
  "jobs": [
    {
      "id": "4821",
      "status": "completed",
      "phoneNumber": "+14155550123",
      "contact": "John Smith",
      "business": "Acme Dental",
      "createdAt": 1793284800000,
      "data": {
        "phoneNumber": "+14155550123",
        "record": {
          "phone_number": "+14155550123",
          "business": "Acme Dental",
          "name": "John Smith"
        },
        "batchId": "k3j9x0a1bq"
      },
      "call": null
    }
  ],
  "pagination": {
    "page": 1,
    "limit": 20,
    "total": 150,
    "totalPages": 8
  }
}

Error Responses

errorstring

Error message describing what went wrong

Common Error Codes:

  • 404 - Batch not found: the batch doesn't exist or belongs to another workspace
  • 500 - Server error retrieving batch calls

Last updated on