Skip to main content

Error Handling

All errors include an error field in the response body.

HTTP Status Codes​

StatusMeaning
200Success
400Bad request - invalid input or missing required fields
401Unauthorized - missing or invalid API key
429Rate limited - too many requests
500Server 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