Error Reference Index
This section provides a comprehensive reference for all error responses returned by the AnkaSecure API. Each error includes a unique URI, HTTP status code, and detailed resolution guidance.
Quick Reference Table
| HTTP Code | Error Type | URI |
|---|---|---|
| 400 | Invalid Input | https://docs.ankatech.co/errors/invalid-input |
| 400 | Invalid PKCS#7 Structure | https://docs.ankatech.co/errors/invalid-pkcs7 |
| 400 | Missing Request Part | https://docs.ankatech.co/errors/missing-request-part |
| 400 | Validation Error | https://docs.ankatech.co/errors/validation |
| 400 | Unsupported Keystore Format | https://docs.ankatech.co/errors/unsupported-keystore-format |
| 400 | Key Operation Incompatible | https://docs.ankatech.co/errors/key-operation-incompatible |
| 400 | Invalid Operation Name | https://docs.ankatech.co/errors/invalid-operation-name |
| 400 | Signature Mismatch | https://docs.ankatech.co/errors/signature-mismatch |
| 400 | Query Range Exceeded | https://docs.ankatech.co/errors/query-range-exceeded |
| 400 | Invalid Request | https://docs.ankatech.co/errors/invalid_request |
| 400 | Invalid Grant | https://docs.ankatech.co/errors/invalid_grant |
| 400 | Unsupported Grant Type | https://docs.ankatech.co/errors/unsupported_grant_type |
| 400 | Invalid Scope | https://docs.ankatech.co/errors/invalid_scope |
| 400 | Tenant Selection Required | https://docs.ankatech.co/errors/tenant_selection_required |
| 401 | Unauthorized | https://docs.ankatech.co/errors/unauthorized |
| 401 | Invalid Client | https://docs.ankatech.co/errors/invalid_client |
| 401 | Unauthorized Client | https://docs.ankatech.co/errors/unauthorized_client |
| 402 | Payment Required | https://docs.ankatech.co/errors/payment-required |
| 403 | Forbidden | https://docs.ankatech.co/errors/forbidden |
| 403 | SaaS-Only Feature | https://docs.ankatech.co/errors/saas-only-feature |
| 403 | Unsupported Principal Type | https://docs.ankatech.co/errors/unsupported-principal-type |
| 403 | Access Denied | https://docs.ankatech.co/errors/access_denied |
| 404 | Resource Not Found | https://docs.ankatech.co/errors/not-found |
| 404 | Material Version Not Found | https://docs.ankatech.co/errors/material-version-not-found |
| 405 | Method Not Allowed | https://docs.ankatech.co/errors/method-not-allowed |
| 409 | Conflict | https://docs.ankatech.co/errors/conflict |
| 409 | Invalid Key State | https://docs.ankatech.co/errors/invalid-key-state |
| 409 | Concurrent Modification | https://docs.ankatech.co/errors/concurrent-modification |
| 409 | Data Integrity Error | https://docs.ankatech.co/errors/data-integrity |
| 409 | Duplicate KID | https://docs.ankatech.co/errors/duplicate-kid |
| 409 | Cascade Subset Violation | https://docs.ankatech.co/errors/cascade-subset-violation |
| 409 | Deployment Policy Locked | https://docs.ankatech.co/errors/locked-deployment-policy |
| 409 | Counterparty Type Still Referenced | https://docs.ankatech.co/errors/counterparty-type-referenced |
| 409 | Marketplace Bootstrap In Progress | https://docs.ankatech.co/errors/marketplace-bootstrap-in-progress |
| 412 | Precondition Failed | https://docs.ankatech.co/errors/precondition-failed |
| 413 | Payload Too Large | https://docs.ankatech.co/errors/payload-too-large |
| 413 | License Artifact Too Large | https://docs.ankatech.co/errors/license-artifact-too-large |
| 415 | Unsupported Media Type | https://docs.ankatech.co/errors/unsupported-media-type |
| 422 | Unprocessable Entity | https://docs.ankatech.co/errors/unprocessable-entity |
| 422 | Unsupported PKCS#7 Format | https://docs.ankatech.co/errors/unsupported-pkcs7-format |
| 422 | Missing Private Key | https://docs.ankatech.co/errors/missing-private-key |
| 422 | Decryption Failed | https://docs.ankatech.co/errors/decryption-failed |
| 422 | Purpose Required | https://docs.ankatech.co/errors/purpose-required |
| 422 | Rotation Purpose Violation | https://docs.ankatech.co/errors/rotation-purpose-violation |
| 422 | Rotation Security Downgrade | https://docs.ankatech.co/errors/rotate-security-downgrade |
| 422 | Dual Not Applicable | https://docs.ankatech.co/errors/dual-not-applicable |
| 422 | Composite Wire Shape Mismatch | https://docs.ankatech.co/errors/composite-wire-shape-mismatch |
| 422 | Composite Component Algorithm Mismatch | https://docs.ankatech.co/errors/composite-component-algorithm-mismatch |
| 422 | Invalid State Transition | https://docs.ankatech.co/errors/invalid-state-transition |
| 422 | Invalid Material Transition | https://docs.ankatech.co/errors/material-status-invalid-transition |
| 422 | Invalid Stable KID Transition | https://docs.ankatech.co/errors/stable-kid-status-invalid-transition |
| 422 | Purpose Mismatch | https://docs.ankatech.co/errors/purpose-mismatch |
| 422 | Algorithm Not Permitted for Operation | https://docs.ankatech.co/errors/algorithm-not-permitted-for-operation |
| 422 | Tenant Type Restriction | https://docs.ankatech.co/errors/tenant-type-restriction |
| 422 | Tenant Policy Subset Violation | https://docs.ankatech.co/errors/tenant-policy-subset-violation |
| 422 | Lifecycle Policy Subset Violation | https://docs.ankatech.co/errors/lifecycle-policy-subset-violation |
| 422 | Import Operation Not Orchestrable | https://docs.ankatech.co/errors/import-operation-not-orchestrable-by-use-case |
| 422 | Composite-Pair Operation Not Supported | https://docs.ankatech.co/errors/composite-pair-operation-requires-multi-key-use-case-not-yet-supported |
| 422 | License Artifact Invalid | https://docs.ankatech.co/errors/license-artifact-invalid |
| 422 | License Deployment Mismatch | https://docs.ankatech.co/errors/license-deployment-mismatch |
| 422 | License Expired | https://docs.ankatech.co/errors/license-expired |
| 429 | Too Many Requests | https://docs.ankatech.co/errors/too-many-requests |
| 429 | Refresh Cooldown Active | https://docs.ankatech.co/errors/refresh-cooldown |
| 4xx | Client Error | https://docs.ankatech.co/errors/client-error |
| 500 | Internal Server Error | https://docs.ankatech.co/errors/internal |
| 500 | Cryptographic Error | https://docs.ankatech.co/errors/crypto |
| 500 | Repository Error | https://docs.ankatech.co/errors/repository |
| 500 | Admin Operation Failed | https://docs.ankatech.co/errors/admin-operation |
| 500 | Keystore Error | https://docs.ankatech.co/errors/keystore |
| 500 | Data Access Error | https://docs.ankatech.co/errors/data-access |
| 501 | Not Implemented | https://docs.ankatech.co/errors/not-implemented |
| 502 | Upstream Service Unavailable | https://docs.ankatech.co/errors/upstream-unavailable |
| 503 | Service Unavailable | https://docs.ankatech.co/errors/service-unavailable |
| 503 | Async Not Usable | https://docs.ankatech.co/errors/async-not-usable |
| 503 | Data Source Unavailable | https://docs.ankatech.co/errors/data-source-unavailable |
| 503 | Marketplace Temporarily Disabled | https://docs.ankatech.co/errors/marketplace-temporarily-disabled |
| 503 | Snapshot Stale | https://docs.ankatech.co/errors/snapshot-stale |
| 503 | Stats Snapshot Unavailable | https://docs.ankatech.co/errors/stats-snapshot-unavailable |
| 503 | Audit Event Publishing Failed | https://docs.ankatech.co/errors/kafka-publish-failure |
| 504 | Upstream Service Timeout | https://docs.ankatech.co/errors/upstream-timeout |
| 504 | Gateway Timeout | https://docs.ankatech.co/errors/gateway-timeout |
Error Response Format
All errors follow the RFC 7807 Problem Details standard and are returned with Content-Type: application/problem+json. The body is a flat JSON object — there is no nested error envelope:
{
"type": "https://docs.ankatech.co/errors/error-type",
"title": "Human-readable error title",
"status": 422,
"detail": "Additional context about the error",
"instance": "/api/v3/migration/convert-pkcs7-to-jose",
"correlationId": "550e8400-e29b-41d4-a716-446655440000",
"timestamp": 1730000000
}
The core fields are defined by RFC 7807:
type- URI identifying the error category (links to the matching page in this reference)title- Short, human-readable summary of the error typestatus- HTTP status code, repeated in the body for conveniencedetail- Human-readable explanation specific to this occurrenceinstance- The request path that produced the error
Two platform extensions accompany the standard fields:
correlationId- Request correlation identifier, for correlation with server-side logstimestamp- Epoch-seconds timestamp of when the error was produced
Some errors add further extensions (for example, PKCS#7 conversion errors include an errorCode and recipient metadata; OAuth 2.0 errors mirror the RFC 6749 error/error_description fields). See the individual error pages for details.
OAuth 2.0 token-endpoint errors (invalid_request, invalid_client, invalid_grant, unauthorized_client, unsupported_grant_type, invalid_scope, tenant_selection_required, access_denied) use an underscore type suffix so the RFC 7807 type matches the RFC 6749 error code exactly.
Client Errors (4xx)
Client errors indicate that the request contains incorrect syntax or cannot be fulfilled due to client-side issues.
400 Bad Request
- Invalid Input - Request contains syntactically invalid data or malformed JSON
- Invalid PKCS#7 Structure - Provided file is not a valid PKCS#7/CMS structure
- Missing Request Part - Required multipart form data or request parameters are missing
- Validation Error - Request passed JSON parsing but failed field validation rules
- Unsupported Keystore Format - Uploaded keystore is in a format the platform does not support
- Key Operation Incompatible - Requested operation is incompatible with the key's type or algorithm
- Invalid Operation Name - Supplied operation name is not a recognized cryptographic operation
- Signature Mismatch - An audit record tamper-evidence signature did not verify
- Query Range Exceeded - Audit query time range or result window exceeds the maximum allowed
- Invalid Request - OAuth 2.0: OAuth 2.0 token request is malformed or missing a required parameter
- Invalid Grant - OAuth 2.0: OAuth 2.0 authorization grant or refresh token is invalid, expired, or revoked
- Unsupported Grant Type - OAuth 2.0: OAuth 2.0 grant type is not supported by the authorization server
- Invalid Scope - OAuth 2.0: OAuth 2.0 requested scope is unknown, malformed, or exceeds the permitted scope
- Tenant Selection Required - OAuth 2.0: OAuth 2.0 credentials map to multiple tenants; a tenant must be selected
401 Unauthorized
- Unauthorized - Missing or invalid authentication credentials
- Invalid Client - OAuth 2.0: OAuth 2.0 client authentication failed
- Unauthorized Client - OAuth 2.0: OAuth 2.0 client is not authorized to use the requested grant type
402 Payment Required
- Payment Required - License expired or usage limits exceeded, payment or renewal needed
403 Forbidden
- Forbidden - Authenticated but lacking permission for the requested operation
- SaaS-Only Feature - Feature is available only in the ANKASecure SaaS deployment
- Unsupported Principal Type - Authenticated principal type is not supported for the operation
- Access Denied - OAuth 2.0: OAuth 2.0 authorization request was denied
404 Not Found
- Resource Not Found - The requested resource, key, or endpoint does not exist
- Material Version Not Found - The referenced key material version does not exist
405 Method Not Allowed
- Method Not Allowed - The HTTP method is not supported for the endpoint
409 Conflict
- Conflict - Request conflicts with current resource state (duplicate keys, concurrent modifications)
- Invalid Key State - Key exists but is in an invalid lifecycle state for the requested operation
- Concurrent Modification - Resource was modified by another request between read and write
- Data Integrity Error - Request violates a data integrity constraint
- Duplicate KID - A key with the requested kid already exists for the tenant
- Cascade Subset Violation - A cascading change would leave dependent policies outside the allowed subset
- Deployment Policy Locked - The deployment policy is locked and cannot be modified
- Counterparty Type Still Referenced - Counterparty type is still referenced and cannot be deleted
- Marketplace Bootstrap In Progress - Marketplace bootstrap is in progress for the tenant
412 Precondition Failed
- Precondition Failed - A request precondition was not satisfied
413 Payload Too Large
- Payload Too Large - Request payload exceeds configured size limits
- License Artifact Too Large - License artifact exceeds the maximum accepted size
415 Unsupported Media Type
- Unsupported Media Type - Request Content-Type is not supported by the endpoint
422 Unprocessable Entity
- Unprocessable Entity - Semantically incorrect content (malformed JWE/JWS, header validation failures)
- Unsupported PKCS#7 Format - Valid PKCS#7 structure but feature not yet supported (e.g., multiple signers/recipients)
- Missing Private Key - Required private key not found in keystore for PKCS#7 conversion
- Decryption Failed - Supplied key could not decrypt the PKCS#7 content (wrong recipient key or corrupted ciphertext)
- Purpose Required - Key purpose could not be inferred and must be declared explicitly
- Rotation Purpose Violation - Rotation cannot change the key purpose
- Rotation Security Downgrade - Rotation target is a security downgrade from the current key
- Dual Not Applicable - Dual projection is not applicable to a single-purpose key
- Composite Wire Shape Mismatch - Composite message wire shape does not match the key definition
- Composite Component Algorithm Mismatch - Composite component algorithm does not match the key definition
- Invalid State Transition - Requested lifecycle state change is not permitted from the current state
- Invalid Material Transition - Requested key material status change is not allowed from its current status
- Invalid Stable KID Transition - Requested stable kid status change is not allowed from its current status
- Purpose Mismatch - Key purpose does not match the purpose required by the operation
- Algorithm Not Permitted for Operation - Key algorithm is not permitted for the operation under the active policy
- Tenant Type Restriction - Operation is not allowed for this tenant's type
- Tenant Policy Subset Violation - Tenant policy is not a subset of the parent policy
- Lifecycle Policy Subset Violation - Lifecycle policy is not a subset of the inherited policy
- Import Operation Not Orchestrable - Import operation cannot be orchestrated under the requested use case
- Composite-Pair Operation Not Supported - Composite-pair operation requires a multi-key use case that is not yet supported
- License Artifact Invalid - License artifact failed validation; its signature could not be verified
- License Deployment Mismatch - License artifact was issued for a different deployment
- License Expired - License artifact has passed its validity period
429 Too Many Requests
- Too Many Requests - Request rate limit exceeded for the endpoint
- Refresh Cooldown Active - A snapshot refresh cooldown is still active
4xx Generic
- Client Error - General client error fallback for unspecified 4xx status codes
Server Errors (5xx)
Server errors indicate that the server failed to fulfill a valid request.
500 Internal Server Error
- Internal Server Error - Unexpected server-side error occurred
- Cryptographic Error - Internal cryptographic operation failure
- Repository Error - Database or storage layer operation failed
- Admin Operation Failed - An administrative operation failed on the server
- Keystore Error - A keystore operation failed on the server
- Data Access Error - A database or storage operation failed while handling the request
501 Not Implemented
- Not Implemented - Requested functionality is not yet implemented
502 Bad Gateway
- Upstream Service Unavailable - An internal upstream dependency failed or is unreachable; retryable, honor Retry-After when present
503 Service Unavailable
- Service Unavailable - Service temporarily unavailable due to maintenance, overload, or dependency failures
- Async Not Usable - Asynchronous service temporarily unavailable or disabled
- Data Source Unavailable - A required data source is temporarily unavailable
- Marketplace Temporarily Disabled - The marketplace integration is temporarily disabled
- Snapshot Stale - The audit snapshot is stale and a fresh one is not yet available
- Stats Snapshot Unavailable - The statistics snapshot is not available yet
- Audit Event Publishing Failed - A required audit event could not be published; the operation was not completed
504 Gateway Timeout
- Upstream Service Timeout - An internal upstream dependency did not respond within the operation's deadline; retryable
- Gateway Timeout - An upstream dependency did not respond within the operation's deadline; retryable
Error Handling Best Practices
Retry Strategy
- 4xx errors: Generally should NOT be retried without fixing the request
- 5xx errors: May be retried with exponential backoff
- 502/504 errors: Retryable - honor the
Retry-Afterheader when present (emitted while the circuit breaker toward the failing upstream is open), otherwise apply exponential backoff - 503 errors: Should be retried after the delay specified in
Retry-Afterheader - 429 errors: Honor the
Retry-Afterheader before retrying
Error Logging
Always log the following from error responses:
correlationId- For correlation with server-side logstimestamp- For temporal analysistype- For programmatic error handlingdetail- For debugging context
Programmatic Error Handling
// Example: dispatch on the RFC 7807 `type` URI
switch (problemDetails.getType().toString()) {
case "https://docs.ankatech.co/errors/payment-required":
redirectToPaymentPortal();
break;
case "https://docs.ankatech.co/errors/validation":
displayFieldErrors(problemDetails.getDetail());
break;
case "https://docs.ankatech.co/errors/not-found":
handleMissingResource();
break;
default:
logErrorAndNotifyUser(problemDetails);
}
Rate Limiting
When encountering rate limit errors:
- Check the
X-RateLimit-Remainingheader - Respect the
X-RateLimit-Resettimestamp - Implement client-side throttling
- Consider upgrading your plan for higher limits
Additional Resources
- Developer Hub Reference - General error handling and endpoint documentation
- Authentication on the Developer Hub - Authentication and authorization
- Policy Cache Monitoring on the Developer Hub - Monitoring, observability, and rate limit information
- Support Portal - Contact support for persistent issues
Need Help?
If you encounter an error not documented here or need assistance resolving persistent errors:
- Check the
correlationIdfrom the error response - Review server status at status.ankatech.co
- Contact support with the error details and
correlationId - Consult the Developer Hub Reference for endpoint-specific requirements