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.

Error CodeMeaning
400Bad Request — The request was unacceptable, often due to missing a required parameter.
401Unauthorized — No valid API key provided.
403Forbidden — The API key doesn’t have permissions to perform the request, or your quota is used and you need to upgrade.
404Not Found — The specified resource could not be found.
405Method Not Allowed — You tried to access a resource with an invalid method.
429Too Many Requests — See rate limits
500Internal Server Error — We had a problem with our server. Try again later.
503Service Unavailable — We’re temporarily offline for maintenance. Please try again later.

Response signature

Error responses are returned with a JSON object with the following signature:

code
string
required

The error code. BAD_REQUEST, UNAUTHORIZED, FORBIDDEN, NOT_FOUND, METHOD_NOT_ALLOWED, TOO_MANY_REQUESTS, INTERNAL_SERVER_ERROR, SERVICE_UNAVAILABLE

message
string
required

A human-readable message providing more details about the error.

issues
array

An array of issues that caused the error. For example input fields that are invalid.

Handling errors

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.

Was this page helpful?