Moderation API uses conventional HTTP response codes to indicate the success or failure of an API request. In general: Codes in the 2xx range indicate success. Codes in the 4xx range indicate an error that failed given the information provided (e.g., a required parameter was omitted or is formatted incorrectly, etc.). Codes in the 5xx range indicate an error with Moderation API’s servers.
|Bad Request — The request was unacceptable, often due to missing a required parameter.
|Unauthorized — No valid API key provided.
|Forbidden — The API key doesn’t have permissions to perform the request, or your quota is used and you need to upgrade.
|Not Found — The specified resource could not be found.
|Method Not Allowed — You tried to access a resource with an invalid method.
|Too Many Requests — See rate limits
|Internal Server Error — We had a problem with our server. Try again later.
|Service Unavailable — We’re temporarily offline for maintenance. Please try again later.
Error responses are returned with a JSON object with the following signature:
The error code.
A human-readable message providing more details about the error.
An array of issues that caused the error. For example input fields that are invalid.
Our API can return errors for many reasons, such as a authentication errors, and network unavailability. We recommend writing code that gracefully handles all possible API errors to avoid making your own service unavailable.