Skip to main content

Error codes

Talos returns structured error responses following the herodot error format. Every error response includes an id, HTTP status code, status text, and a human-readable message.

Error response format

{
"error": {
"code": 400,
"status": "Bad Request",
"message": "The API key format is invalid.",
"reason": "Additional context about the error"
}
}

Application errors

Error IDHTTPgRPCDescription
bad_request400INVALID_ARGUMENTThe request was malformed or contained invalid parameters
credential_required400INVALID_ARGUMENTA credential is required.
derived_token_not_revocable400INVALID_ARGUMENTDerived tokens cannot be revoked.
invalid_api_key_format400INVALID_ARGUMENTThe API key format is invalid.
invalid_token_type400INVALID_ARGUMENTThe token type is invalid.
unknown_credential400INVALID_ARGUMENTThe credential type is not recognized.
api_key_expired401UNAUTHENTICATEDThe API key has expired.
api_key_revoked401UNAUTHENTICATEDThe API key has been revoked.
parent_key_invalid401UNAUTHENTICATEDParent key validation failed.
signature_invalid401UNAUTHENTICATEDSignature verification failed.
unauthorized401UNAUTHENTICATEDThe request could not be authorized
forbidden403PERMISSION_DENIEDThe requested action was forbidden
ip_not_allowed403PERMISSION_DENIEDThe request IP is not allowed for this API key.
payment_required403PERMISSION_DENIEDThe feature is not available and requires payment.
api_key_not_found404NOT_FOUNDThe API key was not found.
not_found404NOT_FOUNDThe requested resource could not be found
api_key_exists409ALREADY_EXISTSAn API key with this identifier already exists.
conflict409ALREADY_EXISTSThe resource could not be created due to a conflict
failed_precondition409FAILED_PRECONDITIONThe operation cannot be completed due to a failed precondition.
too_many_requests429RESOURCE_EXHAUSTEDThe request was throttled due to resource exhaustion.
internal_server_error500INTERNALAn internal server error occurred, please contact the system administrator
service_unavailable503UNAVAILABLEThe service is temporarily unavailable.
gateway_timeout504DEADLINE_EXCEEDEDThe operation timed out.

Standard HTTP errors

Error IDHTTPDescription
Standard bad_request400Generic validation error
Standard unauthorized401Authentication required
Standard forbidden403Insufficient permissions
Standard not_found404Resource not found
Standard conflict409Resource conflict
Standard internal_server_error500Unexpected server error

Verification error codes

The VerifyAPIKey response includes an error_code enum when verification fails:

CodeMeaning
VERIFICATION_ERROR_UNSPECIFIEDNo error (key is valid)
VERIFICATION_ERROR_INVALID_FORMATCredential format is invalid
VERIFICATION_ERROR_EXPIREDCredential has expired
VERIFICATION_ERROR_REVOKEDCredential has been revoked
VERIFICATION_ERROR_NOT_FOUNDCredential not found in database
VERIFICATION_ERROR_SIGNATURE_INVALIDCryptographic signature verification failed
VERIFICATION_ERROR_INTERNALInternal server error during verification
VERIFICATION_ERROR_IP_NOT_ALLOWEDRequest IP is not in the key's allowed CIDR ranges
VERIFICATION_ERROR_RATE_LIMITEDRate limit quota exhausted (commercial-only)

Batch import error codes

The BatchImportAPIKeys response includes per-item error codes:

CodeMeaning
BATCH_IMPORT_ERROR_UNSPECIFIEDNo error (import succeeded)
BATCH_IMPORT_ERROR_INVALID_ARGUMENTThe key data is malformed or missing required fields
BATCH_IMPORT_ERROR_ALREADY_EXISTSA key with this identifier already exists
BATCH_IMPORT_ERROR_FAILED_PRECONDITIONState conflict prevents the import
BATCH_IMPORT_ERROR_INTERNALServer error during import

Error handling recommendations

  • 4xx errors: Fix the request and retry. Do not retry without changes.
  • 409 Conflict: Check if the resource already exists or is in an incompatible state.
  • 5xx errors: Retry with exponential backoff and jitter.
  • 503 Service Unavailable: The server is temporarily overloaded. Retry after the Retry-After header value if present.