Docs API reference

Calls

Call records written by the edge: list and filter them, read one call with its timeline, and export a date range as CSV.

Examples read your API key from RELAYDOCK_API_KEY (see Authentication). Paths are relative to https://api.relaydock.io/api/v1. For the concepts behind these operations, read Troubleshooting.

List calls

GET/calls

Returns your team's call records, newest first (by invited_at), limit per page. To get the next page, pass next_cursor as cursor with the same filters; next_cursor is null on the last page. Filters combine; calls placed by test calls are included.

Query parameters

Field Description
limitintegerPage size, 1–200.Default: 50.
cursorstringnext_cursor from the previous page.
directionstringOnly calls in this direction. One of: inbound, outbound.
endpoint_idstring (uuid)Only calls of this endpoint.
outcomestringanswered: only answered calls; failed: only calls that weren't answered. One of: answered, failed.
qstringText to find in the caller, callee or Call-ID (case-insensitive).
sincestring (date-time)Only calls invited at or after this time (ISO 8601; without an offset, UTC).
untilstring (date-time)Only calls invited before this time (ISO 8601; without an offset, UTC).

Example request

curl "https://api.relaydock.io/api/v1/calls?direction=inbound&since=2026-11-01T00%3A00%3A00Z&limit=50" \
  -H "Authorization: Bearer $RELAYDOCK_API_KEY"

Response

200 with a JSON object.

Field Description
itemsarray of objectsCalls on this page, newest first.
items[].idintegerCall record ID.
items[].call_idstringSIP Call-ID; anon- and a hash once anonymized.
items[].invited_atstring (date-time)When the INVITE arrived at RelayDock.
items[].directionstringinbound (carrier or PBX to your agent) or outbound (your agent calls out).
items[].endpointobjectcan be nullThe endpoint; null if not known.
items[].endpoint.idstring (uuid)Endpoint ID.
items[].endpoint.namestringEndpoint name (also for deleted endpoints).
items[].callerstringCalling number or user, as sent in SIP; only the first 4 characters remain once anonymized.
items[].calleestringCalled number or user, as sent in SIP; only the first 4 characters remain once anonymized.
items[].modestringdirect (audio flowed directly) or relay (through RelayDock).
items[].duration_sintegerTalk time in seconds, from answer to end; 0 if not answered.
items[].sip_codeintegerFinal SIP status of the call (200 when answered).
items[].reasonstringWhy RelayDock rejected the call, e.g. source-not-allowed, digest-mismatch, no-registration, plan-limit or daily-cap; or timeout for an answered call that ended without a BYE (billed for at most 15 minutes). Empty otherwise: the other side's answer is in sip_code.
items[].answeredbooleanWhether the call was answered.
items[].anonymizedbooleantrue once the record was anonymized after the retention period (numbers masked, Call-ID hashed, media and source address removed).Default: false.
next_cursorstringcan be nullPass as cursor for the next page; null on the last page.
json
{
  "items": [
    {
      "id": 48213,
      "call_id": "[email protected]",
      "invited_at": "2026-03-14T09:26:53Z",
      "direction": "inbound",
      "endpoint": {
        "id": "3f6c2a1e-8b4d-4c7a-9e21-5d0b7f9a6c13",
        "name": "Telnyx · +12025550123"
      },
      "caller": "+12025550188",
      "callee": "+12025550123",
      "mode": "direct",
      "duration_s": 105,
      "sip_code": 200,
      "reason": "",
      "answered": true,
      "anonymized": false
    }
  ],
  "next_cursor": "MjAyNi0wMy0xNFQwOToyNjo1MyswMDowMHw0ODIxMw"
}

Errors

Besides the errors any request can return:

Code Status When
calls.invalid_cursor400`cursor` isn't a `next_cursor` value from a previous page.
validation_error422A parameter or body field doesn't match the schema; `fields` maps each one to `validation.<type>`.

Get a call

GET/calls/{call_id}

Returns one call record with its timeline: invite, answer, transfer and end, with the final SIP status and RelayDock's reason if it rejected the call.

Path parameters

Field Description
call_idintegerrequiredThe call record's id.

Example request

curl "https://api.relaydock.io/api/v1/calls/48213" \
  -H "Authorization: Bearer $RELAYDOCK_API_KEY"

Response

200 with a JSON object.

