Skip to main content
Errors are JSON with a machine-readable error code and a human-readable message:
Branch on error, not on message. Messages can change. Some errors add fields, such as currentSessionId on device_busy.

Validation errors

A request that fails validation returns 400 in one of two shapes, depending on the endpoint:
  • validation_error carries per-field details. Direct phone control actions and sessions started without an agent use this shape.
  • bad_request carries one message. Agent endpoints, follow-up messages and answers to the agent use this shape.
Handle both: check error, then read details or message.

Common errors

A resource in another workspace returns the same 404 as one that does not exist, so a 404 never reveals another workspace’s data.

Session failure codes

A session that fails has status failed and a code in its error field. See Follow a session.

Retrying safely

Requests that start work (turns, sessions, follow-up messages) accept an Idempotency-Key header. Retry them with the same key, and Lusor returns the original result instead of doing the work twice. Reads are always safe to retry.