Skip to content

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, or encrypted_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 its protected section or kid 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

  1. Validate token syntax
    • Ensure your JWE/JWS strings exactly match the expected RFC formats.
  2. Check header JSON
    • Decode the Base64 header and confirm all required fields (kid, alg, iv, etc.) are present.
  3. Confirm cryptographic parameters
    • IV length must be 12 bytes for AES-GCM; tags must be 16 bytes.
  4. Use correct key material
    • Make sure you’re using the same kid and algorithm that encrypted or signed the data.
  5. 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.