Skip to content

Error codes

Lane.Chat's REST API returns a JSON envelope on every response. Success is code: 0; errors carry a non-zero code that mirrors the HTTP status.

json
{ "code": 0, "msg": "success", "data": { } }
json
{ "code": 404, "msg": "Application not found" }

Common codes

CodeMeaningTypical cause
0SuccessThe request succeeded; read data.
400Bad requestA required parameter is missing (e.g. appId, chat_id).
401UnauthorizedMissing/invalid/expired token, or the visitor could not be authenticated.
403ForbiddenThe visitor is banned, the caller does not own the resource, or the request was identified as a bot.
404Not foundApplication, chat, or resource does not exist.
422UnprocessableValidation failed (e.g. empty values on a form submit, invalid field).
429Rate limitedToo many requests — see Rate limits.
500Server errorAn unexpected server-side failure.

Notable variants

Some endpoints add fields alongside the code to disambiguate:

ResponseMeaning
{ "code": 403, "bot": true }Session init refused because the request looked like a crawler/bot.
{ "code": 403, "banned": true }The visitor has been banned; chat is blocked.

Validation errors

Dashboard endpoints that validate input return code with a message and, where applicable, a field-level errors object:

json
{
  "code": 400,
  "msg": "Validation failed",
  "errors": { "password": ["The password must be at least 6 characters."] }
}

Rate-limit responses

A throttled request returns HTTP 429 with a JSON body and headers:

json
{ "code": 429, "error": "rate_limited", "message": "Too many requests", "retry_after": 42 }
HeaderMeaning
Retry-AfterSeconds to wait before retrying
X-RateLimit-LimitThe window's request cap
X-RateLimit-RemainingRemaining requests in the window
X-RateLimit-ResetUnix time when the window resets

Webhook and channel endpoints

Inbound webhook receivers use HTTP status directly rather than the JSON envelope. For example, the email inbound endpoint returns 200 (stored), 204 (silently dropped — invalid token or empty body), or 401 (bad shared secret).

Lane.Chat — AI customer support, multichannel CRM, and roleplay AI.