Skip to main content

Errors

When a request fails, the response body is an error object. It always has a type and a message, and sometimes an extra field such as scope:

{ "error": { "type": "insufficient_scope", "message": "…", "scope": "sms:send" } }
FieldContract
typeStable — base your code's decisions on this. New values may be added, but an existing one is never reused to mean something else.
messageA human-readable description. It can change at any time, so never write code that reads it.
scopeOnly on insufficient_scope — tells you exactly which permission to ask for next.

The catalog​

typeStatusWhat happenedWhat to do
invalid_request400Missing or malformed field, unknown enum value, unknown field in the body, or unparseable JSONFix the request. The message names the field.
unauthenticated401No credential, or one that is invalid, revoked or expiredRefresh the token, or check the key
insufficient_scope403Valid credential, missing scopeRe-authorize with the scope in the scope field
permission_denied403Scope is fine — the person's role lacks the permissionTheir admin changes the role in the portal
not_found404No such object, or it is not this account'sCheck the id
conflict409The request contradicts current stateRe-read, then retry
unsupported400A recognized parameter with a value this API cannot honourSee the message — e.g. enabled=false as a filter
rate_limited429Too many requestsBack off. Not currently emitted — see Rate limits.
unavailable503A dependency is downRetry with backoff
internal_error500Something failed on our sideRetry. You were not charged.

Several rows above say to "back off." Backing off means waiting before you retry, and waiting longer after each failure — for example 1s, then 2s, then 4s — rather than retrying in a tight loop. This gives an overloaded server room to recover.

Sign-in (OAuth) errors​

Errors shown while signing in or adding an app, and what fixes each, are on OAuth errors.

The two 403s are not the same problem​

This is the single most common source of lost time on this API.

{ "error": { "type": "insufficient_scope", "message": "credential is not authorized for sms:send", "scope": "sms:send" } }

→ Your code's problem. The credential was never granted sms:send. Re-authorize, or add the scope to the key.

{ "error": { "type": "permission_denied", "message": "the user who authorized this application does not have access to call recordings" } }

→ Not your code's problem. The scope is there; it is the person who approved the token who lacks the matching permission in the admin center. Re-authorizing will not fix it — their administrator has to change their role. See Scopes.

401 names the scope it wanted​

When a request fails with 401, the response includes a standard header called WWW-Authenticate (defined by RFC 6750, the OAuth bearer-token standard). Its scope="…" part names exactly which permission the endpoint needed — sms:read in the example below.

That saves you from guessing: instead of asking the user up front to approve a big list of permissions "just in case," your app can read this header, see the one scope it was missing, and request just that one the next time it authorizes:

WWW-Authenticate: Bearer realm="Telebroad API", error="invalid_token", scope="sms:read"

What is safe to retry​

StatusSafe to retryWhy
5xxYesNothing was created or charged. Guaranteed.
429Yes, after backing offNothing happened
4xxNo — fix the request firstIt will fail identically

Two of the write operations are idempotent — doing them twice has the same effect as doing them once — so retrying after a timeout is safe even if the first attempt actually succeeded:

  • POST /sms/conversations/{line}/{number}/resolve — re-resolving does not change who closed it or when.
  • POST /webhooks/{id}/enable and /disable — setting a state it is already in does nothing.

POST /sms/messages is not idempotent — retrying after a timeout may send (and bill you for) a second message. If you cannot risk that, check SMS history before retrying.

5xx messages are deliberately vague​

An internal error's message always just reads "internal error". The real details can include things like internal database and server names, so we keep them in our own logs instead of sending them back to you. If you need one looked into, send us the timestamp, the endpoint, and the account — each internal error is logged on our side with a tracking code.