Docs API reference
Test calls
Place an outbound test call through an endpoint, listen for an inbound call, and read the result step by step.
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 Test calls and inbound checks.
- POST/endpoints/{endpoint_id}/test-callsStart a test call
- POST/endpoints/{endpoint_id}/inbound-checksStart an inbound check
- GET/test-calls/{test_call_id}Get a test call
Start a test call
POST/endpoints/{endpoint_id}/test-calls
LiveKit calls to through the endpoint's outbound trunk from caller, and the endpoint's agent joins the call; it rings for up to 30 seconds and lasts at most 2 minutes. Returns 202 in queued: poll GET /test-calls/{test_call_id} until state is completed or failed; steps show how far the call got. Test calls don't count as usage, but your carrier and LiveKit may charge for them. Limited to 5 per 10 minutes and 100 per 24 hours per team, shared by test calls and inbound checks.
Path parameters
| Field | Description |
|---|---|
endpoint_id | The endpoint's id (UUID), as returned by GET /endpoints. |
Request body
| Field | Description |
|---|---|
to | Number to call: +E.164, or an extension on registration endpoints. Spaces, dashes and parentheses are ignored; a leading 00 is read as +.1–32 characters. |
caller | Caller number: one of the endpoint's outbound_numbers. Default: the first one.Up to 32 characters. |
Example request
curl -X POST "https://api.relaydock.io/api/v1/endpoints/3f6c2a1e-8b4d-4c7a-9e21-5d0b7f9a6c13/test-calls" \
-H "Authorization: Bearer $RELAYDOCK_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"to": "+12025550147"
}'import os
import requests
response = requests.post(
"https://api.relaydock.io/api/v1/endpoints/3f6c2a1e-8b4d-4c7a-9e21-5d0b7f9a6c13/test-calls",
headers={"Authorization": f"Bearer {os.environ['RELAYDOCK_API_KEY']}"},
json={"to": "+12025550147"},
timeout=30,
)
response.raise_for_status()
print(response.json())const response = await fetch('https://api.relaydock.io/api/v1/endpoints/3f6c2a1e-8b4d-4c7a-9e21-5d0b7f9a6c13/test-calls', {
method: 'POST',
headers: {
'Authorization': `Bearer ${process.env.RELAYDOCK_API_KEY}`,
'Content-Type': 'application/json',
},
body: JSON.stringify({
"to": "+12025550147"
}),
})
if (!response.ok)
throw new Error(`${response.status} ${await response.text()}`)
console.log(await response.json())curl -X POST "https://api.relaydock.io/api/v1/endpoints/3f6c2a1e-8b4d-4c7a-9e21-5d0b7f9a6c13/test-calls" \
-H "Authorization: Bearer $RELAYDOCK_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"to": "+12025550147",
"caller": "+12025550123"
}'import os
import requests
response = requests.post(
"https://api.relaydock.io/api/v1/endpoints/3f6c2a1e-8b4d-4c7a-9e21-5d0b7f9a6c13/test-calls",
headers={"Authorization": f"Bearer {os.environ['RELAYDOCK_API_KEY']}"},
json={"to": "+12025550147", "caller": "+12025550123"},
timeout=30,
)
response.raise_for_status()
print(response.json())const response = await fetch('https://api.relaydock.io/api/v1/endpoints/3f6c2a1e-8b4d-4c7a-9e21-5d0b7f9a6c13/test-calls', {
method: 'POST',
headers: {
'Authorization': `Bearer ${process.env.RELAYDOCK_API_KEY}`,
'Content-Type': 'application/json',
},
body: JSON.stringify({
"to": "+12025550147",
"caller": "+12025550123"
}),
})
if (!response.ok)
throw new Error(`${response.status} ${await response.text()}`)
console.log(await response.json())Response
202 with a JSON object.
| Field | Description |
|---|---|
id | Test call ID. |
endpoint_id | The endpoint tested. |
callee | Test call: the number called. Inbound check: the endpoint's first number (empty if it has none). |
caller | Test call: the caller number. Inbound check: empty. |
state | Test call: queued, dialing, answered (waiting for RelayDock's call record), then completed or failed. Inbound check: waiting, then completed or failed. completed and failed are final. |
steps | The steps, in order. |
steps[].key | Test call steps: livekit.dial, edge.auth, carrier.answer, call.end. Inbound check steps: carrier.invite, edge.auth, livekit.answer, call.end. edge.auth is RelayDock's own check of the call. |
steps[].status | pending (not reached yet), ok, bad or skipped (an earlier step failed). One of: pending, ok, bad, skipped. |
steps[].code | SIP status of the step, if any. |
steps[].detail | On bad: RelayDock's reason (e.g. source-not-allowed), LiveKit's error or the other side's reason. On a successful call.end: the talk time in seconds. |
steps[].at | When the step finished; null while pending. |
steps[].extra | Inbound checks only: source_ip of a call RelayDock rejected, and dialed when the carrier called a number that isn't on the endpoint. |
result_code | Final SIP status; null until known. |
error | Why it failed: RelayDock's reason (e.g. source-not-allowed, unknown-number), a LiveKit error code (e.g. livekit.unreachable), test_call.endpoint_not_ready, or inbound.no_call (no call arrived in time); null otherwise. |
created_at | When it was started. |
updated_at | Last change. |
direction | outbound (test call) or inbound (inbound check).Default: outbound. |
expires_at | Inbound check: end of the listening window. Test call: null. |
numbers | Inbound check: the endpoint's numbers to call. Test call: empty.Default: []. |
{
"id": "9d2e6f41-3c8b-4a7e-b5d0-1e6f2a9c7b38",
"endpoint_id": "3f6c2a1e-8b4d-4c7a-9e21-5d0b7f9a6c13",
"callee": "+12025550147",
"caller": "+12025550123",
"state": "completed",
"steps": [
{
"key": "edge.auth",
"status": "pending",
"code": null,
"detail": null,
"at": "2026-03-14T09:26:53Z",
"extra": null
}
],
"result_code": 200,
"error": null,
"created_at": "2026-03-14T11:02:07Z",
"updated_at": "2026-03-14T11:02:31Z",
"direction": "outbound",
"expires_at": null,
"numbers": []
}Errors
Besides the errors any request can return:
| Code | Status | When |
|---|---|---|
endpoint.not_found | 404 | No endpoint with this `id` exists in your team, or it was deleted. |
test_call.endpoint_not_ready | 409 | The endpoint must be enabled, set up in LiveKit (`provision_state` `ready`, with an outbound trunk) and have an outbound number, and your LiveKit project must be connected. |
validation_error | 422 | A parameter or body field doesn't match the schema; `fields` maps each one to `validation.<type>`. |
test_call.invalid_number | 422 | `to` isn't +E.164 (registration endpoints also accept a 2–15 digit extension). |
test_call.invalid_caller | 422 | `caller` isn't in the endpoint's `outbound_numbers`. |
rate_limited | 429 | Your team opened 100 test calls and inbound checks in the last 24 hours. `Retry-After` is the time until the oldest one leaves the window. |
rate_limited | 429 | Your team opened 5 test calls and inbound checks in the current 10-minute window (`Retry-After`: 600). |
Start an inbound check
POST/endpoints/{endpoint_id}/inbound-checks
Listens for one real incoming call on the endpoint until expires_at: call one of numbers from any phone (on a registration endpoint, the number your carrier routes to it). Returns 202 in waiting: poll GET /test-calls/{test_call_id} until completed (LiveKit answered the call) or failed (error says why, e.g. inbound.no_call when nothing arrived). The call counts toward usage like any other. Limited to 5 per 10 minutes and 100 per 24 hours per team, shared by test calls and inbound checks.
Path parameters
| Field | Description |
|---|---|
endpoint_id | The endpoint's id (UUID), as returned by GET /endpoints. |
Example request
curl -X POST "https://api.relaydock.io/api/v1/endpoints/3f6c2a1e-8b4d-4c7a-9e21-5d0b7f9a6c13/inbound-checks" \
-H "Authorization: Bearer $RELAYDOCK_API_KEY"import os
import requests
response = requests.post(
"https://api.relaydock.io/api/v1/endpoints/3f6c2a1e-8b4d-4c7a-9e21-5d0b7f9a6c13/inbound-checks",
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/endpoints/3f6c2a1e-8b4d-4c7a-9e21-5d0b7f9a6c13/inbound-checks', {
method: 'POST',
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
202 with a JSON object.
| Field | Description |
|---|---|
id | Test call ID. |
endpoint_id | The endpoint tested. |
callee | Test call: the number called. Inbound check: the endpoint's first number (empty if it has none). |
caller | Test call: the caller number. Inbound check: empty. |
state | Test call: queued, dialing, answered (waiting for RelayDock's call record), then completed or failed. Inbound check: waiting, then completed or failed. completed and failed are final. |
steps | The steps, in order. |
steps[].key | Test call steps: livekit.dial, edge.auth, carrier.answer, call.end. Inbound check steps: carrier.invite, edge.auth, livekit.answer, call.end. edge.auth is RelayDock's own check of the call. |
steps[].status | pending (not reached yet), ok, bad or skipped (an earlier step failed). One of: pending, ok, bad, skipped. |
steps[].code | SIP status of the step, if any. |
steps[].detail | On bad: RelayDock's reason (e.g. source-not-allowed), LiveKit's error or the other side's reason. On a successful call.end: the talk time in seconds. |
steps[].at | When the step finished; null while pending. |
steps[].extra | Inbound checks only: source_ip of a call RelayDock rejected, and dialed when the carrier called a number that isn't on the endpoint. |
result_code | Final SIP status; null until known. |
error | Why it failed: RelayDock's reason (e.g. source-not-allowed, unknown-number), a LiveKit error code (e.g. livekit.unreachable), test_call.endpoint_not_ready, or inbound.no_call (no call arrived in time); null otherwise. |
created_at | When it was started. |
updated_at | Last change. |
direction | outbound (test call) or inbound (inbound check).Default: outbound. |
expires_at | Inbound check: end of the listening window. Test call: null. |
numbers | Inbound check: the endpoint's numbers to call. Test call: empty.Default: []. |
{
"id": "9d2e6f41-3c8b-4a7e-b5d0-1e6f2a9c7b38",
"endpoint_id": "3f6c2a1e-8b4d-4c7a-9e21-5d0b7f9a6c13",
"callee": "+12025550147",
"caller": "+12025550123",
"state": "completed",
"steps": [
{
"key": "edge.auth",
"status": "pending",
"code": null,
"detail": null,
"at": "2026-03-14T09:26:53Z",
"extra": null
}
],
"result_code": 200,
"error": null,
"created_at": "2026-03-14T11:02:07Z",
"updated_at": "2026-03-14T11:02:31Z",
"direction": "outbound",
"expires_at": null,
"numbers": []
}Errors
Besides the errors any request can return:
| Code | Status | When |
|---|---|---|
endpoint.not_found | 404 | No endpoint with this `id` exists in your team, or it was deleted. |
inbound_check.disabled | 409 | The endpoint is disabled. |
inbound_check.no_number | 409 | The endpoint is a trunk without numbers. |
inbound_check.pending | 409 | Another inbound check on this endpoint hasn't expired yet. |
validation_error | 422 | A parameter or body field doesn't match the schema; `fields` maps each one to `validation.<type>`. |
rate_limited | 429 | Your team opened 100 test calls and inbound checks in the last 24 hours. `Retry-After` is the time until the oldest one leaves the window. |
rate_limited | 429 | Your team opened 5 test calls and inbound checks in the current 10-minute window (`Retry-After`: 600). |
Get a test call
GET/test-calls/{test_call_id}
Returns a test call or inbound check with its steps. Poll every few seconds until state is completed or failed. Test calls and inbound checks are kept for 90 days.
Path parameters
| Field | Description |
|---|---|
test_call_id | The test call's or inbound check's id. |
Example request
curl "https://api.relaydock.io/api/v1/test-calls/9d2e6f41-3c8b-4a7e-b5d0-1e6f2a9c7b38" \
-H "Authorization: Bearer $RELAYDOCK_API_KEY"import os
import requests
response = requests.get(
"https://api.relaydock.io/api/v1/test-calls/9d2e6f41-3c8b-4a7e-b5d0-1e6f2a9c7b38",
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/test-calls/9d2e6f41-3c8b-4a7e-b5d0-1e6f2a9c7b38', {
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 | Test call ID. |
endpoint_id | The endpoint tested. |
callee | Test call: the number called. Inbound check: the endpoint's first number (empty if it has none). |
caller | Test call: the caller number. Inbound check: empty. |
state | Test call: queued, dialing, answered (waiting for RelayDock's call record), then completed or failed. Inbound check: waiting, then completed or failed. completed and failed are final. |
steps | The steps, in order. |
steps[].key | Test call steps: livekit.dial, edge.auth, carrier.answer, call.end. Inbound check steps: carrier.invite, edge.auth, livekit.answer, call.end. edge.auth is RelayDock's own check of the call. |
steps[].status | pending (not reached yet), ok, bad or skipped (an earlier step failed). One of: pending, ok, bad, skipped. |
steps[].code | SIP status of the step, if any. |
steps[].detail | On bad: RelayDock's reason (e.g. source-not-allowed), LiveKit's error or the other side's reason. On a successful call.end: the talk time in seconds. |
steps[].at | When the step finished; null while pending. |
steps[].extra | Inbound checks only: source_ip of a call RelayDock rejected, and dialed when the carrier called a number that isn't on the endpoint. |
result_code | Final SIP status; null until known. |
error | Why it failed: RelayDock's reason (e.g. source-not-allowed, unknown-number), a LiveKit error code (e.g. livekit.unreachable), test_call.endpoint_not_ready, or inbound.no_call (no call arrived in time); null otherwise. |
created_at | When it was started. |
updated_at | Last change. |
direction | outbound (test call) or inbound (inbound check).Default: outbound. |
expires_at | Inbound check: end of the listening window. Test call: null. |
numbers | Inbound check: the endpoint's numbers to call. Test call: empty.Default: []. |
{
"id": "9d2e6f41-3c8b-4a7e-b5d0-1e6f2a9c7b38",
"endpoint_id": "3f6c2a1e-8b4d-4c7a-9e21-5d0b7f9a6c13",
"callee": "+12025550147",
"caller": "+12025550123",
"state": "completed",
"steps": [
{
"key": "edge.auth",
"status": "pending",
"code": null,
"detail": null,
"at": "2026-03-14T09:26:53Z",
"extra": null
}
],
"result_code": 200,
"error": null,
"created_at": "2026-03-14T11:02:07Z",
"updated_at": "2026-03-14T11:02:31Z",
"direction": "outbound",
"expires_at": null,
"numbers": []
}Errors
Besides the errors any request can return:
| Code | Status | When |
|---|---|---|
test_call.not_found | 404 | No test call or inbound check 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>`. |