Error Handling
QuantumSafe API returns structured error responses with consistent error codes. All errors follow this format:Error Code Reference
Authentication Errors (AUTH)
| Code | HTTP Status | Message | Resolution |
|---|---|---|---|
AUTH_001 | 401 | API key is missing or malformed | Include a valid API key in the Authorization: Bearer header |
AUTH_002 | 401 | API key is invalid or revoked | Check that your key is active in the dashboard |
AUTH_003 | 403 | Insufficient permissions | Publishable keys cannot access this endpoint. Use a Secret key |
AUTH_004 | 403 | Environment mismatch | Testnet key used against mainnet endpoint (or vice versa) |
AUTH_005 | 401 | Account suspended | Contact support |
Rate Limit Errors (RATE)
| Code | HTTP Status | Message | Resolution |
|---|---|---|---|
RATE_001 | 429 | Rate limit exceeded | Wait for the duration specified in Retry-After header |
PQC Errors (PQC)
| Code | HTTP Status | Message | Resolution |
|---|---|---|---|
PQC_001 | 400 | Unsupported algorithm | Use a supported algorithm: ml-dsa-44, ml-dsa-65, ml-dsa-87, slh-dsa-128s |
PQC_002 | 400 | Invalid key format | Ensure keys are hex-encoded and match the specified algorithm |
PQC_003 | 400 | Key generation failed | Retry the request. If persistent, check CSPRNG availability |
PQC_004 | 422 | Signature verification failed | The PQC or ECDSA signature does not match the provided message and public key |
Scanner Errors (SCAN)
| Code | HTTP Status | Message | Resolution |
|---|---|---|---|
SCAN_001 | 400 | Invalid address format | Check the address format for the specified chain |
SCAN_002 | 400 | Unsupported chain | See supported chains in the API reference |
SCAN_003 | 404 | Address not found | The address has no on-chain activity |
SCAN_004 | 503 | Chain data unavailable | The chain data provider is temporarily unavailable. Retry later |
Key Generation Errors (GEN)
| Code | HTTP Status | Message | Resolution |
|---|---|---|---|
GEN_001 | 400 | Invalid algorithm/chain combination | Check the algorithm compatibility matrix |
GEN_002 | 500 | Internal generation error | Retry the request. If persistent, contact support |
Handling Errors in SDKs
Both SDKs throw typed exceptions:Retry Strategy
For transient errors (5xx,SCAN_004, RATE_001), use exponential backoff: