Skip to content
Markets open

Switch API reference

Switch: CDRs and analytics

Call records, exports, saved views, margin, cost and quality analysis.

26 operationsBase URL https://packetexchange.io/api/v1Postman collection

BrowseSwitch: CDRs and analytics

Get margin and quality totals for all traffic

GET/api/v1/switch/analytics/overview

Access
API key. Scoped keys need switch:manage.
Rate limit
100 requests per second (the default)

Revenue, cost, margin, ASR and minutes across every customer and supplier over the window, plus how much billed traffic carries no supplier cost yet.

Parameters

NameInTypeDescription
fromquerystringISO-8601 start (default: 30 days before to)
toquerystringISO-8601 end (default: now)

Response 200

FieldTypeDescription
datarequiredobject-
revenuerequireddata.revenuenumberUS dollars as a JSON number rounded to 6 decimals (a computed figure, not a ledger string)
costrequireddata.costnumberUS dollars as a JSON number rounded to 6 decimals (a computed figure, not a ledger string)
marginrequireddata.marginnumberUS dollars as a JSON number rounded to 6 decimals (a computed figure, not a ledger string)
marginPctrequireddata.marginPctnumber | nullnull when there was no revenue
callsrequireddata.callsinteger-
answeredrequireddata.answeredinteger-
minutesrequireddata.minutesnumber-
asrrequireddata.asrnumber | nullAnswer rate in percent; null when there were no calls
windowrequireddata.windowobject-
fromrequireddata.window.fromstring (date-time)ISO-8601 timestamp (UTC)
torequireddata.window.tostring (date-time)ISO-8601 timestamp (UTC)
labelrequireddata.window.labelstring-
freshnessrequireddata.freshnessobject-
ratingrequireddata.ratingobject-
unratedBilledrequireddata.rating.unratedBilledinteger-
billedCallsrequireddata.rating.billedCallsinteger-
unratedPctrequireddata.rating.unratedPctnumber-
unratedRevenuerequireddata.rating.unratedRevenuenumberUS dollars as a JSON number rounded to 6 decimals (a computed figure, not a ledger string)
unratedMinutesrequireddata.rating.unratedMinutesnumber-

Errors

  • 400VALIDATION_ERROR, INVALID_INPUT or BAD_REQUEST. For VALIDATION_ERROR, error.details is an array of { path, message }.
  • 401UNAUTHORIZED: missing, invalid, expired or revoked credential.
  • 402SWITCH_SUBSCRIPTION_REQUIRED: the account has no active Switch plan or trial.
  • 403FORBIDDEN: not allowed - a scoped key lacks the scope, or the endpoint is session-only.
  • 429RATE_LIMITED: slow down and retry after the Retry-After seconds.
  • 500INTERNAL_ERROR: unexpected failure. Quote X-Request-Id to support.

Get daily margin and quality figures

GET/api/v1/switch/analytics/timeseries

Access
API key. Scoped keys need switch:manage.
Rate limit
100 requests per second (the default)

Parameters

NameInTypeDescription
fromquerystringISO-8601 start (default: 30 days before to)
toquerystringISO-8601 end (default: now)

Response 200

FieldTypeDescription
datarequiredobject[]-
revenuerequireddata[].revenuenumberUS dollars as a JSON number rounded to 6 decimals (a computed figure, not a ledger string)
costrequireddata[].costnumberUS dollars as a JSON number rounded to 6 decimals (a computed figure, not a ledger string)
marginrequireddata[].marginnumberUS dollars as a JSON number rounded to 6 decimals (a computed figure, not a ledger string)
marginPctrequireddata[].marginPctnumber | nullnull when there was no revenue
callsrequireddata[].callsinteger-
answeredrequireddata[].answeredinteger-
minutesrequireddata[].minutesnumber-
asrrequireddata[].asrnumber | nullAnswer rate in percent; null when there were no calls
dayrequireddata[].daystring-

Errors

  • 400VALIDATION_ERROR, INVALID_INPUT or BAD_REQUEST. For VALIDATION_ERROR, error.details is an array of { path, message }.
  • 401UNAUTHORIZED: missing, invalid, expired or revoked credential.
  • 402SWITCH_SUBSCRIPTION_REQUIRED: the account has no active Switch plan or trial.
  • 403FORBIDDEN: not allowed - a scoped key lacks the scope, or the endpoint is session-only.
  • 429RATE_LIMITED: slow down and retry after the Retry-After seconds.
  • 500INTERNAL_ERROR: unexpected failure. Quote X-Request-Id to support.

Break down margin and quality by customer, supplier or destination

GET/api/v1/switch/analytics/breakdown

Access
API key. Scoped keys need switch:manage.
Rate limit
100 requests per second (the default)

Parameters

NameInTypeDescription
fromquerystringISO-8601 start (default: 30 days before to)
toquerystringISO-8601 end (default: now)
byquerystringDefault customerOne of customer, supplier, destination

Response 200

FieldTypeDescription
datarequiredobject[]-
revenuerequireddata[].revenuenumberUS dollars as a JSON number rounded to 6 decimals (a computed figure, not a ledger string)
costrequireddata[].costnumberUS dollars as a JSON number rounded to 6 decimals (a computed figure, not a ledger string)
marginrequireddata[].marginnumberUS dollars as a JSON number rounded to 6 decimals (a computed figure, not a ledger string)
marginPctrequireddata[].marginPctnumber | nullnull when there was no revenue
callsrequireddata[].callsinteger-
answeredrequireddata[].answeredinteger-
minutesrequireddata[].minutesnumber-
asrrequireddata[].asrnumber | nullAnswer rate in percent; null when there were no calls
keyrequireddata[].keystring-
labelrequireddata[].labelstring-
externaldata[].externalboolean-

Errors

  • 400VALIDATION_ERROR, INVALID_INPUT or BAD_REQUEST. For VALIDATION_ERROR, error.details is an array of { path, message }.
  • 401UNAUTHORIZED: missing, invalid, expired or revoked credential.
  • 402SWITCH_SUBSCRIPTION_REQUIRED: the account has no active Switch plan or trial.
  • 403FORBIDDEN: not allowed - a scoped key lacks the scope, or the endpoint is session-only.
  • 429RATE_LIMITED: slow down and retry after the Retry-After seconds.
  • 500INTERNAL_ERROR: unexpected failure. Quote X-Request-Id to support.

List your recent call-record exports

GET/api/v1/switch/cdr-exports

Access
API key. Scoped keys need switch:manage.
Rate limit
100 requests per second (the default)

The latest 25 Switch exports.

Response 200

