Errors
Every error code, what causes it, and what to do.
Every error response carries the same object under error, next to a request_id:
{
"error": {
"code": "text_too_long",
"message": "the text needs more than 10 segments",
"param": "text",
"doc_url": "https://docs.06line.com/docs/errors#text_too_long"
},
"request_id": "req_01jbq5a3x9e2k7m4t6v8r0c1yb"
}Match on code; message is for humans and may change. param, when present, names the offending field of the body
or the query (to, text, client_ref, limit, peer, url, events…). retry_after_ms comes with
rate_limited only. doc_url points at the row of the code below.
| Code | Cause | What to do |
|---|---|---|
invalid_request | Malformed JSON, unknown field, missing or wrongly typed field | Fix the request; see param |
| Missing, unknown, revoked or expired credential | Get a valid credential | |
forbidden | The credential cannot do this: an ephemeral key on SMS, webhook endpoints or ephemeral keys, or placing a call on another line | Call from your server with an API key |
not_found | The line, call, message or session does not exist in your company, or is out of reach of a key restricted to one line | Check the id |
invalid_number | The number is not E.164 | Send + and the country code, no spaces |
text_too_long | More than 10 segments | Shorten the text, or avoid characters that force UCS-2 |
line_offline | The line is not registered on the network | Wait for line.state with online: true |
line_busy | A call is already in progress on the line or on the WebRTC session, or another session answered first | Wait for the call to end |
call_not_active | Answering a call that is no longer ringing (hanging up an ended call is not an error: it returns the call) | Ignore; the call was answered or is over |
rate_limited | More than 25 requests a second on average, or 100 at once, for the key | Retry after retry_after_ms |
internal | Our fault | Retry with the same client_ref: a message saved but never sent is sent then, never twice; contact support with request_id |
A message that ends failed carries its reason in error, in the API and in the sms.status webhook:
| Code | Cause | What to do |
|---|---|---|
send_failed | The modem or the network refused a segment | Check the number; retry later with a new client_ref |
delivery_failed | The network reported the recipient will never get it (unknown or barred number) | Check the number |
line_offline | The line went offline before the message left | Wait for the line to be online, then send again |
The browser SDK adds codes of its own, for what happens in the browser (microphone_denied,
speaker_not_found, user_gesture_required…): see its errors. A call it ends because
another session answered it carries the end reason answered_elsewhere.