Invalid Body
ERR-P01-VLT-2001 - Invalid Body
Section titled “ERR-P01-VLT-2001 - Invalid Body”Summary
Section titled “Summary”The POST /vault/entries body parsed as JSON but failed field validation.
When this is raised
Section titled “When this is raised”- A create request’s
datafield is absent,null, not a string, or an empty string.datamust be a non-empty RFC 7516 JWE string. - The body itself parsed cleanly as JSON - only the field shape is wrong.
A body that is not valid JSON yields
ERR-P01-VLT-0400instead. - The vault treats
dataas opaque ciphertext: it checks presence, type, and emptiness here, but does not validate JWE structure.
What to do
Section titled “What to do”- Send a JSON object with a
dataproperty whose value is a non-empty JWE compact-serialization string. - Verify the field name is exactly
dataand that it is not nested under another key. - This is a client-side input error; correct the body and resend.
Server-side cause
Section titled “Server-side cause”- Raised by:
packages/vault/src/router/index.ts-POST /entrieshandler. - Guard:
if (!isNonEmptyString(body.data)) { … }, whereisNonEmptyStringistypeof v === 'string' && v.length > 0; emits400 / VAULT_ERR.invalid_body.
Example response
Section titled “Example response”{ "type": "https://citizenry.id/errors/ERR-P01-VLT-2001", "title": "Invalid Body", "status": 400, "code": "ERR-P01-VLT-2001", "message": "data is required (a non-empty RFC 7516 JWE string)", "method": "POST", "instance": "/v1/vault/entries", "request_url": "https://api.citizenry.id/v1/vault/entries", "timestamp": "2026-05-17T07:00:00.000Z"}Related codes
Section titled “Related codes”ERR-P01-VLT-0400- body could not be parsed as JSON at all (earlier in the same handler).ERR-P01-VLT-0413-datapresent and valid but over the size cap (later in the same handler).
Changelog
Section titled “Changelog”- 0.1.0 - introduced.