Unprocessable Entity
URI: https://docs.ankatech.co/errors/unprocessable-entity
HTTP Status: 422 Unprocessable Entity
When you see this
The server understood your request and the syntax was correct, but it could not process the content because of semantic or integrity issues.
Common Causes
-
Malformed JWE header
The flattened JWE JSON is invalid or missing required fields (protected
,iv
,recipients
, orencrypted_key
for non-dir
algorithms). -
Malformed Compact JWE
The incoming JWE string cannot be parsed (e.g. does not conform to RFC 7516). -
Malformed Compact JWS
The incoming JWS string cannot be parsed (e.g. does not conform to RFC 7515). -
Detached JWS header validation failure
The detached-JWS JSON is missing itsprotected
section orkid
field, or isn’t valid Base64-encoded JSON. -
Ciphertext integrity failure
AES-GCM/CCM tag mismatch or asymmetric unwrap padding error (OAEP/PKCS#1) during decrypt/unwrapping.
How to Resolve
- Validate token syntax
- Ensure your JWE/JWS strings exactly match the expected RFC formats.
- Check header JSON
- Decode the Base64 header and confirm all required fields (
kid
,alg
,iv
, etc.) are present.
- Decode the Base64 header and confirm all required fields (
- Confirm cryptographic parameters
- IV length must be 12 bytes for AES-GCM; tags must be 16 bytes.
- Use correct key material
- Make sure you’re using the same
kid
and algorithm that encrypted or signed the data.
- Make sure you’re using the same
- Re-submit
- After correcting any header or token issues, retry your request.
If you continue to receive a 422 error after these steps, please consult the full API Reference.