Skip to content

Error format

z4j errors follow RFC 7807 Problem Details.

{
"type": "https://z4j.dev/errors/validation",
"title": "validation failed",
"status": 422,
"detail": "email is not a valid email address",
"code": "invalid_email",
"instance": "/api/v1/memberships/invite",
"errors": [
{ "field": "email", "code": "invalid_email", "message": "not a valid email address" }
]
}
  • type - stable URL identifier. Group clients by type.
  • code - stable short identifier for programmatic branching.
  • errors - per-field breakdown when the top-level is a validation failure.
StatusWhen
400Bad request (malformed JSON, bad query parameter)
401Unauthenticated
403Authenticated but insufficient role
404Resource doesn’t exist (or you can’t see it)
409Conflict (duplicate, state mismatch)
422Validation failure
429Rate limit exceeded
500Unhandled exception
503Dependency unavailable (Postgres down, for instance)
codestatusmeaning
invalid_credentials401login failed
session_expired401cookie expired
insufficient_role403missing role for action
not_found404resource missing
conflict_duplicate_name409unique constraint violated
conflict_state409action requires different state (e.g. retry on running task)
validation_failed422see errors array
rate_limited429see Retry-After header
agent_offline503target agent not connected
command_timeout504agent didn’t respond in time

Error detail is operator-friendly English. For user-facing UI, switch on code and render your own translated message.

Every error response includes X-Request-Id header - pass it when filing a bug.