🔌 API Reference
Error Handling
Error codes and troubleshooting
Error Handling
The API uses conventional HTTP response codes and returns detailed error messages in JSON format.
HTTP Status Codes
| Code | Meaning |
|---|---|
200 | Success |
201 | Created |
400 | Bad Request - Invalid parameters |
401 | Unauthorized - Invalid or missing token |
403 | Forbidden - Insufficient permissions |
404 | Not Found |
429 | Too Many Requests - Rate limit exceeded |
500 | Internal Server Error |
Error Response Format
All error responses follow this structure:
{
"error": "error_code",
"message": "Human-readable error message",
"details": {
"field": "email",
"issue": "Email address is already registered"
}
}Common Error Codes
invalid_request- Malformed request body or parametersauthentication_failed- Invalid credentialstoken_expired- Access token has expiredinsufficient_permissions- User lacks required permissionsresource_not_found- Requested resource doesn't existvalidation_error- Input validation failedrate_limit_exceeded- Too many requests
Error Handling Best Practices
- Always check HTTP status codes
- Parse and display error messages to users
- Implement retry logic with exponential backoff
- Log errors for debugging
- Handle token expiration gracefully with refresh logic