Errors

Errors are reported by returning one of the following HTTP status codes:

  • 401, 403: The access was denied
  • 404: The resource doesn’t exist
  • 400: Invalid input (query string, post, etc)
  • 429: Rate limited
  • 402: Payment required

In addition, POST and PUT requests may return error details in JSON format along with the 400 status code:

{
    "form": {
        "errors": ["optional array of request-wide error messages"],
        "children": {
            "field_name_0": {
                "errors": ["optional array of field-specific error messages"],
            },
            "field_name_n": {
                "..."
            }
        }
    }
}

These error messages should be displayed directly to the user when they are the result of a form submission.

For other methods, the body of an error would be html error message.