Error Handling
All errors include an error field in the response body.
HTTP Status Codes
| Status | Meaning |
|---|---|
200 | Success |
400 | Bad request - invalid input or missing required fields |
401 | Unauthorized - missing or invalid API key |
429 | Rate limited - too many requests |
500 | Server error |
Error Response Format
{
"error": "Description of what went wrong"
}
Common Errors
Missing API Key
# Request without Authorization header
curl -X POST https://www.toolbox-kit.com/api/v1/json-format \
-H "Content-Type: application/json" \
-d '{"json": "{}"}'
{ "error": "Missing or invalid API key" }
Invalid Input
# Request with missing required field
curl -X POST https://www.toolbox-kit.com/api/v1/hash \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_API_KEY" \
-d '{"algorithm": "sha256"}'
{ "error": "Missing required field: input" }
Rate Limited
{ "error": "Rate limit exceeded. Try again in 60 seconds." }
The response will also include rate limit headers so you can implement backoff:
X-RateLimit-Limit: 100
X-RateLimit-Remaining: 0
X-RateLimit-Reset: 1709913660