Field Description
idintegerCall record ID.
call_idstringSIP Call-ID; anon- and a hash once anonymized.
invited_atstring (date-time)When the INVITE arrived at RelayDock.
directionstringinbound (carrier or PBX to your agent) or outbound (your agent calls out).
endpointobjectcan be nullThe endpoint; null if not known.
endpoint.idstring (uuid)Endpoint ID.
endpoint.namestringEndpoint name (also for deleted endpoints).
callerstringCalling number or user, as sent in SIP; only the first 4 characters remain once anonymized.
calleestringCalled number or user, as sent in SIP; only the first 4 characters remain once anonymized.
modestringdirect (audio flowed directly) or relay (through RelayDock).
duration_sintegerTalk time in seconds, from answer to end; 0 if not answered.
sip_codeintegerFinal SIP status of the call (200 when answered).
reasonstringWhy RelayDock rejected the call, e.g. source-not-allowed, digest-mismatch, no-registration, plan-limit or daily-cap; or timeout for an answered call that ended without a BYE (billed for at most 15 minutes). Empty otherwise: the other side's answer is in sip_code.
answeredbooleanWhether the call was answered.
anonymizedbooleantrue once the record was anonymized after the retention period (numbers masked, Call-ID hashed, media and source address removed).Default: false.
relay_reasonstringWhy audio was relayed: auto (the other side was behind NAT), always (relay_always mode); empty for direct calls.
sdp_cstringMedia address the other side offered (SDP c= line); empty once anonymized.
answered_atstring (date-time)can be nullWhen the call was answered; null if not.
ended_atstring (date-time)When the call ended or was rejected.
edge_nodestringcan be nullName of the RelayDock edge node that carried the call.
test_call_idstring (uuid)can be nullThe test call that placed this call, if any (see GET /test-calls/{test_call_id}).
transfer_codeintegercan be nullFinal SIP status of the last transfer (REFER) on the call; null if there was none.
timelinearray of objectsThe call's steps, in order.
timeline[].atstring (date-time)When the step happened.
timeline[].keystringThe step: call.invite_in, call.invite_out, call.answered, call.transferred, call.transfer_failed, call.ended, call.failed. The first is call.invite_in or call.invite_out; the last is call.ended (answered) or call.failed.
timeline[].detailobjectValues of the step: caller, callee (invite); mode, relay_reason (answered); code (transfer); sip_code, reason, duration_s (ended or failed).
source_ipstringcan be nullAddress the call came from; null if unknown or once anonymized. For a call rejected with source-not-allowed, add it to the endpoint's allowed IPs if it's your carrier.
json
{
  "id": 48213,
  "call_id": "[email protected]",
  "invited_at": "2026-03-14T09:26:53Z",
  "direction": "inbound",
  "endpoint": {
    "id": "3f6c2a1e-8b4d-4c7a-9e21-5d0b7f9a6c13",
    "name": "Telnyx · +12025550123"
  },
  "caller": "+12025550188",
  "callee": "+12025550123",
  "mode": "direct",
  "duration_s": 105,
  "sip_code": 200,
  "reason": "",
  "answered": true,
  "anonymized": false,
  "relay_reason": "",
  "sdp_c": "198.51.100.20",
  "answered_at": "2026-03-14T09:26:56Z",
  "ended_at": "2026-03-14T09:28:41Z",
  "edge_node": "edge-nbg-1",
  "test_call_id": null,
  "transfer_code": null,
  "timeline": [
    {
      "at": "2026-03-14T09:26:53Z",
      "key": "call.invite_in",
      "detail": {
        "callee": "+12025550123",
        "caller": "+12025550188"
      }
    }
  ],
  "source_ip": "198.51.100.20"
}

Errors

Besides the errors any request can return:

Code Status When
call.not_found404No call record with this `id` exists in your team.
validation_error422A parameter or body field doesn't match the schema; `fields` maps each one to `validation.<type>`.

Export calls as CSV

GET/calls/export

Downloads your team's call records invited in [from, to) as CSV, oldest first: by default the last 30 days, at most 31 days per request. Columns: id, call_id, invited_at, answered_at, ended_at, direction, mode, caller, callee, duration_s, sip_code, reason, anonymized. It stays available while your team is scheduled for deletion. Limited to 10 exports per hour per team.

Query parameters

Field Description
fromstring (date-time)Start of the range, inclusive (ISO 8601; without an offset, UTC). Default: 30 days before to.
tostring (date-time)End of the range, exclusive (ISO 8601; without an offset, UTC). Default: now.

Example request

curl "https://api.relaydock.io/api/v1/calls/export?from=2026-11-01T00%3A00%3A00Z&to=2026-11-16T00%3A00%3A00Z" \
  -H "Authorization: Bearer $RELAYDOCK_API_KEY" \
  -o calls.csv

Response

200 with a CSV file.

csv
id,call_id,invited_at,answered_at,ended_at,direction,mode,caller,callee,duration_s,sip_code,reason,anonymized
48213,[email protected],2026-03-14T09:26:53+00:00,2026-03-14T09:26:56+00:00,2026-03-14T09:28:41+00:00,inbound,direct,+12025550188,+12025550123,105,200,,false

Errors

Besides the errors any request can return:

Code Status When
calls.invalid_range400`from` is not earlier than `to`.
calls.range_too_wide400`from` and `to` are more than 31 days apart.
validation_error422A parameter or body field doesn't match the schema; `fields` maps each one to `validation.<type>`.
rate_limited429More than 10 exports in the current one-hour window for your team (`Retry-After`: 3600).