Skip to content

Precondition Failed

URI: https://docs.ankatech.co/errors/precondition-failed
HTTP Status: 412 Precondition Failed

When you see this

A precondition you specified for the request (for example a conditional header, an expected version, or a required prior state) was not met, so the operation was not performed.

Common Causes

  • A conditional request whose expected version no longer matches the stored resource.
  • An operation that requires the resource to be in a specific prior state that it is not in.
  • A guard condition supplied in the request body that the current resource state does not satisfy.

Response Example

{
  "type": "https://docs.ankatech.co/errors/precondition-failed",
  "title": "Precondition Failed",
  "status": 412,
  "detail": "The request precondition was not satisfied. The resource state does not match the expected condition.",
  "instance": "/api/v3/admin/keys/my-mlkem-key",
  "correlationId": "550e8400-e29b-41d4-a716-446655440000",
  "timestamp": 1730000000
}

Content-Type: application/problem+json — the response follows RFC 7807 Problem Details.

How to Resolve

  1. Re-read the resource to learn its current version and state.
  2. Adjust your precondition to match the current value, or bring the resource to the required prior state first.
  3. Re-submit the request once the precondition holds.

For full schema definitions, examples, and interactive testing, see the Developer Hub Reference.