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:The broad category of the error. One value per HTTP status. See
Statuses.
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.The problems with the request body, when it fails validation. Each issue has
a
message and the path of the field.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.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
codefor errors you handle in a specific way, for examplequota_exceeded. Fall back totypefor codes you don’t know. - Retry
429and5xxresponses with exponential backoff. For429, wait at least the seconds in theRetry-Afterheader. - Don’t retry other
4xxresponses without a change to the request. - Log
request_id, so that support can find the request.