Docs API

Errors

Every error is JSON with a stable code that your code can branch on, and a readable message for people.

The error body

json
{"code": "endpoint.not_found", "message": "Endpoint not found"}
  • code is stable: compare it, not the message. Codes have the form <area>.<error>.
  • message is English text for logs and people.
  • Every response has an X-Request-ID header. Include it when you write to support; a 500 response also has it as request_id in the body.

Validation errors

A request that doesn't match the schema returns 422 validation_error. fields maps each field path to the kind of problem, validation. followed by the validator's type:

json
{
  "code": "validation_error",
  "message": "Request validation failed",
  "fields": {
    "registration.username": "validation.missing",
    "registration.expires": "validation.less_than_equal"
  }
}

Checks that need RelayDock's rules return their own code with the same fields map, for example a number that isn't +E.164:

json
{
  "code": "number.invalid",
  "message": "Numbers must be written as +E.164, e.g. +4930123456",
  "fields": {"trunk.numbers.0": "number.invalid"}
}

Errors any request can return

Code Status When
auth.required401No Authorization: Bearer header.
auth.invalid_api_key401The key is unknown or revoked.
tenant.invalid_header400X-RelayDock-Tenant isn't a team ID.
tenant.forbidden403X-RelayDock-Tenant names a team other than the key's.
tenant.suspended403A change (POST, PATCH, DELETE) on a suspended team. Reading still works.
tenant.deleting403A change on a team whose deletion is scheduled. Reading and exporting still work.
validation_error422The request doesn't match the schema; see above.
rate_limited429Too many requests. Wait the number of seconds in the Retry-After header.
not_found404The path doesn't exist.
method_not_allowed405The path exists but not with this method.
internal_error500Something failed on RelayDock's side. Retry later and send the request_id to support if it repeats.

Errors of each operation

The reference lists these with each operation too.

Get the LiveKit projectGET /target

Code Status When
target.not_found404Your team hasn't connected a LiveKit project yet.

Verify the LiveKit projectPOST /target/verify

Code Status When
target.not_found404Your team hasn't connected a LiveKit project yet.
rate_limited429More than 6 requests in the current one-minute window for your team (`Retry-After`: 60).

Resync LiveKit objectsPOST /target/resync

Code Status When
target.not_found404Your team hasn't connected a LiveKit project yet.
rate_limited429More than 6 requests in the current one-minute window for your team (`Retry-After`: 60).

List endpointsGET /endpoints

Code Status When
validation_error422A parameter or body field doesn't match the schema; `fields` maps each one to `validation.<type>`.

Add an endpointPOST /endpoints

Code Status When
endpoint.plan_limit409Your plan's endpoint limit is reached (the message names your plan and its limit).
number.taken409A number is already on another endpoint, in any team. Numbers are compared in every format carriers send.
endpoint.digest_username_taken409`trunk.digest_username` is already used by another trunk, in any team.
validation_error422A parameter or body field doesn't match the schema; `fields` maps each one to `validation.<type>`.
endpoint.invalid_provider422`provider` isn't a template `code` from `GET /provider-templates`.
endpoint.invalid_agent_name422`agent_name` doesn't start with a letter or digit, or has characters other than letters, digits, `.`, `_` and `-`.
endpoint.registration_required422`kind` is `registration` but `registration` is missing.
endpoint.trunk_required422`kind` is `trunk` but `trunk` is missing.
endpoint.registrar_required422`registration.registrar_host` is empty and the provider template has no registrar.
endpoint.invalid_host422A registrar, SIP domain or outbound host isn't a host name or IPv4 address (registrar and outbound hosts also can't be private, loopback or reserved addresses).
endpoint.invalid_username422A SIP user name has spaces, non-ASCII characters or one of `< > " @ : ; ?`.
endpoint.password_required422`trunk.digest_username` is set but `trunk.digest_password` is missing.
number.invalid422`registration.number` or an entry in `trunk.numbers` isn't a +E.164 number.
endpoint.invalid_cidr422An entry in `source_ips` isn't an IP address or CIDR block, or is a private, loopback or reserved block.
endpoint.cidr_too_broad422An entry in `source_ips` is wider than /16 (IPv4) or /32 (IPv6).
endpoint.source_ips_required422`registration.source_ips` is empty or `null`, and neither the template nor the registrar's DNS gave an address.
endpoint.invalid_outbound_number422An entry in `outbound_numbers` isn't +E.164. Registration endpoints also accept a 2–15 digit extension; the message then mentions it.
endpoint.digest_incomplete422`trunk.digest_password` is set without `trunk.digest_username`.
endpoint.trunk_auth_required422A trunk needs `trunk.source_ips`, a `trunk.digest_username`, or both.
endpoint.outbound_auth_required422`trunk.outbound.auth_type` is `digest` but the user name (or, with the message "Digest password is required", the password) is missing.

Get an endpointGET /endpoints/{endpoint_id}

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

Update an endpointPATCH /endpoints/{endpoint_id}