FieldTypeDescription
datarequiredobject[]-
idrequireddata[].idstring (uuid)-
phaserequireddata[].phasestringqueued, running, completed or failed
statusrequireddata[].statusstring-
requestedScoperequireddata[].requestedScopestring | null-
requestedAtrequireddata[].requestedAtstring-
recordCountrequireddata[].recordCountinteger | nullOnly set once completed
numbersMaskedrequireddata[].numbersMaskedboolean-
addressesMaskedrequireddata[].addressesMaskedboolean-
truncateddata[].truncatedboolean-
errordata[].errorstring | null-
completedAtdata[].completedAtstring (date-time) | nullISO-8601 timestamp (UTC)
downloadabledata[].downloadableboolean-
downloadUrldata[].downloadUrlstring | nullGET /billing/exports/{id}/download once completed. No server path is ever returned.
rowCountdata[].rowCountinteger | null-
createdAtdata[].createdAtstring (date-time)ISO-8601 timestamp (UTC)
queryIddata[].queryIdstring | null-

Errors

  • 400VALIDATION_ERROR, INVALID_INPUT or BAD_REQUEST. For VALIDATION_ERROR, error.details is an array of { path, message }.
  • 401UNAUTHORIZED: missing, invalid, expired or revoked credential.
  • 402SWITCH_SUBSCRIPTION_REQUIRED: the account has no active Switch plan or trial.
  • 403FORBIDDEN: not allowed - a scoped key lacks the scope, or the endpoint is session-only.
  • 429RATE_LIMITED: slow down and retry after the Retry-After seconds.
  • 500INTERNAL_ERROR: unexpected failure. Quote X-Request-Id to support.

Start a background call-record export

POST/api/v1/switch/cdr-exports

Access
API key. Scoped keys need switch:manage.
Rate limit
100 requests per second (the default)

Queues an export of the filtered records (body takes the same filters as GET /switch/cdrs). At most 3 exports may run at once. Numbers: a scoped API key without the cdr:numbers scope receives masked calling and dialled numbers (numbersMasked says so). Full-access keys and dashboard sessions see them in full.

Test keys: refused with 403 TEST_KEY_NOT_ALLOWED. The Switch has no test mode, so a change always applies to your live configuration. Test keys can still read Switch data.

Request body (application/json)

FieldTypeDescription
fromstringISO-8601 start of the window
tostringISO-8601 end of the window
kindstring-One of voice, sms
directionstring-One of inbound, outbound
statusstring-
subAccountIdstring (uuid)Customer
customerTrunkIdstring (uuid)-
vendorTrunkIdstring (uuid)Supplier trunk
supplierTrunkMatchstringHow vendorTrunkId matches failover attempts (default selected)One of selected, attempted, either
routeGroupIdstring (uuid)-
countryPrefixstring-
destinationstring-
destinationNamestring-
answeredOnlystring-One of true, false
answeredStatestring-One of answered, unanswered
mediaModestring-One of direct, proxy
sipCodeinteger-
sipCodesstringComma-separated SIP codes (max 20)
q850Causeinteger-
q850CausesstringComma-separated Q.850 causes (max 20)
hangupCausestring-
durationMinnumber-
durationMaxnumber-
pddMinMsnumber-
pddMaxMsnumber-
codecstring-
releasePartystring-
ipstring-
ratingStatestring-One of rated, unrated
negativeMarginOnlystring-One of true, false
riskMinnumber-
attestationstring-One of A, B, C
searchstringUp to 20 values separated by comma, semicolon or newline
searchFieldstring-
searchMatchstring-One of any, all
sortBystring-
sortDirstring-One of asc, desc
includeProbesstringInclude the platform's synthetic reachability probes (hidden by default)One of true, false
limitinteger-1 to 500
offsetinteger-min 0

Response 202

FieldTypeDescription
datarequiredobjectSame fields as SwitchCdrExport, shown earlier on this page.

Errors

  • 400VALIDATION_ERROR, INVALID_INPUT or BAD_REQUEST. For VALIDATION_ERROR, error.details is an array of { path, message }.
  • 401UNAUTHORIZED: missing, invalid, expired or revoked credential.
  • 402SWITCH_SUBSCRIPTION_REQUIRED: the account has no active Switch plan or trial.
  • 403FORBIDDEN: not allowed - a scoped key lacks the scope, or the endpoint is session-only.
  • 409CONFLICT (or a code-specific 409): the change clashes with existing state.
  • 429RATE_LIMITED: slow down and retry after the Retry-After seconds.
  • 500INTERNAL_ERROR: unexpected failure. Quote X-Request-Id to support.
  • AlsoTOO_MANY_EXPORTS

Get the status of a call-record export

GET/api/v1/switch/cdr-exports/{id}

Access
API key. Scoped keys need switch:manage.
Rate limit
100 requests per second (the default)

Parameters

NameInTypeDescription
idrequiredpathstring-

Response 200

FieldTypeDescription
datarequiredobjectSame fields as SwitchCdrExport, shown earlier on this page.

Errors

  • 400VALIDATION_ERROR, INVALID_INPUT or BAD_REQUEST. For VALIDATION_ERROR, error.details is an array of { path, message }.
  • 401UNAUTHORIZED: missing, invalid, expired or revoked credential.
  • 402SWITCH_SUBSCRIPTION_REQUIRED: the account has no active Switch plan or trial.
  • 403FORBIDDEN: not allowed - a scoped key lacks the scope, or the endpoint is session-only.
  • 404NOT_FOUND: no such resource on your account.
  • 429RATE_LIMITED: slow down and retry after the Retry-After seconds.
  • 500INTERNAL_ERROR: unexpected failure. Quote X-Request-Id to support.

Get traffic usage for one customer

GET/api/v1/switch/usage

Access
API key. Scoped keys need switch:manage.
Rate limit
100 requests per second (the default)

Totals, per-day figures, live concurrent calls and (optionally) per-destination usage for a customer (sub-account) over a window of up to 92 days (default: the last 24 hours). A longer window is clamped and says so in window.clamped. live.concurrentCalls is null when the live monitor cannot be reached.

Parameters

NameInTypeDescription
subAccountIdrequiredquerystring (uuid)The customer to report on (required)
sincequerystringISO-8601 start (default: 24 hours before until)
untilquerystringISO-8601 end (default: now)
destinationsquerystringInclude the per-destination breakdownOne of true, false, 1, 0

Response 200

FieldTypeDescription
datarequiredobject-
windowrequireddata.windowobject-
subAccountIdrequireddata.window.subAccountIdstring (uuid)-
sincerequireddata.window.sincestring (date-time)ISO-8601 timestamp (UTC)
untilrequireddata.window.untilstring (date-time)ISO-8601 timestamp (UTC)
nextSincerequireddata.window.nextSincestring (date-time)ISO-8601 timestamp (UTC)
clampedrequireddata.window.clampedboolean-
maxWindowDaysrequireddata.window.maxWindowDaysinteger-
totalsrequireddata.totalsobjectCalls, answered, minutes, revenue, cost and rejectedAtCapacity over the window
dailyrequireddata.dailyobject[]-
liverequireddata.liveobject-
concurrentCallsrequireddata.live.concurrentCallsinteger | null-
byDestinationdata.byDestinationobject[]-

