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 |
|---|---|
limit | Page size, 1–200.Default: 50. |
cursor | next_cursor from the previous page. |
direction | Only calls in this direction. One of: inbound, outbound. |
endpoint_id | Only calls of this endpoint. |
outcome | answered: only answered calls; failed: only calls that weren't answered. One of: answered, failed. |
q | Text to find in the caller, callee or Call-ID (case-insensitive). |
since | Only calls invited at or after this time (ISO 8601; without an offset, UTC). |
until | 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"import os
import requests
response = requests.get(
"https://api.relaydock.io/api/v1/calls",
headers={"Authorization": f"Bearer {os.environ['RELAYDOCK_API_KEY']}"},
params={
"direction": "inbound",
"since": "2026-11-01T00:00:00Z",
"limit": 50,
},
timeout=30,
)
response.raise_for_status()
print(response.json())const response = await fetch('https://api.relaydock.io/api/v1/calls?direction=inbound&since=2026-11-01T00%3A00%3A00Z&limit=50', {
headers: {
'Authorization': `Bearer ${process.env.RELAYDOCK_API_KEY}`,
},
})
if (!response.ok)
throw new Error(`${response.status} ${await response.text()}`)
console.log(await response.json())Response
200 with a JSON object.
| Field | Description |
|---|---|
items | Calls on this page, newest first. |
items[].id | Call record ID. |
items[].call_id | SIP Call-ID; anon- and a hash once anonymized. |
items[].invited_at | When the INVITE arrived at RelayDock. |
items[].direction | inbound (carrier or PBX to your agent) or outbound (your agent calls out). |
items[].endpoint | The endpoint; null if not known. |
items[].endpoint.id | Endpoint ID. |
items[].endpoint.name | Endpoint name (also for deleted endpoints). |
items[].caller | Calling number or user, as sent in SIP; only the first 4 characters remain once anonymized. |
items[].callee | Called number or user, as sent in SIP; only the first 4 characters remain once anonymized. |
items[].mode | direct (audio flowed directly) or relay (through RelayDock). |
items[].duration_s | Talk time in seconds, from answer to end; 0 if not answered. |
items[].sip_code | Final SIP status of the call (200 when answered). |
items[].reason | Why 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[].answered | Whether the call was answered. |
items[].anonymized | true once the record was anonymized after the retention period (numbers masked, Call-ID hashed, media and source address removed).Default: false. |
next_cursor | Pass as cursor for the next page; null on the last page. |
{
"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_cursor | 400 | `cursor` isn't a `next_cursor` value from a previous page. |
validation_error | 422 | A 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_id | The call record's id. |
Example request
curl "https://api.relaydock.io/api/v1/calls/48213" \
-H "Authorization: Bearer $RELAYDOCK_API_KEY"import os
import requests
response = requests.get(
"https://api.relaydock.io/api/v1/calls/48213",
headers={"Authorization": f"Bearer {os.environ['RELAYDOCK_API_KEY']}"},
timeout=30,
)
response.raise_for_status()
print(response.json())const response = await fetch('https://api.relaydock.io/api/v1/calls/48213', {
headers: {
'Authorization': `Bearer ${process.env.RELAYDOCK_API_KEY}`,
},
})
if (!response.ok)
throw new Error(`${response.status} ${await response.text()}`)
console.log(await response.json())Response
200 with a JSON object.
| Field | Description |
|---|---|
id | Call record ID. |
call_id | SIP Call-ID; anon- and a hash once anonymized. |
invited_at | When the INVITE arrived at RelayDock. |
direction | inbound (carrier or PBX to your agent) or outbound (your agent calls out). |
endpoint | The endpoint; null if not known. |
endpoint.id | Endpoint ID. |
endpoint.name | Endpoint name (also for deleted endpoints). |
caller | Calling number or user, as sent in SIP; only the first 4 characters remain once anonymized. |
callee | Called number or user, as sent in SIP; only the first 4 characters remain once anonymized. |
mode | direct (audio flowed directly) or relay (through RelayDock). |
duration_s | Talk time in seconds, from answer to end; 0 if not answered. |
sip_code | Final SIP status of the call (200 when answered). |
reason | Why 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. |
answered | Whether the call was answered. |
anonymized | true once the record was anonymized after the retention period (numbers masked, Call-ID hashed, media and source address removed).Default: false. |
relay_reason | Why audio was relayed: auto (the other side was behind NAT), always (relay_always mode); empty for direct calls. |
sdp_c | Media address the other side offered (SDP c= line); empty once anonymized. |
answered_at | When the call was answered; null if not. |
ended_at | When the call ended or was rejected. |
edge_node | Name of the RelayDock edge node that carried the call. |
test_call_id | The test call that placed this call, if any (see GET /test-calls/{test_call_id}). |
transfer_code | Final SIP status of the last transfer (REFER) on the call; null if there was none. |
timeline | The call's steps, in order. |
timeline[].at | When the step happened. |
timeline[].key | The 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[].detail | Values of the step: caller, callee (invite); mode, relay_reason (answered); code (transfer); sip_code, reason, duration_s (ended or failed). |
source_ip | Address 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. |
{
"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_found | 404 | No call record with this `id` exists in your team. |
validation_error | 422 | A 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 |
|---|---|
from | Start of the range, inclusive (ISO 8601; without an offset, UTC). Default: 30 days before to. |
to | 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.csvimport os
import requests
response = requests.get(
"https://api.relaydock.io/api/v1/calls/export",
headers={"Authorization": f"Bearer {os.environ['RELAYDOCK_API_KEY']}"},
params={
"from": "2026-11-01T00:00:00Z",
"to": "2026-11-16T00:00:00Z",
},
timeout=30,
)
response.raise_for_status()
with open("calls.csv", "w", encoding="utf-8") as file:
file.write(response.text)import { writeFile } from 'node:fs/promises'
const response = await fetch('https://api.relaydock.io/api/v1/calls/export?from=2026-11-01T00%3A00%3A00Z&to=2026-11-16T00%3A00%3A00Z', {
headers: {
'Authorization': `Bearer ${process.env.RELAYDOCK_API_KEY}`,
},
})
if (!response.ok)
throw new Error(`${response.status} ${await response.text()}`)
await writeFile('calls.csv', await response.text())Response
200 with a CSV file.
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_range | 400 | `from` is not earlier than `to`. |
calls.range_too_wide | 400 | `from` and `to` are more than 31 days apart. |
validation_error | 422 | A parameter or body field doesn't match the schema; `fields` maps each one to `validation.<type>`. |
rate_limited | 429 | More than 10 exports in the current one-hour window for your team (`Retry-After`: 3600). |