Referral Factory's API uses the following error codes:

Error CodeMeaning
400Bad Request -- Your request is invalid.
401Unauthorized -- Your API key is incorrect.
403Forbidden -- The resource requested is marked for administrators only.
404Not Found -- The specified resource could not be found.
405Method Not Allowed -- You tried to access a resource with an invalid method.
406Not Acceptable -- You requested a format that isn't in JSON format.
410Gone -- The resource requested has been removed from the data server.
429Too Many Requests -- You're requesting too many resources at one time.
500Internal Server Error -- We had a problem with our server. Please try again later.
503Service Unavailable -- We're temporarily offline for maintenance. Please try again later.

Errors should be returned as JSON structured like this:

    {
        "code": 422,
        "message": "Validation errors in your request",
        "errors": {
            "email": [
                {
                    "field": "email",
                    "message": "The email field is required."
                }
            ]
        }
    }