Errors

  • 400VALIDATION_ERROR, INVALID_INPUT or BAD_REQUEST. For VALIDATION_ERROR, error.details is an array of { path, message }.
  • 401UNAUTHORIZED: missing, invalid, expired or revoked credential.
  • 402SWITCH_SUBSCRIPTION_REQUIRED: the account has no active Switch plan or trial.
  • 403FORBIDDEN: not allowed - a scoped key lacks the scope, or the endpoint is session-only.
  • 429RATE_LIMITED: slow down and retry after the Retry-After seconds.
  • 500INTERNAL_ERROR: unexpected failure. Quote X-Request-Id to support.

Record that call-record details were copied

POST/api/v1/switch/cdrs/{id}/audit-copy

Access
API key. Scoped keys need switch:manage.
Rate limit
100 requests per second (the default)

Writes an access entry to your account activity (for example when diagnostics are copied to the clipboard). Answers 202 with { success: true } and no data.

Test keys: refused with 403 TEST_KEY_NOT_ALLOWED. The Switch has no test mode, so a change always applies to your live configuration. Test keys can still read Switch data.

Parameters

NameInTypeDescription
idrequiredpathstring-

Request body (application/json)

FieldTypeDescription
whatstringWhat was copied (default "diagnostics")max 64 chars

Response 202

FieldTypeDescription
datarequiredany | enum | nullNot sent by this endpoint

Errors

  • 400VALIDATION_ERROR, INVALID_INPUT or BAD_REQUEST. For VALIDATION_ERROR, error.details is an array of { path, message }.
  • 401UNAUTHORIZED: missing, invalid, expired or revoked credential.
  • 402SWITCH_SUBSCRIPTION_REQUIRED: the account has no active Switch plan or trial.
  • 403FORBIDDEN: not allowed - a scoped key lacks the scope, or the endpoint is session-only.
  • 404NOT_FOUND: no such resource on your account.
  • 409CONFLICT (or a code-specific 409): the change clashes with existing state.
  • 429RATE_LIMITED: slow down and retry after the Retry-After seconds.
  • 500INTERNAL_ERROR: unexpected failure. Quote X-Request-Id to support.

Get the values available to filter call records by

GET/api/v1/switch/cdr-filter-options

Access
API key. Scoped keys need switch:manage.
Rate limit
100 requests per second (the default)

Response 200

FieldTypeDescription
datarequiredobject-
ingressTrunksrequireddata.ingressTrunksobject[]-
idrequireddata.ingressTrunks[].idstring (uuid)-
labelrequireddata.ingressTrunks[].labelstring-
ownerrequireddata.ingressTrunks[].ownerstring | null-
techPrefixrequireddata.ingressTrunks[].techPrefixstring | null-
egressTrunksrequireddata.egressTrunksobject[]-
idrequireddata.egressTrunks[].idstring (uuid)-
labelrequireddata.egressTrunks[].labelstring-
ownerrequireddata.egressTrunks[].ownerstring | null-
techPrefixrequireddata.egressTrunks[].techPrefixstring | null-
routeGroupsrequireddata.routeGroupsobject[]-
idrequireddata.routeGroups[].idstring (uuid)-
labelrequireddata.routeGroups[].labelstring-
countryrequireddata.routeGroups[].countrystring | null-
hasRiskScoresrequireddata.hasRiskScoresboolean-
hasAttestationrequireddata.hasAttestationboolean-

Errors

  • 400VALIDATION_ERROR, INVALID_INPUT or BAD_REQUEST. For VALIDATION_ERROR, error.details is an array of { path, message }.
  • 401UNAUTHORIZED: missing, invalid, expired or revoked credential.
  • 402SWITCH_SUBSCRIPTION_REQUIRED: the account has no active Switch plan or trial.
  • 403FORBIDDEN: not allowed - a scoped key lacks the scope, or the endpoint is session-only.
  • 429RATE_LIMITED: slow down and retry after the Retry-After seconds.
  • 500INTERNAL_ERROR: unexpected failure. Quote X-Request-Id to support.

Get your saved call-records layout

GET/api/v1/switch/cdr-workspace

Access
API key. Scoped keys need switch:manage.
Rate limit
100 requests per second (the default)

Response 200

FieldTypeDescription
datarequiredobject | nullnull until a layout has been saved
orderdata.orderstring[]-
colsdata.colsstring[]-
compactdata.compactboolean-
pageSizedata.pageSizenumber-
widthsdata.widthsobject-

Errors

  • 400VALIDATION_ERROR, INVALID_INPUT or BAD_REQUEST. For VALIDATION_ERROR, error.details is an array of { path, message }.
  • 401UNAUTHORIZED: missing, invalid, expired or revoked credential.
  • 402SWITCH_SUBSCRIPTION_REQUIRED: the account has no active Switch plan or trial.
  • 403FORBIDDEN: not allowed - a scoped key lacks the scope, or the endpoint is session-only.
  • 429RATE_LIMITED: slow down and retry after the Retry-After seconds.
  • 500INTERNAL_ERROR: unexpected failure. Quote X-Request-Id to support.

Save your call-records layout

PUT/api/v1/switch/cdr-workspace

Access
API key. Scoped keys need switch:manage.
Rate limit
100 requests per second (the default)

Column order, visible columns, density, page size (50, 100 or 200) and column widths (48-600 px). Invalid values are dropped, not rejected.

Test keys: refused with 403 TEST_KEY_NOT_ALLOWED. The Switch has no test mode, so a change always applies to your live configuration. Test keys can still read Switch data.

Request body (application/json)

FieldTypeDescription
orderstring[]-
colsstring[]-
compactboolean-
pageSizenumber-
widthsobject-

Response 200

FieldTypeDescription
datarequiredobject-
orderdata.orderstring[]-
colsdata.colsstring[]-
compactdata.compactboolean-
pageSizedata.pageSizenumber-
widthsdata.widthsobject-

Response 202

FieldTypeDescription
datarequiredobject-
approvalRequireddata.approvalRequiredboolean-One of true
approvalRequestIddata.approvalRequestIdstring (uuid) | null-
permissiondata.permissionstring-
expiresAtdata.expiresAtstring (date-time)-
messagedata.messagestring-

Errors

  • 400VALIDATION_ERROR, INVALID_INPUT or BAD_REQUEST. For VALIDATION_ERROR, error.details is an array of { path, message }.
  • 401UNAUTHORIZED: missing, invalid, expired or revoked credential.
  • 402SWITCH_SUBSCRIPTION_REQUIRED: the account has no active Switch plan or trial.
  • 403FORBIDDEN: not allowed - a scoped key lacks the scope, or the endpoint is session-only.
  • 409CONFLICT (or a code-specific 409): the change clashes with existing state.
  • 429RATE_LIMITED: slow down and retry after the Retry-After seconds.
  • 500INTERNAL_ERROR: unexpected failure. Quote X-Request-Id to support.

Search call records

GET/api/v1/switch/cdrs

Access
API key. Scoped keys need switch:manage.
Rate limit
100 requests per second (the default)

