Call Logs API
The Call Logs API allows you to retrieve call history logs for your organization. This endpoint provides comprehensive call details including duration, status, timestamps, and source/destination numbers.Prerequisites: Make sure you have your API Token. See Authentication for details.
Get Call Logs
Retrieve the call history logs for the organization. Supports filtering, pagination, and provides details like call duration, status, start/end times, and source/destination numbers.Headers
| Name | Type | Required | Description |
|---|---|---|---|
| Org-Handle | string | Yes | Organization domain handle |
| Authorization | string | Yes | API Key format: Token <token> |
You can get the
Org-Handle by hitting the Get All Organizations API. The domain_handle field in the response is your Org-Handle.Query Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| page | integer | No | Page number (default: 1) |
| page_size | integer | No | Number of call logs per page (default: 20) |
| start_date | string | No | Filter calls starting from this date (ISO format) |
| end_date | string | No | Filter calls until this date (ISO format) |
| call_type | string | No | Filter by call type: inbound / outbound |
| call_status | string | No | Filter by status: completed / missed / failed |
Example Request
Success Response (200)
Response Fields
| Field | Type | Description |
|---|---|---|
| count | integer | Total number of call logs |
| status_code | integer | HTTP status code |
| message | string | Response message |
| data | array | Array of call log objects |
Call Log Object Fields
| Field | Type | Description |
|---|---|---|
| id | string | Unique call identifier |
| source_number | string | Originating phone number |
| destination_number | string | Destination phone number |
| call_type | string | Type of call: inbound or outbound |
| call_status | string | Status: completed, missed, or failed |
| creation_time | string | Call creation timestamp (ISO 8601) |
| start_time | string | Call start timestamp (ISO 8601) |
| end_time | string | Call end timestamp (ISO 8601) |
| call_duration | string | Duration in HH:MM:SS format |
| end_reason | string | Reason for call ending |
| bridge | integer | Bridge identifier |
Error Response (400 — Bad Request)
Common Error Codes
| Status Code | Description |
|---|---|
| 400 | Bad Request - Invalid parameters provided |
| 401 | Unauthorized - Invalid or missing API token |
| 403 | Forbidden - Invalid organization handle |
| 404 | Not Found - Resource not found |
| 500 | Internal Server Error - Server-side error |
Code Examples
Pagination
The API uses cursor-based pagination. Use thenext and previous URLs from the response to navigate between pages:
Filtering Best Practices
- Date Ranges: Always specify both
start_dateandend_datefor better performance - Page Size: Use appropriate page sizes (20-100) to balance performance and data retrieval
- Call Type: Filter by
call_typeto separate inbound and outbound analytics - Call Status: Use
call_statusto focus on specific outcomes (completed, missed, failed) - Pagination: Implement proper pagination handling for large datasets
Best Practices
- Rate Limiting: Implement proper rate limiting and retry logic
- Error Handling: Always handle potential errors and edge cases
- Caching: Cache call logs data when appropriate to reduce API calls
- Monitoring: Monitor call patterns and trends for insights
- Security: Keep API tokens secure and rotate them regularly
- Date Filters: Use date filters to limit data retrieval and improve performance