Bad request
ERR-P01-IDT-0400 - Bad request
Section titled “ERR-P01-IDT-0400 - Bad request”Summary
Section titled “Summary”The request body or query could not be parsed, or a required top-level field is missing or the wrong type.
When this is raised
Section titled “When this is raised”- The request body is not valid JSON (e.g.
POST /v1/agent/registerorPOST /v1/humanswith a truncated or non-JSON payload). - A required scalar is absent or has the wrong primitive type before any
domain validation runs - e.g.
slugmissing on register,emailnot a string onPOST /v1/humans. - The catch-all for malformed transport that does not yet reach the schema validators (2xxx) or business rules (3xxx).
What to do
Section titled “What to do”- Send a well-formed JSON body with the documented required fields. Check
Content-Type: application/jsonand that the body is not empty. - This is always a client-side mistake; do not retry the identical request - fix the payload first.
Server-side cause
Section titled “Server-side cause”- Raised by:
packages/identity/src/router/register.ts(JSON parse guard and theslug is requiredguard) andpackages/identity/src/router/humans.ts(email is required/ non-JSON body, mapped fromHumanError('email_invalid')). - Guard:
try { body = await c.req.json() } catch { … }and the subsequenttypeof body.<field> !== 'string'checks.
Example response
Section titled “Example response”{ "type": "https://citizenry.id/errors/ERR-P01-IDT-0400", "title": "Bad Request", "status": 400, "code": "ERR-P01-IDT-0400", "message": "request body must be valid JSON", "method": "POST", "instance": "/v1/agent/register", "request_url": "https://api.citizenry.id/v1/agent/register", "timestamp": "2026-05-17T07:00:00.000Z"}Related codes
Section titled “Related codes”ERR-P01-IDT-2001- JWK invalid (a more specific schema failure once the body parses).ERR-P01-IDT-2002- slug pattern violation.
Changelog
Section titled “Changelog”- 0.1.0 - introduced.