Skip to main content
Every v1 error uses one envelope, whatever went wrong. The envelope puts the error under a single error key:
The nesting keeps the error’s own fields apart from the top level of the response, so a field that Lumos adds there later can never collide with one inside the error.

code and detail

code is part of the API contract. detail is prose that Lumos rewords for clarity, so its exact text can change. If you match on detail, a copy edit can break your code.
type is useful for broad handling, such as deciding whether to retry at all. Use code when you need to react to one specific failure.

Field-level errors

A request that doesn’t match the endpoint’s schema returns 400 with code set to validation_error, and so does a value the endpoint refuses, such as a scheduled_at in the past. errors holds one entry for each rejected field. A 422 about one value names it in errors too. field uses dotted and indexed paths into the request body, so steps[2].inputs.group_id points to exactly the value to fix:
Each entry’s code names the kind of failure, such as missing for a required field you didn’t send.

Status codes

Codes you’ll see

Every status has a default code, used when no more specific one applies: These failures carry a code of their own: Work that runs in the background reports its failure in the operation instead, with codes of its own. Long-running operations lists them.

Retries

Retry 429 and 500. If the response includes Retry-After, wait that many seconds. If it doesn’t, retry with exponential backoff. Don’t retry 400, 401, 403, 404, 405, 422, or 501 until you change the request, or the data it names. The same request fails the same way on a second attempt. Retrying a 401 with a revoked token also counts against your rate limit. A 409 can succeed once the state that code names changes, for example after a running sync finishes or pending access requests resolve. Read code and detail, and inspect the resource before you retry. A 502 can also succeed later, so read detail before you retry it.