Paged call records (one row per attempt) with a summary over the whole filtered window: calls, ASR and ACD (per call, failover collapsed), PDD median and p95, revenue, cost and margin. Long windows are clamped (see window). Numbers: a scoped API key without the cdr:numbers scope receives masked calling and dialled numbers (numbersMasked says so). Full-access keys and dashboard sessions see them in full.

Parameters

NameInTypeDescription
fromquerystringISO-8601 start of the window
toquerystringISO-8601 end of the window
kindquerystring-One of voice, sms
directionquerystring-One of inbound, outbound
statusquerystring-
subAccountIdquerystring (uuid)Customer
customerTrunkIdquerystring (uuid)-
vendorTrunkIdquerystring (uuid)Supplier trunk
supplierTrunkMatchquerystringHow vendorTrunkId matches failover attempts (default selected)One of selected, attempted, either
routeGroupIdquerystring (uuid)-
countryPrefixquerystring-
destinationquerystring-
destinationNamequerystring-
answeredOnlyquerystring-One of true, false
answeredStatequerystring-One of answered, unanswered
mediaModequerystring-One of direct, proxy
sipCodequeryinteger-
sipCodesquerystringComma-separated SIP codes (max 20)
q850Causequeryinteger-
q850CausesquerystringComma-separated Q.850 causes (max 20)
hangupCausequerystring-
durationMinquerynumber-
durationMaxquerynumber-
pddMinMsquerynumber-
pddMaxMsquerynumber-
codecquerystring-
releasePartyquerystring-
ipquerystring-
ratingStatequerystring-One of rated, unrated
negativeMarginOnlyquerystring-One of true, false
riskMinquerynumber-
attestationquerystring-One of A, B, C
searchquerystringUp to 20 values separated by comma, semicolon or newline
searchFieldquerystring-
searchMatchquerystring-One of any, all
sortByquerystring-
sortDirquerystring-One of asc, desc
includeProbesquerystringInclude the platform's synthetic reachability probes (hidden by default)One of true, false
limitqueryinteger-
offsetqueryinteger-

Response 200

FieldTypeDescription
datarequiredobject-
rowsrequireddata.rowsobject[]-
idrequireddata.rows[].idstring (uuid)-
createdAtrequireddata.rows[].createdAtstring (date-time)ISO-8601 timestamp (UTC)
kindrequireddata.rows[].kindstring-One of voice, sms
directionrequireddata.rows[].directionstring-
fromrequireddata.rows[].fromstring | null-
torequireddata.rows[].tostring | null-
clirequireddata.rows[].clistring | null-
statusrequireddata.rows[].statusstring-
sipCoderequireddata.rows[].sipCodeinteger | null-
hangupCauserequireddata.rows[].hangupCausestring | null-
durationSecondsrequireddata.rows[].durationSecondsinteger | null-
billedSecondsrequireddata.rows[].billedSecondsinteger | null-
segmentsrequireddata.rows[].segmentsinteger | null-
pddMsrequireddata.rows[].pddMsinteger | null-
callGroupIdrequireddata.rows[].callGroupIdstring | nullShared by every failover attempt of one call
customerrequireddata.rows[].customerstring | null-
supplierrequireddata.rows[].supplierstring | null-
revenuerequireddata.rows[].revenuenumberUS dollars as a JSON number rounded to 6 decimals (a computed figure, not a ledger string)
costrequireddata.rows[].costnumberUS dollars as a JSON number rounded to 6 decimals (a computed figure, not a ledger string)
marginrequireddata.rows[].marginnumberUS dollars as a JSON number rounded to 6 decimals (a computed figure, not a ledger string)
sellRatePerUnitrequireddata.rows[].sellRatePerUnitnumber | nullnull when the call could not be rated (distinct from a real 0)
buyRatePerUnitrequireddata.rows[].buyRatePerUnitnumber | nullUS dollars as a JSON number rounded to 6 decimals (a computed figure, not a ledger string)
ratingStaterequireddata.rows[].ratingStatestring | null-
mosrequireddata.rows[].mosnumber | null-
jitterMsrequireddata.rows[].jitterMsnumber | null-
packetLossPctrequireddata.rows[].packetLossPctnumber | null-
mediaModerequireddata.rows[].mediaModestring | null-
codecrequireddata.rows[].codecstring | null-
q850Causerequireddata.rows[].q850Causeinteger | null-
destinationNamerequireddata.rows[].destinationNamestring | null-
riskScoredata.rows[].riskScorenumber | null-
attestationdata.rows[].attestationstring | null-
customerTrunkIddata.rows[].customerTrunkIdstring (uuid) | null-
attemptCountdata.rows[].attemptCountinteger-
invoiceIddata.rows[].invoiceIdstring (uuid) | null-
totalrequireddata.totalinteger-
limitrequireddata.limitinteger-
offsetrequireddata.offsetinteger-
summaryrequireddata.summaryobjectWindow totals: calls, answeredCalls, asrPercent, acdSeconds, talkSeconds, billableSeconds, pddMedianMs, pddP95Ms, revenue, cost, margin, ingestionLagSeconds...
numbersMaskedrequireddata.numbersMaskedboolean-
addressesMaskedrequireddata.addressesMaskedboolean-
fieldVisibilityrequireddata.fieldVisibilityobject-
generatedAtrequireddata.generatedAtstring (date-time)ISO-8601 timestamp (UTC)
windowrequireddata.windowobject-
fromrequireddata.window.fromstring (date-time) | nullISO-8601 timestamp (UTC)
torequireddata.window.tostring (date-time) | nullISO-8601 timestamp (UTC)
clampedrequireddata.window.clampedboolean-
maxWindowDaysrequireddata.window.maxWindowDaysinteger-
queryIdrequireddata.queryIdstringStable id of the question asked, shared with exports of the same filters

Errors

  • 400VALIDATION_ERROR, INVALID_INPUT or BAD_REQUEST. For VALIDATION_ERROR, error.details is an array of { path, message }.
  • 401UNAUTHORIZED: missing, invalid, expired or revoked credential.
  • 402SWITCH_SUBSCRIPTION_REQUIRED: the account has no active Switch plan or trial.
  • 403FORBIDDEN: not allowed - a scoped key lacks the scope, or the endpoint is session-only.
  • 429RATE_LIMITED: slow down and retry after the Retry-After seconds.
  • 500INTERNAL_ERROR: unexpected failure. Quote X-Request-Id to support.

Count call records by filter value

GET/api/v1/switch/cdrs/facets

Access
API key. Scoped keys need switch:manage.
Rate limit
100 requests per second (the default)

For the filtered window, how many records carry each status, SIP code, customer, supplier and so on.

Parameters

