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

Query Parameters

pagenumberdefault: 1

Page number for pagination (1-based)

limitnumberdefault: 20

Number of results per page (maximum 100)

statusstringdefault: all

Filter calls by status

  • all - Return all calls regardless of status
  • waiting - Only calls waiting in queue
  • active - Only calls currently in progress
  • completed - Only successfully completed calls
  • failed - Only failed calls

Response

callsarray

Array of call objects in the batch

paginationobject

Pagination information

summaryobject

Summary statistics for the batch

Example Usage

# Get first page of all calls
curl -X GET "https://api.trillet.ai/v1/api/batch-calls/batch_7891011121314/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/batch_7891011121314/calls?status=failed&page=2&limit=50" \
  -H "x-api-key: YOUR_API_KEY" \
  -H "x-workspace-id: YOUR_WORKSPACE_ID"

Example Response

{
  "calls": [
    {
      "jobId": "call_123",
      "status": "completed",
      "phone_number": "+1234567890",
      "startTime": 1703097600000,
      "endTime": 1703097642000,
      "duration": 42,
      "metadata": {
        "first_name": "John",
        "last_name": "Doe",
        "email": "john.doe@example.com"
      }
    },
    {
      "jobId": "call_124",
      "status": "failed",
      "phone_number": "+1987654321",
      "startTime": 1703097600000,
      "endTime": 1703097615000,
      "error": "Number busy",
      "metadata": {
        "first_name": "Jane",
        "last_name": "Smith",
        "email": "jane.smith@example.com"
      }
    }
  ],
  "pagination": {
    "page": 1,
    "limit": 20,
    "total": 150,
    "totalPages": 8,
    "hasNext": true,
    "hasPrev": false
  },
  "summary": {
    "total": 150,
    "waiting": 45,
    "active": 5,
    "completed": 95,
    "failed": 5
  }
}

Error Responses

errorstring

Error message describing what went wrong

Common Error Codes:

  • 500 - Server error retrieving batch calls

Use Cases

  • Build dashboards showing all calls in a batch
  • Filter and review failed calls for troubleshooting
  • Export call results for reporting and analysis
  • Monitor active calls in real-time