Skip to main content
Moderation API uses conventional HTTP statuses. Codes in the 2xx range mean success. Codes in the 4xx range mean the request failed because of the information you sent, for example a missing parameter or an invalid API key. Codes in the 5xx range mean a problem on our side.

Response format

Every error response has the same JSON body:
string
required
The broad category of the error. One value per HTTP status. See Statuses.
string
required
Exactly what went wrong. Use this field when your code must react to a specific error. See Error codes. We can add new codes, so handle codes you don’t know by their type.
string
required
A human-readable explanation. Don’t parse it; the text can change.
array
The problems with the request body, when it fails validation. Each issue has a message and the path of the field.
string
required
Identifies the request. Every response, also a successful one, has the same value in the X-Request-Id header. Include it when you contact support.
string
required
A link to the explanation of the code on this page.
A request body that fails validation returns the problems in issues:

Statuses

Error codes

400 Bad request

401 Unauthorized

403 Forbidden

404 Not found

Other statuses

Handling errors

Write code that handles every error, so that a failed request doesn’t make your own service unavailable:
  • Use code for errors you handle in a specific way, for example quota_exceeded. Fall back to type for codes you don’t know.
  • Retry 429 and 5xx responses with exponential backoff. For 429, wait at least the seconds in the Retry-After header.
  • Don’t retry other 4xx responses without a change to the request.
  • Log request_id, so that support can find the request.