NameInTypeDescription
fromquerystringISO-8601 start of the window
toquerystringISO-8601 end of the window
kindquerystring-One of voice, sms
directionquerystring-One of inbound, outbound
statusquerystring-
subAccountIdquerystring (uuid)Customer
customerTrunkIdquerystring (uuid)-
vendorTrunkIdquerystring (uuid)Supplier trunk
supplierTrunkMatchquerystringHow vendorTrunkId matches failover attempts (default selected)One of selected, attempted, either
routeGroupIdquerystring (uuid)-
countryPrefixquerystring-
destinationquerystring-
destinationNamequerystring-
answeredOnlyquerystring-One of true, false
answeredStatequerystring-One of answered, unanswered
mediaModequerystring-One of direct, proxy
sipCodequeryinteger-
sipCodesquerystringComma-separated SIP codes (max 20)
q850Causequeryinteger-
q850CausesquerystringComma-separated Q.850 causes (max 20)
hangupCausequerystring-
durationMinquerynumber-
durationMaxquerynumber-
pddMinMsquerynumber-
pddMaxMsquerynumber-
codecquerystring-
releasePartyquerystring-
ipquerystring-
ratingStatequerystring-One of rated, unrated
negativeMarginOnlyquerystring-One of true, false
riskMinquerynumber-
attestationquerystring-One of A, B, C
searchquerystringUp to 20 values separated by comma, semicolon or newline
searchFieldquerystring-
searchMatchquerystring-One of any, all
sortByquerystring-
sortDirquerystring-One of asc, desc
includeProbesquerystringInclude the platform's synthetic reachability probes (hidden by default)One of true, false
limitqueryinteger-
offsetqueryinteger-

Response 200

FieldTypeDescription
datarequiredobject-
queryIdrequireddata.queryIdstringStable id of the question asked, shared with exports of the same filters

Errors

  • 400VALIDATION_ERROR, INVALID_INPUT or BAD_REQUEST. For VALIDATION_ERROR, error.details is an array of { path, message }.
  • 401UNAUTHORIZED: missing, invalid, expired or revoked credential.
  • 402SWITCH_SUBSCRIPTION_REQUIRED: the account has no active Switch plan or trial.
  • 403FORBIDDEN: not allowed - a scoped key lacks the scope, or the endpoint is session-only.
  • 429RATE_LIMITED: slow down and retry after the Retry-After seconds.
  • 500INTERNAL_ERROR: unexpected failure. Quote X-Request-Id to support.

Get charts for the filtered call records

GET/api/v1/switch/cdrs/analytics

Access
API key. Scoped keys need switch:manage.
Rate limit
100 requests per second (the default)

Parameters

NameInTypeDescription
fromquerystringISO-8601 start of the window
toquerystringISO-8601 end of the window
kindquerystring-One of voice, sms
directionquerystring-One of inbound, outbound
statusquerystring-
subAccountIdquerystring (uuid)Customer
customerTrunkIdquerystring (uuid)-
vendorTrunkIdquerystring (uuid)Supplier trunk
supplierTrunkMatchquerystringHow vendorTrunkId matches failover attempts (default selected)One of selected, attempted, either
routeGroupIdquerystring (uuid)-
countryPrefixquerystring-
destinationquerystring-
destinationNamequerystring-
answeredOnlyquerystring-One of true, false
answeredStatequerystring-One of answered, unanswered
mediaModequerystring-One of direct, proxy
sipCodequeryinteger-
sipCodesquerystringComma-separated SIP codes (max 20)
q850Causequeryinteger-
q850CausesquerystringComma-separated Q.850 causes (max 20)
hangupCausequerystring-
durationMinquerynumber-
durationMaxquerynumber-
pddMinMsquerynumber-
pddMaxMsquerynumber-
codecquerystring-
releasePartyquerystring-
ipquerystring-
ratingStatequerystring-One of rated, unrated
negativeMarginOnlyquerystring-One of true, false
riskMinquerynumber-
attestationquerystring-One of A, B, C
searchquerystringUp to 20 values separated by comma, semicolon or newline
searchFieldquerystring-
searchMatchquerystring-One of any, all
sortByquerystring-
sortDirquerystring-One of asc, desc
includeProbesquerystringInclude the platform's synthetic reachability probes (hidden by default)One of true, false
limitqueryinteger-
offsetqueryinteger-

Response 200

FieldTypeDescription
datarequiredobject-
queryIdrequireddata.queryIdstringStable id of the question asked, shared with exports of the same filters

Errors

  • 400VALIDATION_ERROR, INVALID_INPUT or BAD_REQUEST. For VALIDATION_ERROR, error.details is an array of { path, message }.
  • 401UNAUTHORIZED: missing, invalid, expired or revoked credential.
  • 402SWITCH_SUBSCRIPTION_REQUIRED: the account has no active Switch plan or trial.
  • 403FORBIDDEN: not allowed - a scoped key lacks the scope, or the endpoint is session-only.
  • 429RATE_LIMITED: slow down and retry after the Retry-After seconds.
  • 500INTERNAL_ERROR: unexpected failure. Quote X-Request-Id to support.

Break down failed calls by stage and reason

GET/api/v1/switch/cdrs/failure-summary

Access
API key. Scoped keys need switch:manage.
Rate limit
100 requests per second (the default)

Parameters

NameInTypeDescription
fromquerystringISO-8601 start of the window
toquerystringISO-8601 end of the window
kindquerystring-One of voice, sms
directionquerystring-One of inbound, outbound
statusquerystring-
subAccountIdquerystring (uuid)Customer
customerTrunkIdquerystring (uuid)-
vendorTrunkIdquerystring (uuid)Supplier trunk
supplierTrunkMatchquerystringHow vendorTrunkId matches failover attempts (default selected)One of selected, attempted, either
routeGroupIdquerystring (uuid)-
countryPrefixquerystring-
destinationquerystring-
destinationNamequerystring-
answeredOnlyquerystring-One of true, false
answeredStatequerystring-One of answered, unanswered
mediaModequerystring-One of direct, proxy
sipCodequeryinteger-
sipCodesquerystringComma-separated SIP codes (max 20)
q850Causequeryinteger-
q850CausesquerystringComma-separated Q.850 causes (max 20)
hangupCausequerystring-
durationMinquerynumber-
durationMaxquerynumber-
pddMinMsquerynumber-
pddMaxMsquerynumber-
codecquerystring-
releasePartyquerystring-
ipquerystring-
ratingStatequerystring-One of rated, unrated
negativeMarginOnlyquerystring-One of true, false
riskMinquerynumber-
attestationquerystring-One of A, B, C
searchquerystringUp to 20 values separated by comma, semicolon or newline
searchFieldquerystring-
searchMatchquerystring-One of any, all
sortByquerystring-
sortDirquerystring-One of asc, desc
includeProbesquerystringInclude the platform's synthetic reachability probes (hidden by default)One of true, false
limitqueryinteger-
offsetqueryinteger-

Response 200

FieldTypeDescription
datarequiredobject-
queryIdrequireddata.queryIdstringStable id of the question asked, shared with exports of the same filters

