06 Line

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.

CodeCauseWhat to do
invalid_requestMalformed JSON, unknown field, missing or wrongly typed fieldFix the request; see param
unauthorizedMissing, unknown, revoked or expired credentialGet a valid credential
forbiddenThe credential cannot do this: an ephemeral key on SMS, webhook endpoints or ephemeral keys, or placing a call on another lineCall from your server with an API key
not_foundThe line, call, message or session does not exist in your company, or is out of reach of a key restricted to one lineCheck the id
invalid_numberThe number is not E.164Send + and the country code, no spaces
text_too_longMore than 10 segmentsShorten the text, or avoid characters that force UCS-2
line_offlineThe line is not registered on the networkWait for line.state with online: true
line_busyA call is already in progress on the line or on the WebRTC session, or another session answered firstWait for the call to end
call_not_activeAnswering 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_limitedMore than 25 requests a second on average, or 100 at once, for the keyRetry after retry_after_ms
internalOur faultRetry 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:

CodeCauseWhat to do
send_failedThe modem or the network refused a segmentCheck the number; retry later with a new client_ref
delivery_failedThe network reported the recipient will never get it (unknown or barred number)Check the number
line_offlineThe line went offline before the message leftWait 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.