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 |
| 409 | Key Protection Backend Not Configured | https://docs.ankatech.co/errors/key-protection-backend-not-configured |
| 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 | Key Operations Narrowing Forbidden | https://docs.ankatech.co/errors/key-ops-narrowing-forbidden |
| 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 |
| 422 | Identity Provider Email Unverified | https://docs.ankatech.co/errors/identity-provider-email-unverified |
| 400/404/409/422 | Upstream Rejected Request | https://docs.ankatech.co/errors/upstream-rejected-request |
| 429 | Too Many Requests | https://docs.ankatech.co/errors/too-many-requests |
| 429 | Refresh Cooldown Active | https://docs.ankatech.co/errors/refresh-cooldown |
| 429 | Key Protection Rate Limited | https://docs.ankatech.co/errors/key-protection-rate-limited |
| 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 |
| 503 | Key Protection Backend Unavailable | https://docs.ankatech.co/errors/key-protection-backend-unavailable |
| 503 | Key Protection Backend Misconfigured | https://docs.ankatech.co/errors/key-protection-backend-misconfigured |
| 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 API 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.
Where extension members live depends on which service answered
RFC 7807 — and its successor RFC 9457 — define extension members as top-level members of the problem object. This platform does not place them uniformly, so a client must know which service produced the body before it reads a non-RFC member. Reading the wrong one returns undefined, and that is the single most common cause of a client falling back to parsing detail.
What is uniform: the five RFC-defined members — type, title, status, detail, instance — are top-level in every service, exactly as the specification requires, and timestamp is top-level everywhere it is emitted, even though by the RFC's definition it too is an extension member.
What moves is the correlation identifier:
| Service | Correlation member | Where to read it |
|---|---|---|
| Core API, PQC Handshake API | correlationId | top-level — response.correlationId |
| Admin API, Audit API | requestId | nested — response.extensions.requestId |
| Auth API, License Server | none in the body | the X-Correlation-Id response header |
The X-Correlation-Id and X-Request-Id response headers are set by every service, so a client that does not want to branch on the service can correlate from the headers alone.
Core API / PQC Handshake API shape — correlationId is a first-class top-level member (this is the canonical example at the top of this page). extensions carries only the additional per-error members, such as the PKCS#7 conversion errorCode and its recipient metadata:
{
"type": "https://docs.ankatech.co/errors/unsupported-pkcs7-format",
"title": "Unsupported PKCS#7 Format",
"status": 422,
"detail": "The requested target format is not compatible with the parsed structure.",
"instance": "/api/v3/migration/convert-pkcs7-to-jose",
"correlationId": "550e8400-e29b-41d4-a716-446655440000",
"timestamp": 1751500800,
"extensions": {
"errorCode": "INCOMPATIBLE_TARGET_FORMAT"
}
}
Admin API / Audit API shape — there is no top-level correlationId. The correlation identity is extensions.requestId, so a client must read response.extensions.requestId, not response.requestId. Every other extension member on these two services is likewise nested:
{
"type": "https://docs.ankatech.co/errors/invalid-input",
"title": "Invalid Input",
"status": 400,
"detail": "Field 'algorithm' is required and must be one of the catalog values.",
"instance": "/api/v3/admin/tenants/2f1c9d84-6b2e-4d3a-9f57-0a1b2c3d4e5f/keys",
"timestamp": 1751500800,
"extensions": {
"requestId": "550e8400-e29b-41d4-a716-446655440000"
}
}
extensions is absent when an error carries none, so read it defensively on every service. Two bodies are produced by a different mapper and carry no extensions and no timestamp at all — the 502 Upstream Service Unavailable and the 504 Upstream Service Timeout.
Dispatch on type — not on errorCode, and never on detail
type is the primary identifier of a problem. RFC 9457 §3.1.1 defines it that way, every distinct condition in this platform has its own dedicated slug, and — decisively — type is the only discriminator that survives every path a response can take to you.
Some Core API and PQC Handshake API bodies additionally carry extensions.errorCode, a stable machine-readable string. It is convenient for a direct integration, but it is not a substitute for type, because it is dropped when the Admin API relays a Core API refusal: the relay's problem view is a closed four-member record — type, title, status, detail — so no extension member of the originating service crosses that boundary. A consumer keyed on errorCode therefore works against the Core API directly and silently stops discriminating on the relayed path.
type crosses it unchanged. So:
- Branch on
type. It is stable, it is documented on the page eachtypeURI names, and it is identical on the direct and the relayed path. - Use
errorCodeonly as a refinement, when it is present, and only where two conditions genuinely share onetype. Never as the primary key, and never assume it is present. - Never parse
detail. It is prose written for a human, it is localized, and it is the one member whose exact wording carries no compatibility promise. If you find yourself matching on its text, the discriminator you actually need is atype— please report it so a dedicated one can be published.
// Correct: the type URI is the contract.
switch (problemDetails.getType().toString()) {
case "https://docs.ankatech.co/errors/key-ops-narrowing-forbidden": widenKeyOpsAndResubmit(); break;
case "https://docs.ankatech.co/errors/purpose-required": declarePurposeAndResubmit(); break;
default: logAndSurface(problemDetails);
}
detail is a sentence, never a document
detail is always a single human-readable sentence. It is never a nested JSON document, and it is never an error body from another service folded into a string. This holds even when the rejection was detected by an internal service that the one you called forwarded your request to — see S2S Relay Envelope for exactly which members come from where in that case. Where a rejection carries per-item detail, that detail is published as a named extension member (for example extensions.failedEntries), not as text inside detail.
406 Not Acceptable carries no body
Content negotiation is the one deliberate exception to "every error is a problem document". When your Accept header excludes every media type an endpoint can produce, the response is a bare 406 Not Acceptable: status line only, Content-Length: 0, and no Content-Type header.
There is no type slug for it, and it is absent from the table above by design. RFC 9110 §15.5.7 explicitly permits a 406 with no representation, and an empty body is the only response that is representable under every Accept value — including the value that caused the condition. Sending a application/problem+json body to a client that has just declared it cannot accept that type would be self-contradictory.
Practically, for a strict JSON client:
Accept: application/jsonon an error-only endpoint returns the endpoint's normal status, not a 406.Accept: application/xml(or any value the endpoint cannot satisfy) returns the empty 406.- A malformed
Acceptvalue also returns the empty406, not a400: an unparseable header makes the mapping fail to match on its producible types, which is the same condition as an unsatisfiable one. */*and an absentAcceptheader behave exactly as before.
Treat a 406 as a client-side content-negotiation bug: correct the Accept header and retry. Do not attempt to parse the response.
The Browser-Redirect Error Surface
Three external identity-federation legs are top-level browser navigations, not API calls. When one of them fails, the browser is redirected to the console login screen carrying ?error=<code>&ref=<uuid> — there is no response body, and therefore no type, no detail and no correlationId (the correlation identifier is ref). See Federated Login Errors for the six codes and their remedies.
This is a second error representation, not an exception to the RFC 7807 guarantee above. A surface may use it if and only if all three of the following hold:
- the request is a top-level browser navigation that the browser renders as a document;
- the caller therefore cannot read a response body, so an interposing CDN or proxy may replace it;
- an equivalent typed RFC 7807 refusal remains available on a non-navigation surface for programmatic consumers.
Every non-navigation surface — fetch/XHR, the SDKs, the CLIs and service-to-service calls — returns RFC 7807 Problem Details unconditionally. No error type documented on the pages below is retired, renumbered or made unavailable to a programmatic caller by the redirect projection.
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
- Key Protection Backend Not Configured - The key-protection backend setup has not been completed; carries
setupState, noRetry-After - 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
- Key Operations Narrowing Forbidden - Rotation may only preserve or widen the current material's
key_ops, never narrow it - 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
- Key Protection Rate Limited - Too many key-protection operations; retryable after the
Retry-Afterinterval
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
A 500 means the platform could not attribute the failure to your request. It is a server fault, and it is not retryable — a transient condition is reported as a 503 with Retry-After, never as a 500. A condition that has an owning error type is reported as that type, with its own status.
- 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
- Key Protection Backend Unavailable - The key-protection backend is bound but momentarily unreachable; retryable, sends
Retry-After - Key Protection Backend Misconfigured - The key-protection backend is not usable as configured; durable, deliberately sends NO
Retry-After - 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
- 500 errors: NOT retryable. A
500is an unattributable server fault, not a transient one — the identical request produces the identical result. Record the correlation identifier and report it instead - 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: Retryable when a
Retry-Afterheader is present — wait the stated delay. A503withoutRetry-Aftersignals a durable misconfiguration (for examplekey-protection-backend-misconfigured) and must not be retried: retrying re-presents the same bad configuration, and against a PKCS#11 token a repeated wrong PIN locks the token's user PIN - 429 errors: Honor the
Retry-Afterheader before retrying
Retrying a 503 is more aggressive than retrying a 500
In the AnkaSecure SDK and CLI, 502, 503 and 504 classify as a transient server error — three automatic retries, no prompt — while a 500 classifies as a plain server error with two retries behind a prompt. Several key-protection conditions that used to surface as a 500 now surface as a 503, which means they draw more automatic client traffic, not less. Honor Retry-After, and treat a 503 that carries no Retry-After as non-retryable.
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
This pattern applies to API errors — every response carrying an application/problem+json body. It does not apply to the browser-redirect error surface, which has no body and therefore no type to dispatch on; those failures are read from the error query parameter by the console, not by a programmatic client.
// 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