CDRs
Call data records (CDRs) for the account: list the latest, list them by type, retrieve one by ID, or attempt to reproduce the results from a CDR.
Schema
A single call data record
Type Object
| Name | Type | Description |
|---|---|---|
fees |
Array:CDRFee | |
host_number |
String | Desc. host_number |
id |
String(format:ulid) | Desc. id |
inserted_at |
String(format:date-time) | An ISO8601 formatted timestamp |
item_count |
Integer | Desc. item_count |
item_id |
String | Desc. item_id |
remote_number |
String | Desc. remote_number |
sell_rate |
String(format:decimal) | Desc. sell_rate |
status |
Enum:String | Main status of the CDR |
subtype |
Enum:String | Desc. subtype |
surcharges |
Array:CDRSurcharge | |
total |
String(format:decimal) | Desc. total |
type |
CDRType | |
updated_at |
String(format:date-time) | An ISO8601 formatted timestamp |
Desc. host_number
Depending on the CDR type, this can be an actual phone number or some other value
Desc. id
Another format for UUID, used primarily for tasks, requests and messages.
Desc. item_count
How many items does this CDR actually represent
Desc. item_id
Depending on the CDR type, this will be the id of another record
Desc. remote_number
Depending on the CDR type, this can be an actual phone number or some other value
Desc. sell_rate
The base rate (no fees or surcharges), already includes the count
Enum Values status
Allowed values
UNKNOWNOKMISSERRORREFUNDNO_ANSWERBUSYCANCELLEDCHANNEL_UNAVAILABLECONGESTIONTEMP_FAILURE
Enum Values subtype
Allowed values
NONELRNLRNEMESSAGING_CARRIER_LOOKUPCNAMTTSOUTBOUNDINBOUNDTERMINATIONSIP_IAXDID_RCFDID_VOIPCALLBACKDIDCHARGEPREPAYMENTTAXPAYMENTADJUSTMENTDID_REGISTRYDID_REGISTRY_NRCDID_REGISTRY_A_MRCDEDICATED_ESPIDDEDICATED_ESPID_NRCDEDICATED_ESPID_A_MRCDID_TIERDID_TIER_NRCDID_TIER_A_MRCCSP_BRANDCSP_BRAND_A_MRCCSP_BRAND_VETTINGCSP_CAMPAIGNCSP_CAMPAIGN_MRCCSP_CAMPAIGN_A_MRC
Desc. subtype
Further refines the CDR type, depending on what the
Desc. total
The total amount charged (sell_rate+fees+surcharges)
Example
{
"fees": [
{
"cost": "0.000100",
"name": "extra_cheese"
}
],
"host_number": "12003004000",
"id": "01EH2Y28M6KXG14QMPM3HSP1Y0",
"inserted_at": "2021-08-13T04:08:44.762841Z",
"item_count": 1,
"item_id": "01FCYT490ZK2NYF0BFYRFFAJZ8",
"remote_number": "12003004001",
"sell_rate": "0.000900",
"status": "UNKNOWN",
"subtype": "NONE",
"surcharges": [
{
"cost": "0.000100",
"name": "ACME Corp"
}
],
"total": "0.000900",
"type": "API",
"updated_at": "2021-08-13T04:08:44.762841Z"
}
API
List CDRs
GET /api/v1/cdrs HTTP/1.1
Retrieve latest cdrs
Query Parameters
| Name | Type | Description |
|---|---|---|
| first | Integer | Query Desc. first |
| last | Integer | Query Desc. last |
| after | String | Query Desc. after |
| before | String | Query Desc. before |
Query Desc. first
The number of items to return starting from the 'after' cursor
Query Desc. last
The number of items to return behind the 'before' cursor
Query Desc. after
The cursor representing the starting point of a 'first' based paging
Query Desc. before
The cursor representing the starting point of a 'last' based paging
Request
GET /api/v1/cdrs HTTP/1.1
Accept: application/json
Response 200
application/json
HTTP/1.1 200
Content-Type: application/json
Content-Length: 1072
{
"count": 1,
"page_info": {
"end_cursor": "YXJyYXljb25uZWN0aW9uOjQ=",
"has_next_page": true,
"has_previous_page": false,
"start_cursor": "YXJyYXljb25uZWN0aW9uOjA="
},
"results": [
{
"associations": {
"api_key": {
"id": "c6be45e4-b7dd-412c-96c4-777e83fb9c48"
}
},
"data": {
"fees": [
{
"cost": "0.000100",
"name": "extra_cheese"
}
],
"host_number": "12003004000",
"id": "01EH2Y28M6KXG14QMPM3HSP1Y0",
"inserted_at": "2021-08-13T04:08:44.762841Z",
"item_count": 1,
"item_id": "01FCYT490ZK2NYF0BFYRFFAJZ8",
"remote_number": "12003004001",
"sell_rate": "0.000900",
"status": "UNKNOWN",
"subtype": "NONE",
"surcharges": [
{
"cost": "0.000100",
"name": "ACME Corp"
}
],
"total": "0.000900",
"type": "API",
"updated_at": "2021-08-13T04:08:44.762841Z"
},
"type": "cdr"
}
]
}
Response 403
application/json
HTTP/1.1 403
Content-Type: application/json
Content-Length: 312
{
"errors": [
{
"code": "access_denied.no_scope",
"detail": "No scope available to user role",
"params": {
"action": "index",
"level": "guest",
"resource": "resource"
},
"sub_code": "none",
"title": "Access Denied, no scope available"
}
]
}
List CDRs by Type
GET /api/v1/cdrs_by_type/{type} HTTP/1.1
Retrieve latest cdrs by type
Path Parameters
| Name | Type | Description |
|---|---|---|
| type | CDRType! | CDR Type |
Query Parameters
| Name | Type | Description |
|---|---|---|
| first | Integer | Query Desc. first |
| last | Integer | Query Desc. last |
| after | String | Query Desc. after |
| before | String | Query Desc. before |
Query Desc. first
The number of items to return starting from the 'after' cursor
Query Desc. last
The number of items to return behind the 'before' cursor
Query Desc. after
The cursor representing the starting point of a 'first' based paging
Query Desc. before
The cursor representing the starting point of a 'last' based paging
Request
GET /api/v1/cdrs_by_type/{type} HTTP/1.1
Accept: application/json
Response 200
application/json
HTTP/1.1 200
Content-Type: application/json
Content-Length: 1072
{
"count": 1,
"page_info": {
"end_cursor": "YXJyYXljb25uZWN0aW9uOjQ=",
"has_next_page": true,
"has_previous_page": false,
"start_cursor": "YXJyYXljb25uZWN0aW9uOjA="
},
"results": [
{
"associations": {
"api_key": {
"id": "c6be45e4-b7dd-412c-96c4-777e83fb9c48"
}
},
"data": {
"fees": [
{
"cost": "0.000100",
"name": "extra_cheese"
}
],
"host_number": "12003004000",
"id": "01EH2Y28M6KXG14QMPM3HSP1Y0",
"inserted_at": "2021-08-13T04:08:44.762841Z",
"item_count": 1,
"item_id": "01FCYT490ZK2NYF0BFYRFFAJZ8",
"remote_number": "12003004001",
"sell_rate": "0.000900",
"status": "UNKNOWN",
"subtype": "NONE",
"surcharges": [
{
"cost": "0.000100",
"name": "ACME Corp"
}
],
"total": "0.000900",
"type": "API",
"updated_at": "2021-08-13T04:08:44.762841Z"
},
"type": "cdr"
}
]
}
Response 403
application/json
HTTP/1.1 403
Content-Type: application/json
Content-Length: 312
{
"errors": [
{
"code": "access_denied.no_scope",
"detail": "No scope available to user role",
"params": {
"action": "index",
"level": "guest",
"resource": "resource"
},
"sub_code": "none",
"title": "Access Denied, no scope available"
}
]
}
Retrieve CDR by ID
GET /api/v1/cdrs/{id} HTTP/1.1
Retrieve a CDR by ID
Path Parameters
| Name | Type | Description |
|---|---|---|
| id | String(format:ulid)! | CDR ID |
Request
GET /api/v1/cdrs/{id} HTTP/1.1
Accept: application/json
Response 200
application/json
HTTP/1.1 200
Content-Type: application/json
Content-Length: 725
{
"associations": {
"api_key": {
"id": "c6be45e4-b7dd-412c-96c4-777e83fb9c48"
}
},
"data": {
"fees": [
{
"cost": "0.000100",
"name": "extra_cheese"
}
],
"host_number": "12003004000",
"id": "01EH2Y28M6KXG14QMPM3HSP1Y0",
"inserted_at": "2021-08-13T04:08:44.762841Z",
"item_count": 1,
"item_id": "01FCYT490ZK2NYF0BFYRFFAJZ8",
"remote_number": "12003004001",
"sell_rate": "0.000900",
"status": "UNKNOWN",
"subtype": "NONE",
"surcharges": [
{
"cost": "0.000100",
"name": "ACME Corp"
}
],
"total": "0.000900",
"type": "API",
"updated_at": "2021-08-13T04:08:44.762841Z"
},
"type": "cdr"
}
Response 403
application/json
HTTP/1.1 403
Content-Type: application/json
Content-Length: 312
{
"errors": [
{
"code": "access_denied.no_scope",
"detail": "No scope available to user role",
"params": {
"action": "index",
"level": "guest",
"resource": "resource"
},
"sub_code": "none",
"title": "Access Denied, no scope available"
}
]
}
Response 404
application/json
HTTP/1.1 404
Content-Type: application/json
Content-Length: 314
{
"errors": [
{
"code": "not_found",
"detail": "The specified resource could not be found",
"params": {
"resource": {
"id": "3fbb573a-6049-44a0-a12c-d3a1ffae0b69",
"type": "user"
}
},
"sub_code": "none",
"title": "Not Found"
}
]
}
Rebuild CDR Result
GET /api/v1/cdrs/{cdr_id}/result HTTP/1.1
Attempt to reproduce results from a CDR
Path Parameters
| Name | Type | Description |
|---|---|---|
| cdr_id | String(format:ulid)! | CDR ID |
Request
GET /api/v1/cdrs/{cdr_id}/result HTTP/1.1
Accept: application/json
Response 200
application/json
HTTP/1.1 200
Content-Type: application/json
Content-Length: 821
{
"cdr": {
"associations": {
"api_key": {
"id": "c6be45e4-b7dd-412c-96c4-777e83fb9c48"
}
},
"data": {
"fees": [
{
"cost": "0.000100",
"name": "extra_cheese"
}
],
"host_number": "12003004000",
"id": "01EH2Y28M6KXG14QMPM3HSP1Y0",
"inserted_at": "2021-08-13T04:08:44.762841Z",
"item_count": 1,
"item_id": "01FCYT490ZK2NYF0BFYRFFAJZ8",
"remote_number": "12003004001",
"sell_rate": "0.000900",
"status": "UNKNOWN",
"subtype": "NONE",
"surcharges": [
{
"cost": "0.000100",
"name": "ACME Corp"
}
],
"total": "0.000900",
"type": "API",
"updated_at": "2021-08-13T04:08:44.762841Z"
},
"type": "cdr"
},
"lookups": []
}
Response 403
application/json
HTTP/1.1 403
Content-Type: application/json
Content-Length: 312
{
"errors": [
{
"code": "access_denied.no_scope",
"detail": "No scope available to user role",
"params": {
"action": "index",
"level": "guest",
"resource": "resource"
},
"sub_code": "none",
"title": "Access Denied, no scope available"
}
]
}
Response 404
application/json
HTTP/1.1 404
Content-Type: application/json
Content-Length: 314
{
"errors": [
{
"code": "not_found",
"detail": "The specified resource could not be found",
"params": {
"resource": {
"id": "3fbb573a-6049-44a0-a12c-d3a1ffae0b69",
"type": "user"
}
},
"sub_code": "none",
"title": "Not Found"
}
]
}