Errors
Error Responses
The Fenerum API uses standard HTTP response codes to indicate the success or failure of an API request.
HTTP Status Codes
- 2xx - Success: The request was successful
- 4xx - Client Error: There was an error with the request (e.g., missing parameters, authentication failure)
- 5xx - Server Error: Something went wrong on Fenerum's servers
Common Status Codes
| Status Code | Meaning |
|---|---|
| 200 | OK - Request succeeded |
| 201 | Created - Resource was successfully created |
| 204 | No Content - Request succeeded with no response body |
| 400 | Bad Request - Invalid request parameters |
| 401 | Unauthorized - Authentication failed or missing |
| 403 | Forbidden - Authenticated but not authorized |
| 404 | Not Found - Resource doesn't exist |
| 429 | Too Many Requests - Rate limit exceeded |
| 500 | Internal Server Error - Something went wrong on our end |
Error Response Format
When an error occurs, the API returns a JSON object with details:
{
"detail": "Error description",
"field_name": ["Specific field error messages"]
}Field-Specific Errors
For validation errors, the response includes field-specific error messages:
{
"email": ["This field is required."],
"amount": ["Ensure this value is greater than or equal to 0."]
}Best Practices
- Always check the HTTP status code before parsing the response
- Log error responses for debugging
- Handle rate limiting errors with exponential backoff
- Display user-friendly messages for validation errors