Errors

When something goes wrong with an API request, our server generates an error. The error message contains an appropriate HTTP status code in the header and a JSON response in the body.

Errors share the same common attributes as other API resources. They have a sys property, where sys.type is always "Error" and a sys.id that identifies the exact error code (see table below) that occurred. They always have a message property which will be a short description of what went wrong.

Errors resulting from bad input (such as ValidationFailed errors) contain a details property. This property is structured data that indicates more precisely what was wrong with the input.

Error types

HTTP status codeError codeDescription
400 Bad RequestBadRequestThe request was malformed or missing a required parameter.
400 Bad RequestInvalidQueryThe request contained invalid or unknown query parameters.
401 UnauthorizedAccessTokenInvalidThe authorization token was invalid.
403 ForbiddenAccessDeniedThe user tried to access a resource they do not have access to. This could include a missing role.
404 Not FoundNotFoundThe requested resource or endpoint could not be found.
409 ConflictVersionMismatchThis error occurs when you’re trying to update an existing asset, entry or content type, and you didn’t specify the current version of the object or specified an outdated version.
422 Unprocessable EntityValidationFailedThe request payload was valid JSON, but something was wrong with the data. The error details should provide more specific information about the error.
422 Unprocessable EntityUnknownFieldThe triggered query references an unknown field.
422 Unprocessable EntityInvalidEntryThe entered value is invalid.
429 Too Many RequestsRateLimitExceededThe user sent too many requests in a given timeframe. See API Rate limits for details.
500 Internal Server ErrorServerErrorSomething went wrong on the Contentful servers.
502 Bad GatewayHibernatedThe space has not been accessed for a long time and has been “hibernated” in a saved state. This error should resolve on its own in a few moments, once the space has been successfully awakened.

Next steps