Errors

  • 400VALIDATION_ERROR, INVALID_INPUT or BAD_REQUEST. For VALIDATION_ERROR, error.details is an array of { path, message }.
  • 401UNAUTHORIZED: missing, invalid, expired or revoked credential.
  • 402SWITCH_SUBSCRIPTION_REQUIRED: the account has no active Switch plan or trial.
  • 403FORBIDDEN: not allowed - a scoped key lacks the scope, or the endpoint is session-only.
  • 429RATE_LIMITED: slow down and retry after the Retry-After seconds.
  • 500INTERNAL_ERROR: unexpected failure. Quote X-Request-Id to support.

Group failed calls by the dimensions they share

GET/api/v1/switch/cdrs/failure-groups

Access
API key. Scoped keys need switch:manage.
Rate limit
100 requests per second (the default)

Clusters failures (for example one supplier, one destination, one SIP code) so a pattern reads as one problem.

Parameters

NameInTypeDescription
fromquerystringISO-8601 start of the window
toquerystringISO-8601 end of the window
kindquerystring-One of voice, sms
directionquerystring-One of inbound, outbound
statusquerystring-
subAccountIdquerystring (uuid)Customer
customerTrunkIdquerystring (uuid)-
vendorTrunkIdquerystring (uuid)Supplier trunk
supplierTrunkMatchquerystringHow vendorTrunkId matches failover attempts (default selected)One of selected, attempted, either
routeGroupIdquerystring (uuid)-
countryPrefixquerystring-
destinationquerystring-
destinationNamequerystring-
answeredOnlyquerystring-One of true, false
answeredStatequerystring-One of answered, unanswered
mediaModequerystring-One of direct, proxy
sipCodequeryinteger-
sipCodesquerystringComma-separated SIP codes (max 20)
q850Causequeryinteger-
q850CausesquerystringComma-separated Q.850 causes (max 20)
hangupCausequerystring-
durationMinquerynumber-
durationMaxquerynumber-
pddMinMsquerynumber-
pddMaxMsquerynumber-
codecquerystring-
releasePartyquerystring-
ipquerystring-
ratingStatequerystring-One of rated, unrated
negativeMarginOnlyquerystring-One of true, false
riskMinquerynumber-
attestationquerystring-One of A, B, C
searchquerystringUp to 20 values separated by comma, semicolon or newline
searchFieldquerystring-
searchMatchquerystring-One of any, all
sortByquerystring-
sortDirquerystring-One of asc, desc
includeProbesquerystringInclude the platform's synthetic reachability probes (hidden by default)One of true, false
limitqueryinteger-
offsetqueryinteger-
dimsquerystringComma-separated grouping dimensions
destinationDigitsqueryinteger-
bucketquerystring-One of day, hour
minSessionsqueryinteger-

Response 200

FieldTypeDescription
datarequiredobject-
queryIdrequireddata.queryIdstringStable id of the question asked, shared with exports of the same filters

Errors

  • 400VALIDATION_ERROR, INVALID_INPUT or BAD_REQUEST. For VALIDATION_ERROR, error.details is an array of { path, message }.
  • 401UNAUTHORIZED: missing, invalid, expired or revoked credential.
  • 402SWITCH_SUBSCRIPTION_REQUIRED: the account has no active Switch plan or trial.
  • 403FORBIDDEN: not allowed - a scoped key lacks the scope, or the endpoint is session-only.
  • 429RATE_LIMITED: slow down and retry after the Retry-After seconds.
  • 500INTERNAL_ERROR: unexpected failure. Quote X-Request-Id to support.

Get the call-filter vocabulary

GET/api/v1/switch/call-filters

Access
API key. Scoped keys need switch:manage.
Rate limit
100 requests per second (the default)

The shared filter names and closed value sets used by call records, quality and live calls.

Response 200

FieldTypeDescription
datarequiredobject-

Errors

  • 400VALIDATION_ERROR, INVALID_INPUT or BAD_REQUEST. For VALIDATION_ERROR, error.details is an array of { path, message }.
  • 401UNAUTHORIZED: missing, invalid, expired or revoked credential.
  • 402SWITCH_SUBSCRIPTION_REQUIRED: the account has no active Switch plan or trial.
  • 403FORBIDDEN: not allowed - a scoped key lacks the scope, or the endpoint is session-only.
  • 429RATE_LIMITED: slow down and retry after the Retry-After seconds.
  • 500INTERNAL_ERROR: unexpected failure. Quote X-Request-Id to support.

Get the list-filter vocabulary

GET/api/v1/switch/list-filters

Access
API key. Scoped keys need switch:manage.
Rate limit
100 requests per second (the default)

Filter names and value sets for the customer, supplier and trunk lists.

Response 200

FieldTypeDescription
datarequiredobject-

Errors

  • 400VALIDATION_ERROR, INVALID_INPUT or BAD_REQUEST. For VALIDATION_ERROR, error.details is an array of { path, message }.
  • 401UNAUTHORIZED: missing, invalid, expired or revoked credential.
  • 402SWITCH_SUBSCRIPTION_REQUIRED: the account has no active Switch plan or trial.
  • 403FORBIDDEN: not allowed - a scoped key lacks the scope, or the endpoint is session-only.
  • 429RATE_LIMITED: slow down and retry after the Retry-After seconds.
  • 500INTERNAL_ERROR: unexpected failure. Quote X-Request-Id to support.

Get one call record with attempts, SIP trace and timeline

GET/api/v1/switch/cdrs/{id}

Access
API key. Scoped keys need switch:manage.
Rate limit
100 requests per second (the default)

Numbers: a scoped API key without the cdr:numbers scope receives masked calling and dialled numbers (numbersMasked says so). Full-access keys and dashboard sessions see them in full. A record that is not yours answers 404 NOT_FOUND.

Parameters

NameInTypeDescription
idrequiredpathstring-

Response 200