Code Status When
endpoint.not_found404No endpoint with this `id` exists in your team, or it was deleted.
number.taken409A number is already on another endpoint, in any team. Numbers are compared in every format carriers send.
endpoint.digest_username_taken409`trunk.digest_username` is already used by another trunk, in any team.
validation_error422A parameter or body field doesn't match the schema; `fields` maps each one to `validation.<type>`.
endpoint.invalid_provider422`provider` isn't a template `code` from `GET /provider-templates`.
endpoint.invalid_agent_name422`agent_name` doesn't start with a letter or digit, or has characters other than letters, digits, `.`, `_` and `-`.
endpoint.registrar_required422`registration.registrar_host` is empty and the provider template has no registrar.
endpoint.invalid_host422A registrar, SIP domain or outbound host isn't a host name or IPv4 address (registrar and outbound hosts also can't be private, loopback or reserved addresses).
endpoint.invalid_username422A SIP user name has spaces, non-ASCII characters or one of `< > " @ : ; ?`.
endpoint.password_required422A new `trunk.digest_username` was sent without `trunk.digest_password`, and no password is stored.
number.invalid422`registration.number` or an entry in `trunk.numbers` isn't a +E.164 number.
endpoint.invalid_cidr422An entry in `source_ips` isn't an IP address or CIDR block, or is a private, loopback or reserved block.
endpoint.cidr_too_broad422An entry in `source_ips` is wider than /16 (IPv4) or /32 (IPv6).
endpoint.source_ips_required422`registration.source_ips` is empty or `null`, and neither the template nor the registrar's DNS gave an address.
endpoint.invalid_outbound_number422An entry in `outbound_numbers` isn't +E.164. Registration endpoints also accept a 2–15 digit extension; the message then mentions it.
endpoint.digest_incomplete422`trunk.digest_password` is set without `trunk.digest_username`.
endpoint.trunk_auth_required422A trunk needs `trunk.source_ips`, a `trunk.digest_username`, or both.
endpoint.outbound_auth_required422`trunk.outbound.auth_type` is `digest` but the user name (or, with the message "Digest password is required", the password, when none is stored) is missing.
rate_limited429More than 30 updates in the current one-minute window for your team (`Retry-After`: 60).

Delete an endpointDELETE /endpoints/{endpoint_id}

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

Get an ElevenLabs endpoint's SIP passwordPOST /endpoints/{endpoint_id}/platform-password

Code Status When
endpoint.not_found404No endpoint with this `id` exists in your team, or it was deleted.
endpoint.no_platform_password409The endpoint is a LiveKit endpoint; only ElevenLabs endpoints have a SIP password to enter on the platform.
validation_error422A parameter or body field doesn't match the schema; `fields` maps each one to `validation.<type>`.
rate_limited429More than 20 requests in the current one-minute window for your team (`Retry-After`: 60).

Retry a registrationPOST /endpoints/{endpoint_id}/retry-registration

Code Status When
endpoint.not_found404No endpoint with this `id` exists in your team, or it was deleted.
endpoint.not_registration409The endpoint is a trunk.
validation_error422A parameter or body field doesn't match the schema; `fields` maps each one to `validation.<type>`.
rate_limited429More than 6 retries in the current one-minute window for your team (`Retry-After`: 60).

List eventsGET /events

Code Status When
validation_error422A parameter or body field doesn't match the schema; `fields` maps each one to `validation.<type>`.

List an endpoint's eventsGET /endpoints/{endpoint_id}/events

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

Get registration historyGET /endpoints/{endpoint_id}/registration-history

Code Status When
endpoint.not_found404No endpoint with this `id` exists in your team, or it was deleted.
endpoint.not_registration409The endpoint is a trunk.
validation_error422A parameter or body field doesn't match the schema; `fields` maps each one to `validation.<type>`.

List callsGET /calls

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>`.

Export calls as CSVGET /calls/export

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).

Get a callGET /calls/{call_id}

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>`.

Get the usage overviewGET /usage/overview

Code Status When
validation_error422A parameter or body field doesn't match the schema; `fields` maps each one to `validation.<type>`.

Get monthly usageGET /usage/monthly

Code Status When
validation_error422A parameter or body field doesn't match the schema; `fields` maps each one to `validation.<type>`.

Start a test callPOST /endpoints/{endpoint_id}/test-calls

Code Status When
endpoint.not_found404No endpoint with this `id` exists in your team, or it was deleted.
test_call.endpoint_not_ready409The 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_error422A parameter or body field doesn't match the schema; `fields` maps each one to `validation.<type>`.
test_call.invalid_number422`to` isn't +E.164 (registration endpoints also accept a 2–15 digit extension).
test_call.invalid_caller422`caller` isn't in the endpoint's `outbound_numbers`.
rate_limited429Your 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_limited429Your team opened 5 test calls and inbound checks in the current 10-minute window (`Retry-After`: 600).

Start an inbound checkPOST /endpoints/{endpoint_id}/inbound-checks

Code Status When
endpoint.not_found404No endpoint with this `id` exists in your team, or it was deleted.
inbound_check.disabled409The endpoint is disabled.
inbound_check.no_number409The endpoint is a trunk without numbers.
inbound_check.pending409Another inbound check on this endpoint hasn't expired yet.
validation_error422A parameter or body field doesn't match the schema; `fields` maps each one to `validation.<type>`.
rate_limited429Your 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_limited429Your team opened 5 test calls and inbound checks in the current 10-minute window (`Retry-After`: 600).

Get a test callGET /test-calls/{test_call_id}

Code Status When
test_call.not_found404No test call or inbound check 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>`.