Skip to main content
GET
/
api
/
v2
/
platform
/
call-logs
Get Call Logs
curl --request GET \
  --url http://localhost:3001/api/v2/platform/call-logs/ \
  --header 'Authorization: <api-key>' \
  --header 'Org-Handle: <org-handle>'
{
  "count": 150,
  "status_code": 200,
  "message": "Call logs fetched successfully",
  "data": [
    {
      "source_number": "+911234567890",
      "destination_number": "+919876543210",
      "call_type": "outbound",
      "call_status": "completed",
      "creation_time": "2026-02-07T05:57:00Z",
      "start_time": "2026-02-07T05:57:45Z",
      "end_time": "2026-02-07T06:01:12Z",
      "call_duration": 207,
      "end_reason": "caller_hangup"
    }
  ]
}
{
  "count": 150,
  "status_code": 200,
  "message": "Call logs fetched successfully",
  "data": [
    {
      "source_number": "+911234567890",
      "destination_number": "+919876543210",
      "call_type": "outbound",
      "call_status": "completed",
      "creation_time": "2026-02-07T05:57:00Z",
      "start_time": "2026-02-07T05:57:45Z",
      "end_time": "2026-02-07T06:01:12Z",
      "call_duration": 207,
      "end_reason": "caller_hangup"
    }
  ]
}

Get Call Logs

Retrieve call history logs for your organization with support for filtering by date range, call type, call status, and pagination for efficient data retrieval.
Prerequisites: Make sure you have your API Token and Org-Handle ready. See Authentication for details.

Headers

NameTypeRequiredDescription
Org-HandlestringYesOrganization domain handle
AuthorizationstringYesAPI 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

NameTypeRequiredDescription
pageintegerNoPage number for pagination (default = 1)
page_sizeintegerNoNumber of records per page (default = 20)
start_datestringNoFilter calls from this date (ISO 8601 format)
end_datestringNoFilter calls until this date (ISO 8601 format)
call_typestringNoFilter by call direction: inbound or outbound
call_statusstringNoFilter by status: completed, missed, or failed

Response Fields

FieldTypeDescription
countintegerTotal number of call logs
status_codeintegerHTTP status code
messagestringResponse message
dataarrayArray of call log objects

Call Log Object Fields

FieldTypeDescription
source_numberstringThe number that initiated the call
destination_numberstringThe number that received the call
call_typestringDirection of call: outbound, inbound
call_statusstringOutcome: completed, missed, failed
creation_timestringTimestamp when the call was created/scheduled
start_timestringTimestamp when the call was answered (null if missed)
end_timestringTimestamp when the call ended (null if missed)
call_durationintegerDuration of the call in seconds
end_reasonstringReason the call ended (e.g., caller_hangup, no_answer)

Common Error Codes

Status CodeDescription
200Success - Call logs fetched successfully
400Bad Request - Invalid filter parameters
401Unauthorized - Invalid or missing API token
403Forbidden - Invalid organization handle
404Not Found - Organization not found
500Internal Server Error - Server-side error

Code Examples

const axios = require('axios');

const headers = {
  'Authorization': 'Token your-api-token',
  'Org-Handle': 'your-org-handle'
};

// Get call logs with filters
const getCallLogs = async (filters = {}) => {
  const params = {
    page: 1,
    page_size: 20,
    ...filters
  };
  const response = await axios.get(
    'https://unpod.dev/api/v2/platform/call-logs/',
    { headers, params }
  );
  console.log(`Total call logs: ${response.data.count}`);
  response.data.data.forEach(log => {
    console.log(`${log.call_type} call to ${log.destination_number}: ${log.call_status} (${log.call_duration}s)`);
  });
  return response.data.data;
};

// Example: Get outbound completed calls from a date range
getCallLogs({
  call_type: 'outbound',
  call_status: 'completed',
  start_date: '2026-02-01',
  end_date: '2026-02-07'
});

Best Practices

  1. Date Filtering: Always use start_date and end_date to limit results to relevant time windows
  2. Pagination: Use page and page_size for large datasets to avoid timeouts
  3. Call Status Filtering: Filter by call_status to focus on specific outcomes (completed, missed, failed)
  4. Org-Handle: Ensure the correct organization handle is included — it determines which org’s logs are returned
  5. Duration Analysis: Use call_duration to calculate average call durations and identify performance trends
  6. Security: Keep API tokens secure and rotate them regularly

Authorizations

Authorization
string
header
required

Format: Token

Headers

Org-Handle
string
required

Organization domain handle

Example:

"unpod"

Query Parameters

page
integer
Example:

1

page_size
integer
Example:

20

call_type
enum<string>
Available options:
inbound,
outbound
Example:

"outbound"

call_status
enum<string>
Available options:
completed,
failed,
no-answer
Example:

"completed"

Response

List of call logs