FieldTypeDescription
datarequiredobject-
idrequireddata.idstring (uuid)-
createdAtrequireddata.createdAtstring (date-time)ISO-8601 timestamp (UTC)
kindrequireddata.kindstring-One of voice, sms
directionrequireddata.directionstring-
fromrequireddata.fromstring | null-
torequireddata.tostring | null-
clirequireddata.clistring | null-
statusrequireddata.statusstring-
sipCoderequireddata.sipCodeinteger | null-
hangupCauserequireddata.hangupCausestring | null-
durationSecondsrequireddata.durationSecondsinteger | null-
billedSecondsrequireddata.billedSecondsinteger | null-
segmentsrequireddata.segmentsinteger | null-
pddMsrequireddata.pddMsinteger | null-
callGroupIdrequireddata.callGroupIdstring | nullShared by every failover attempt of one call
customerrequireddata.customerstring | null-
supplierrequireddata.supplierstring | null-
revenuerequireddata.revenuenumberUS dollars as a JSON number rounded to 6 decimals (a computed figure, not a ledger string)
costrequireddata.costnumberUS dollars as a JSON number rounded to 6 decimals (a computed figure, not a ledger string)
marginrequireddata.marginnumberUS dollars as a JSON number rounded to 6 decimals (a computed figure, not a ledger string)
sellRatePerUnitrequireddata.sellRatePerUnitnumber | nullnull when the call could not be rated (distinct from a real 0)
buyRatePerUnitrequireddata.buyRatePerUnitnumber | nullUS dollars as a JSON number rounded to 6 decimals (a computed figure, not a ledger string)
ratingStaterequireddata.ratingStatestring | null-
mosrequireddata.mosnumber | null-
jitterMsrequireddata.jitterMsnumber | null-
packetLossPctrequireddata.packetLossPctnumber | null-
mediaModerequireddata.mediaModestring | null-
codecrequireddata.codecstring | null-
q850Causerequireddata.q850Causeinteger | null-
destinationNamerequireddata.destinationNamestring | null-
riskScoredata.riskScorenumber | null-
attestationdata.attestationstring | null-
customerTrunkIddata.customerTrunkIdstring (uuid) | null-
attemptCountdata.attemptCountinteger-
invoiceIddata.invoiceIdstring (uuid) | null-
attemptsrequireddata.attemptsobject[]Every supplier attempt of this call, including skipped candidates
tracerequireddata.traceobject | nullThe captured SIP messages, when available
timelinerequireddata.timelineobject-
startedAtrequireddata.timeline.startedAtstring (date-time) | nullISO-8601 timestamp (UTC)
startedFromrequireddata.timeline.startedFromstring | null-One of first_sip_message, first_supplier_attempt
answeredAtrequireddata.timeline.answeredAtstring (date-time) | nullISO-8601 timestamp (UTC)
endedAtrequireddata.timeline.endedAtstring (date-time) | nullISO-8601 timestamp (UTC)
recordedAtrequireddata.timeline.recordedAtstring (date-time) | nullISO-8601 timestamp (UTC)

Errors

  • 400VALIDATION_ERROR, INVALID_INPUT or BAD_REQUEST. For VALIDATION_ERROR, error.details is an array of { path, message }.
  • 401UNAUTHORIZED: missing, invalid, expired or revoked credential.
  • 402SWITCH_SUBSCRIPTION_REQUIRED: the account has no active Switch plan or trial.
  • 403FORBIDDEN: not allowed - a scoped key lacks the scope, or the endpoint is session-only.
  • 404NOT_FOUND: no such resource on your account.
  • 429RATE_LIMITED: slow down and retry after the Retry-After seconds.
  • 500INTERNAL_ERROR: unexpected failure. Quote X-Request-Id to support.

List the supplier attempts of a call

GET/api/v1/switch/cdrs/{id}/attempts

Access
API key. Scoped keys need switch:manage.
Rate limit
100 requests per second (the default)

A record that is not yours answers 404 NOT_FOUND.

Parameters

NameInTypeDescription
idrequiredpathstring-

Response 200

FieldTypeDescription
datarequiredobject[]-

Errors

  • 400VALIDATION_ERROR, INVALID_INPUT or BAD_REQUEST. For VALIDATION_ERROR, error.details is an array of { path, message }.
  • 401UNAUTHORIZED: missing, invalid, expired or revoked credential.
  • 402SWITCH_SUBSCRIPTION_REQUIRED: the account has no active Switch plan or trial.
  • 403FORBIDDEN: not allowed - a scoped key lacks the scope, or the endpoint is session-only.
  • 404NOT_FOUND: no such resource on your account.
  • 429RATE_LIMITED: slow down and retry after the Retry-After seconds.
  • 500INTERNAL_ERROR: unexpected failure. Quote X-Request-Id to support.

List saved call-record views

GET/api/v1/switch/cdr-views

Access
API key. Scoped keys need switch:manage.
Rate limit
100 requests per second (the default)

Response 200

FieldTypeDescription
datarequiredobject[]-
idrequireddata[].idstring (uuid)-
namerequireddata[].namestring-
servicerequireddata[].servicestring-One of voice, sms
filtersrequireddata[].filtersobject-
columnsrequireddata[].columnsstring[]-
sortrequireddata[].sortobject[]-
fieldrequireddata[].sort[].fieldstring-
directionrequireddata[].sort[].directionstring-One of asc, desc
isDefaultrequireddata[].isDefaultboolean-
createdAtrequireddata[].createdAtstring (date-time)ISO-8601 timestamp (UTC)
updatedAtrequireddata[].updatedAtstring (date-time)ISO-8601 timestamp (UTC)

Errors

  • 400VALIDATION_ERROR, INVALID_INPUT or BAD_REQUEST. For VALIDATION_ERROR, error.details is an array of { path, message }.
  • 401UNAUTHORIZED: missing, invalid, expired or revoked credential.
  • 402SWITCH_SUBSCRIPTION_REQUIRED: the account has no active Switch plan or trial.
  • 403FORBIDDEN: not allowed - a scoped key lacks the scope, or the endpoint is session-only.
  • 429RATE_LIMITED: slow down and retry after the Retry-After seconds.
  • 500INTERNAL_ERROR: unexpected failure. Quote X-Request-Id to support.

Save a call-record view

POST/api/v1/switch/cdr-views

Access
API key. Scoped keys need switch:manage.
Rate limit
100 requests per second (the default)

Creates the view, or replaces the one with the same name.

Test keys: refused with 403 TEST_KEY_NOT_ALLOWED. The Switch has no test mode, so a change always applies to your live configuration. Test keys can still read Switch data.

Request body (application/json)

FieldTypeDescription
namerequiredstring-max 120 chars
servicestring-One of voice, sms
filtersobject-
columnsstring[]-
sortobject[]-
fieldrequiredsort[].fieldstring-max 64 chars
directionrequiredsort[].directionstring-One of asc, desc
isDefaultboolean-

Response 201

FieldTypeDescription
datarequiredobjectSame fields as SwitchCdrView, shown earlier on this page.

Response 202

FieldTypeDescription
datarequiredobject-
approvalRequireddata.approvalRequiredboolean-One of true
approvalRequestIddata.approvalRequestIdstring (uuid) | null-
permissiondata.permissionstring-
expiresAtdata.expiresAtstring (date-time)-
messagedata.messagestring-

Errors

  • 400VALIDATION_ERROR, INVALID_INPUT or BAD_REQUEST. For VALIDATION_ERROR, error.details is an array of { path, message }.
  • 401UNAUTHORIZED: missing, invalid, expired or revoked credential.
  • 402SWITCH_SUBSCRIPTION_REQUIRED: the account has no active Switch plan or trial.
  • 403FORBIDDEN: not allowed - a scoped key lacks the scope, or the endpoint is session-only.
  • 409CONFLICT (or a code-specific 409): the change clashes with existing state.
  • 429RATE_LIMITED: slow down and retry after the Retry-After seconds.
  • 500INTERNAL_ERROR: unexpected failure. Quote X-Request-Id to support.

Delete a saved call-record view

DELETE/api/v1/switch/cdr-views/{viewId}

Access
API key. Scoped keys need switch:manage.
Rate limit
100 requests per second (the default)

Answers { success: true } with no data, whether or not the view existed.

