Errors

Errors return an HTTP status and a JSON envelope. Branch on the stable type string.

Envelope
{ "message": "…", "code": 401, "type": "user_invalid_credentials", "version": "1.0.0" }
general_unauthorized_scope401 — missing/insufficient auth (e.g. no project header or key scope).
user_invalid_credentials401 — wrong email/password.
user_mfa_required401 — login needs an otp.
user_unauthorized401 — authenticated but not permitted on this resource.
user_already_exists409 — email/id already registered.
document_not_found / collection_not_found404.
document_already_exists409 — duplicate id or unique-index conflict.
general_argument_invalid400 — validation failed (bad type, size, query, etc.).
general_provider_unconfigured503 — a required provider (SMS/push) isn't set up.