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:
{
"code": "text_too_long",
"message": "The text needs 11 segments; the maximum is 10.",
"param": "text",
"doc_url": "https://docs.06line.com/docs/errors#text_too_long"
}Match on code; message is for humans and may change. param points at the offending field.
| 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 act on this line or call | Use a credential of the right company or line |
not_found | The line, call or message does not exist in your company | 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 | Wait for the call to end |
call_not_active | Answering or hanging up a call that already ended | Ignore; the call is over |
rate_limited | Too many commands or connections | Retry after retry_after_ms |
internal | Our fault | Retry with the same client_ref; 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 |