Skip to main content
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.

Response signature

Error responses are returned with a JSON object with the following signature:
string
required
The error code. BAD_REQUEST, UNAUTHORIZED, FORBIDDEN, NOT_FOUND, METHOD_NOT_ALLOWED, TOO_MANY_REQUESTS, INTERNAL_SERVER_ERROR, SERVICE_UNAVAILABLE
string
required
A human-readable message providing more details about the error.
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.