CDRs

Search CDRs

API Request Description

This endpoint allows you to retrieve call detail records (CDRs) by submitting a POST request to the specified URL. The request should be in x-www-form-urlencoded format, and it supports various parameters for filtering and sorting the CDRs.

  • format: The format of the response.

  • page: The number of the page.

  • cdrs_per_page: The amount of CDRs per page.

  • sort_by: Sort by field.

  • sort_direction: Sort in ascending or descending order.

  • from: From what date to search (Default value: yesterday at 00:00:00).

  • till: Till what date to search (Default value: now).

  • queue: Search by queue IDs (e.g., 10,20,30...).

  • agent: Search by agent IDs (e.g., 10,20,30...).

  • bridged_agent: Search by bridged agent IDs (e.g., 10,20,30...).

  • country: Search by country's ISO2 (e.g., IL,UA,US...).

  • direction: Search by call direction.

  • call_type: Search by call type.

  • destination: Search by destination number.

  • source: Search by source number.

  • extension: Search by call type.

  • did: Search by DID.

  • caller_id: Search by caller id number.

  • hangup_cause: Search by hangup cause (e.g., ANSWERED,BUSY,NO_ANSWER ...).

  • bill_duration_from: Filter the bill duration from (in seconds).

  • successful: Show only successful calls.

  • completed: Show only completed calls.

  • transferred: Show only transferred calls.

  • shift: Search by shift ID.

  • by_shift_hour: Search by shift ID.

  • uniqueid: Search by unique id.

  • id: Search by id (e.g., 5698 | 5000-6000).

  • {custom_field}: Filter by custom fields (Key -> field name, Value -> field value).

API Response (JSON Schema)

{
    "type": "object",
    "properties": {
        "cdrs": {
            "type": "array",
            "items": {
                "type": "object",
                "properties": {
                    "id": {"type": "string"},
                    "call_start": {"type": "string"},
                    "call_end": {"type": "string"},
                    "duration": {"type": "string"},
                    "bill_duration": {"type": "string"},
                    "type": {"type": "string"},
                    "destination": {"type": "string"},
                    "caller_id": {"type": "string"},
                    "country_name": {"type": "string"},
                    "agent_name": {"type": "string"},
                    "agent_pbxExtension": {"type": "string"},
                    "bridged_agent_name": {"type": "string"},
                    "bridged_agent_pbxExtension": {"type": "string"},
                    "hangup_cause": {"type": "string"},
                    "waiting_time": {"type": "string"},
                    "recording_link": {"type": "string"},
                    "queue_alias": {"type": "string"},
                    "queue_name": {"type": "string"},
                    "desks": {"type": "string"},
                    "custom_fields": {"type": "string"},
                    "cost": {"type": "string"}
                }
            }
        }
    }
}

post/api/cdrs

Request

  • Base URL
    https://your-instance.stats.pbx.commpeak.com
  • URL
    https://your-instance.stats.pbx.commpeak.com/api/cdrs
  • Auth
    API key in header X-API-KEY

Request body application/x-www-form-urlencoded

agentstring
bill_duration_fromstring
bridged_agentstring
by_shift_hourstring
call_typestring
caller_idstring
cdrs_per_pagestring
completedstring
countrystring
destinationstring
didstring
directionstring
extensionstring
formatstring
fromstring
hangup_causestring
idstring
pagestring
queuestring
shiftstring
sort_bystring
sort_directionstring
sourcestring
successfulstring
tillstring
transferredstring
uniqueidstring
{custom_field}string

Example request

{
  "agent": "<string>",
  "bill_duration_from": "<number>",
  "bridged_agent": "<string>",
  "by_shift_hour": "false",
  "call_type": "regular",
  "caller_id": "<number>",
  "cdrs_per_page": "25",
  "completed": "true",
  "country": "<string>",
  "destination": "<string>",
  "did": "<number>",
  "direction": "outgoing",
  "extension": "<number>",
  "format": "json",
  "from": "<dateTime>",
  "hangup_cause": "<string>",
  "id": "<string>",
  "page": "1",
  "queue": "<string>",
  "shift": "<number>",
  "sort_by": "call_start",
  "sort_direction": "asc",
  "source": "<number>",
  "successful": "true",
  "till": "<dateTime>",
  "transferred": "false",
  "uniqueid": "<string>",
  "{custom_field}": "<string>"
}

Response

successful operation

Example response

{
  "cdrs": [
    {
      "agent_name": "<string>",
      "agent_pbxExtension": "<string>",
      "bill_duration": "<number>",
      "bridged_agent_name": "<string>",
      "bridged_agent_pbxExtension": "<string>",
      "call_end": "<dateTime>",
      "call_start": "<dateTime>",
      "caller_id": "<string>",
      "cost": "<string>",
      "country_name": "<string>",
      "custom_fields": "<string>",
      "desks": "<string>",
      "destination": "<string>",
      "duration": "<number>",
      "hangup_cause": "<string>",
      "id": "<integer>",
      "queue_alias": "<string>",
      "queue_name": "<string>",
      "recording_link": "<string>",
      "type": "<string>",
      "waiting_time": "<string>"
    },
    {
      "agent_name": "<string>",
      "agent_pbxExtension": "<string>",
      "bill_duration": "<number>",
      "bridged_agent_name": "<string>",
      "bridged_agent_pbxExtension": "<string>",
      "call_end": "<dateTime>",
      "call_start": "<dateTime>",
      "caller_id": "<string>",
      "cost": "<string>",
      "country_name": "<string>",
      "custom_fields": "<string>",
      "desks": "<string>",
      "destination": "<string>",
      "duration": "<number>",
      "hangup_cause": "<string>",
      "id": "<integer>",
      "queue_alias": "<string>",
      "queue_name": "<string>",
      "recording_link": "<string>",
      "type": "<string>",
      "waiting_time": "<string>"
    }
  ]
}

Changes

No recorded changes to this operation across all 1 revision of this API.