Error Codes
The Forth API uses conventional HTTP response codes to indicate the success or failure of an API request. In general, response codes fall into these categories:
- 2xx (Success): The request was successfully received, understood, and accepted.
- 4xx (Client Error): The request failed due to an issue on your end (e.g., missing parameter, invalid data, lack of permissions).
- 5xx (Server Error): An unexpected error occurred on Forth’s servers. These are rare, but if you encounter one, please check our status page or contact our support team.
Here are some common error codes you may encounter:
400 | Bad Request | The request is malformed or contains invalid parameters. | Missing parameters, invalid JSON format, incorrect data types. | Validate request parameters, check JSON structure, and ensure required fields are included. |
401 | Unauthorized | Authentication is missing or invalid. | Missing API key, expired token, incorrect credentials. | Include a valid API key, a refresh authentication token, and verify credentials. |
403 | Forbidden | Client lacks permission to access the resource. | Insufficient user permissions, resource restrictions. | Ensure user has the required permissions, check access control settings. |
404 | Not Found | The requested resource does not exist. | ||
405 | Method Not Allowed | HTTP method is not allowed for the endpoint. | Using GET instead of POST, or vice versa. | Use the correct HTTP method per the API documentation. |
429 | Too Many Requests | Too many requests hit the API too quickly | Exceeding rate limits | Examine rate limit headers, avoid aggressive retries, ID high-volume processes, and optimize if possible, Exponential backoff of your requests. |
500 | Internal Server Error | An unexpected error occurred on the server. | Server misconfiguration, unhandled exceptions. | Check server logs, debug application code. |
502 | Bad Gateway | Server received an invalid response from an upstream server. | API gateway issues, backend server down. | Check backend server health, retry request. |
503 | Service Unavailable | Server is overloaded or under maintenance. | High traffic, scheduled maintenance. | Retry after some time, check the API status page. |
504 | Gateway Timeout | Server did not receive a timely response from an upstream server. | Slow database query, network congestion. | Optimize backend response times, increase timeout threshold. |
What made this section unhelpful for you?
On this page
- Error Codes