Every error the API answers has the same JSON body, whatever your Accept
header says, an unknown path or a wrong method included. The one exception
is the token endpoint: see Token errors.
{
"error": {
"status": 422,
"code": "validation_failed",
"reason": "The location id field is required. (and 1 more error)",
"messageId": "01JD3Q5V8Y6W2K4N7R9T1B3C5E",
"docUrl": "https://api.checknetworks.tools/docs/concepts/errors/#validation_failed",
"fields": [
{ "field": "locationId", "reason": "The location id field is required." },
{ "field": "address.postcode", "reason": "The address.postcode field must be 4 digits." }
]
}
}
| Field | What it holds |
|---|---|
status |
The HTTP status again. |
code |
What went wrong. Branch on this one. |
reason |
The explanation for a person. Its wording can change. |
messageId |
The same as the CN-Message-Id header. Quote it when you contact us. |
docUrl |
A link to the code’s row below. |
fields |
On a validation_failed error only: one entry for each rule an input failed. field names the input (a nested one with dots, such as address.postcode) and reason says why. One input can appear twice. |
carrierCode |
nbn’s or Opticomm’s own code, when they refused the request. |
A few codes add a field of their own, named in their row:
remainingRows, charge, consent, holdId and heldUntil,
allowance, and existingWebhookId on a 409 from POST /webhooks.
We may add codes. Treat a code you don’t know by its status.
Which status for which mistake
On our own endpoints, anything wrong with what you sent is 422
validation_failed, with fields naming the input, whether it was in the
body, the query string or the path. 400 is only for a body we can’t
parse, or a required header that is missing. The carrier-shaped /nbn and
/opticomm endpoints keep the carrier’s own contract, which answers 400
for a bad input.
Token errors
POST /oauth/token answers a wrong client_id or client_secret, or a
bad grant, in OAuth’s own error shape (RFC 6749), not the body above:
{
"error": "invalid_client",
"error_description": "Client authentication failed",
"message": "Client authentication failed"
}
Branch on error: invalid_client (401) is a wrong id or secret;
invalid_request and unsupported_grant_type (400) are a request that
is missing something or names a grant we don’t offer; invalid_scope
(400) names a scope that doesn’t exist; and invalid_grant (400), for
an OAuth app, is a code or refresh token that is no
longer good. error_description, and message with the same text, says
what was wrong for a person to read: log it, but don’t branch on it. A
scope that exists but that your key isn’t allowed is not an error: it is
left out of the token’s scope.
Every other refusal from the token endpoint uses the standard body:
ip_not_allowed (403), key_expired (401) and rate_limited (429).
Signing in and permissions
The key, the token or the account was refused. Requesting a new token fixes some; others need a person on your side.
| Code | Status | What it means | What to do |
|---|---|---|---|
unauthenticated |
401 | The access token is missing, expired or not one of ours. | Request a new token from POST /oauth/token. |
key_expired |
401 | The key has passed the end date set on it under API Keys, so it mints no token and none of its tokens work. Sent by POST /oauth/token too. |
Ask an Owner or Admin for a new key. |
missing_scope |
403 | The token does not carry the scope this endpoint needs; reason names it. |
Request a token with that scope. If the token response’s scope still leaves it out, the key is not allowed it: an Owner or Admin can add it under API Keys. |
key_revoked |
403 | The key has been revoked, so none of its tokens work. | Create a new key; a revoked one cannot be turned back on. |
secret_rotated |
403 | The key’s secret was rolled after this token was issued, and any overlap the roll allowed is over. | Request a new token with the new secret. |
scopes_changed |
403 | The key has lost a scope this token carries. | Request a new token. |
ip_not_allowed |
403 | The call, or the token request, came from an address that is not on the key’s IP allowlist; reason names the address we saw, and so does GET /ping. |
Call from an address on the list, or add this one under API Keys. |
app_disabled |
403 | For an OAuth app: Check Networks has disabled the app, so none of its tokens work for any account and it cannot be connected. | The app’s developer should contact Check Networks. |
app_access_revoked |
403 | For an OAuth app: the account revoked the app under Connected Apps, or connected it again, which replaces the old access and its tokens. Its refresh token is refused too. | Ask the account to connect the app again. |
account_suspended |
403 | Your account is suspended. It can still read, but every change is refused until it is restored. | Contact your Account Manager. |
account_inactive |
403 | Your account is not active, for example because it has been closed, so the API refuses every call. | Contact your Account Manager. |
end_user_keys_off |
403 | The key is limited to one end user, and API keys are switched off for that end user, or the end user is suspended or archived. The key is not revoked. It works again once they are switched back on. | Ask the provider who gave you the key to turn API keys back on. |
owner_protected |
403 | An API key acts as an Admin, and an Admin may never change an Owner: their name, email, role or two-factor, or remove them. | The Owner makes the change themselves in the portal. |
no_end_user_portal_access |
403 | You asked for an end-user portal sign-in link for an end user who cannot use the portal: your account has no end-user portal with a domain, or the end user is archived or has no portal login. | Turn the portal on and give it a domain, or invite a login for the end user first. |
sender_not_approved |
403 | A POST /sms or POST /sms/bulk from a sender your account has no approval for. |
Ask for the sender with POST /sms/senders, and send from it once it is approved. |
forbidden |
403 | Refused for a reason none of the codes above covers; reason says which. |
Read reason. |
Your request
Something about what you sent, or the state of what it was about.
| Code | Status | What it means | What to do |
|---|---|---|---|
bad_request |
400 | The body could not be parsed, or a required header such as Idempotency-Key is missing. On the /nbn and /opticomm carrier-shaped endpoints, also a bad input. |
Fix the body or add the header, and send it again. |
validation_failed |
422 | An input was wrong, or the request was refused on its merits. fields names each input and why. |
Fix the inputs fields names, and send it again. |
not_found |
404 | Nothing is there. It is also the answer for something that belongs to another account, and for a path that does not exist. | Check the id and the path. |
method_not_allowed |
405 | The path exists, but not for this method. | Use a method the reference lists for the path. |
conflict |
409 | The resource is not in a state that allows this right now, or you already hold as many as you may. reason says which. |
Change the state first, or release one you hold. Waiting will not change it. |
idempotency_in_progress |
409 | A request with this Idempotency-Key is still running. |
Wait for the Retry-After seconds, then send the same request with the same key: you get its answer once it has finished. |
idempotency_key_reused |
422 | This Idempotency-Key was already used for a different request. |
Send the new request under a new key. |
rate_limited |
429 | Over a rate limit, or over the daily allowance of POST /numbers/lookup, which allowance then describes. |
Wait for the Retry-After seconds. See API rate limits. |
ticket_not_open |
422 | You asked to resolve a ticket that is already resolved or closed. The ticket’s canResolve says beforehand whether a resolve will succeed. |
To re-open it, set status to open. |
complaint_outcome_required |
422 | A complaint can only be resolved with its outcome recorded. | Send complaintOutcome (resolved, withdrawn or unresolved) with the resolve. |
fault_ticket_limit |
422 | We have set a limit on open fault tickets for one service, and the service is at it. There is no limit unless we set one. | Add to the open ticket with POST /tickets/{ticketRef}/messages, or escalate it with POST /tickets/{ticketRef}/escalate, rather than raising another. |
sq_batch_allowance_exceeded |
409 | A qualification batch (POST /data/sq/batches) over your account’s allowance: ten batches an hour, and a number of rows a day shared with batches uploaded in the portal. remainingRows says how many rows you may still send today. |
Send a smaller batch, or the rest tomorrow. |
no_live_session |
409 | You asked to reset a session (DELETE /data/radius/{ref}/session), and the service has nothing connected to drop. |
Nothing: it picks up any change when it next connects. |
res_line_needs_number |
409 | The change (a route, a release) would leave a Res Line with no number. resLines names each line and the four choices for it. Nothing was changed. |
Send it again with resLineResolutions, a choice for each line: allocate_number, move_number (with number), suspend or cancel. |
bundle_draft_limit |
422 | A data order named a bundle (bundleId) that already holds as many draft orders as one bundle may: 200. A sent order does not count. No draft was made. |
Check out or remove some of the bundle’s drafts, or start another bundle with POST /bundles. |
session_not_resettable |
422 | You asked to reset a session that is held where we cannot reset it: a carrier’s RADIUS, or an older part of our network. | Restart the router to make it connect again. |
caller_id_authorisation_required |
422 | A trunk’s caller ID is a number your account neither holds nor has had approved. | Ask for it with POST /caller-id-authorisations, or use a number your account holds. |
hold_expired |
422 | A number order named a hold (holdId) that has run out. |
Hold the number again, or choose another. |
emergency_call |
422 | You asked to hang up a call to 000, 112 or 106. An emergency call is never hung up. | Nothing: the call stays up. |
Our side
Nothing you sent caused these.
| Code | Status | What it means | What to do |
|---|---|---|---|
not_implemented |
501 | The endpoint is Coming Soon, or is not offered in the sandbox; reason says which. |
Use it in production, or once it is built. |
server_error |
500 | Something went wrong on our side. | Try again shortly, and contact us with the messageId if it keeps happening. |
service_unavailable |
503 | A service the call needs is down for the moment. | Try again shortly, after Retry-After when it is sent. |
The carrier
These are the same whichever carrier answered. The status depends on how it failed: 422 when the carrier refused what you sent (400 on the carrier-shaped /nbn and /opticomm endpoints), 404 or 409 when that is what the carrier said, 429 when it is limiting us, and 502 when it could not be reached or answered with an error of its own. carrierCode holds the carrier’s own code where it gave one, except on a 502.
| Code | Status | What it means | What to do |
|---|---|---|---|
address_not_serviceable |
Varies | The carrier cannot serve this address. | Qualify it again, or try another service. |
duplicate_order |
Varies | The carrier already has an order open for this service or address. | Look for the order already open before placing another. |
insufficient_capacity |
Varies | The carrier has no capacity for this service at the address right now. | Try again later, or try another service. |
auth_validation_failed |
Varies | The carrier could not validate the authorisation in the request, such as a transfer’s service id. | Check it and send again. |
customer_authority_required |
Varies | The carrier needs your customer’s authority for this. | Send it, such as a customerAuthorityDate from the last 45 days. |
charge_acknowledgement_required |
Varies | The request would incur the charge in charge. Two of our own calls answer it too, with 422: deleting a trunk still in contract, and turning on call recording, which adds consent. |
Send it again accepting the charge (acknowledgeEarlyTermination or acknowledgeRecording, as reason says) to go ahead. |
carrier_bad_request |
Varies | The carrier refused the request for another reason; reason and carrierCode say why. |
Fix what they name, and send it again. |
carrier_unauthenticated |
Varies | Our link to the carrier failed to sign in. Nothing you sent caused it. | Try again later. |
carrier_rate_limited |
Varies | The carrier is limiting our requests. | Try again later. |
carrier_unavailable |
502 | The carrier did not answer, or answered with an error of its own. | Try again shortly. |
carrier_unknown |
Varies | The carrier failed in a way we could not classify. | Try again, and contact us with the messageId if it keeps happening. |