Test keys: refused with 403 TEST_KEY_NOT_ALLOWED. The Switch has no test mode, so a change always applies to your live configuration. Test keys can still read Switch data.

Parameters

NameInTypeDescription
viewIdrequiredpathstring-

Response 200

FieldTypeDescription
datarequiredany | enum | nullNot sent by this endpoint

Response 202

FieldTypeDescription
datarequiredobject-
approvalRequireddata.approvalRequiredboolean-One of true
approvalRequestIddata.approvalRequestIdstring (uuid) | null-
permissiondata.permissionstring-
expiresAtdata.expiresAtstring (date-time)-
messagedata.messagestring-

Errors

  • 400VALIDATION_ERROR, INVALID_INPUT or BAD_REQUEST. For VALIDATION_ERROR, error.details is an array of { path, message }.
  • 401UNAUTHORIZED: missing, invalid, expired or revoked credential.
  • 402SWITCH_SUBSCRIPTION_REQUIRED: the account has no active Switch plan or trial.
  • 403FORBIDDEN: not allowed - a scoped key lacks the scope, or the endpoint is session-only.
  • 404NOT_FOUND: no such resource on your account.
  • 409CONFLICT (or a code-specific 409): the change clashes with existing state.
  • 429RATE_LIMITED: slow down and retry after the Retry-After seconds.
  • 500INTERNAL_ERROR: unexpected failure. Quote X-Request-Id to support.

Get the SIP trace of a call

GET/api/v1/switch/cdrs/{id}/trace

Access
API key. Scoped keys need switch:manage.
Rate limit
100 requests per second (the default)

The signalling ladder for the call. Access is recorded in your account activity. A record that is not yours answers 404 NOT_FOUND.

Parameters

NameInTypeDescription
idrequiredpathstring-

Response 200

FieldTypeDescription
datarequiredobject-

Errors

  • 400VALIDATION_ERROR, INVALID_INPUT or BAD_REQUEST. For VALIDATION_ERROR, error.details is an array of { path, message }.
  • 401UNAUTHORIZED: missing, invalid, expired or revoked credential.
  • 402SWITCH_SUBSCRIPTION_REQUIRED: the account has no active Switch plan or trial.
  • 403FORBIDDEN: not allowed - a scoped key lacks the scope, or the endpoint is session-only.
  • 404NOT_FOUND: no such resource on your account.
  • 429RATE_LIMITED: slow down and retry after the Retry-After seconds.
  • 500INTERNAL_ERROR: unexpected failure. Quote X-Request-Id to support.

Re-run routing for a call record

POST/api/v1/switch/cdrs/{id}/retest

Access
API key. Scoped keys need switch:manage.
Rate limit
10 requests per minute

Resolves the route this call would take now, without placing a call, so a fix can be checked against the original failure.

Test keys: refused with 403 TEST_KEY_NOT_ALLOWED. The Switch has no test mode, so a change always applies to your live configuration. Test keys can still read Switch data.

Parameters

NameInTypeDescription
idrequiredpathstring-

Response 200

FieldTypeDescription
datarequiredobject-

Response 202

FieldTypeDescription
datarequiredobject-
approvalRequireddata.approvalRequiredboolean-One of true
approvalRequestIddata.approvalRequestIdstring (uuid) | null-
permissiondata.permissionstring-
expiresAtdata.expiresAtstring (date-time)-
messagedata.messagestring-

Errors

  • 400VALIDATION_ERROR, INVALID_INPUT or BAD_REQUEST. For VALIDATION_ERROR, error.details is an array of { path, message }.
  • 401UNAUTHORIZED: missing, invalid, expired or revoked credential.
  • 402SWITCH_SUBSCRIPTION_REQUIRED: the account has no active Switch plan or trial.
  • 403FORBIDDEN: not allowed - a scoped key lacks the scope, or the endpoint is session-only.
  • 404NOT_FOUND: no such resource on your account.
  • 409CONFLICT (or a code-specific 409): the change clashes with existing state.
  • 429RATE_LIMITED: slow down and retry after the Retry-After seconds.
  • 500INTERNAL_ERROR: unexpected failure. Quote X-Request-Id to support.

Download filtered call records as CSV

GET/api/v1/switch/cdrs.csv

Access
API key. Scoped keys need switch:manage.
Rate limit
100 requests per second (the default)

Synchronous export, capped at a row ceiling; X-PKX-Row-Count, X-PKX-Truncated and X-PKX-Query-Id headers describe the file. For large windows use POST /switch/cdr-exports. Numbers: a scoped API key without the cdr:numbers scope receives masked calling and dialled numbers (numbersMasked says so). Full-access keys and dashboard sessions see them in full.

Parameters

NameInTypeDescription
fromquerystringISO-8601 start of the window
toquerystringISO-8601 end of the window
kindquerystring-One of voice, sms
directionquerystring-One of inbound, outbound
statusquerystring-
subAccountIdquerystring (uuid)Customer
customerTrunkIdquerystring (uuid)-
vendorTrunkIdquerystring (uuid)Supplier trunk
supplierTrunkMatchquerystringHow vendorTrunkId matches failover attempts (default selected)One of selected, attempted, either
routeGroupIdquerystring (uuid)-
countryPrefixquerystring-
destinationquerystring-
destinationNamequerystring-
answeredOnlyquerystring-One of true, false
answeredStatequerystring-One of answered, unanswered
mediaModequerystring-One of direct, proxy
sipCodequeryinteger-
sipCodesquerystringComma-separated SIP codes (max 20)
q850Causequeryinteger-
q850CausesquerystringComma-separated Q.850 causes (max 20)
hangupCausequerystring-
durationMinquerynumber-
durationMaxquerynumber-
pddMinMsquerynumber-
pddMaxMsquerynumber-
codecquerystring-
releasePartyquerystring-
ipquerystring-
ratingStatequerystring-One of rated, unrated
negativeMarginOnlyquerystring-One of true, false
riskMinquerynumber-
attestationquerystring-One of A, B, C
searchquerystringUp to 20 values separated by comma, semicolon or newline
searchFieldquerystring-
searchMatchquerystring-One of any, all
sortByquerystring-
sortDirquerystring-One of asc, desc
includeProbesquerystringInclude the platform's synthetic reachability probes (hidden by default)One of true, false
limitqueryinteger-
offsetqueryinteger-

Response 200 (text/csv)

CSV of the filtered call records, as an attachment.

Errors

  • 400VALIDATION_ERROR, INVALID_INPUT or BAD_REQUEST. For VALIDATION_ERROR, error.details is an array of { path, message }.
  • 401UNAUTHORIZED: missing, invalid, expired or revoked credential.
  • 402SWITCH_SUBSCRIPTION_REQUIRED: the account has no active Switch plan or trial.
  • 403FORBIDDEN: not allowed - a scoped key lacks the scope, or the endpoint is session-only.
  • 429RATE_LIMITED: slow down and retry after the Retry-After seconds.
  • 500INTERNAL_ERROR: unexpected failure. Quote X-Request-Id to support.