Errors

TIDY uses conventional HTTP response codes to indicate the success or failure of an API request. In general: Codes in the 2xx range indicate success. Codes in the 4xx range indicate an error that failed given the information provided (e.g., a required parameter was omitted, a job failed, etc.). Codes in the 5xx range indicate an error with Tidy's servers.

HTTP Status Codes

CODEDESCRIPTION
400 - Bad RequestThe request was unacceptable, often due to missing a required parameter.
401 - UnauthorizedNo valid API Key provided.
402 - Request FailedThe parameters were valid but the request failed. (e.g. a job failed)
403 - ForbiddenThe API key doesn't have permissions to perform the request.
404 - Not FoundThe requested resource doesn't exist.
429 - Too Many RequestsToo many requests hit the API too quickly.
500, 502, 503, 504 - Server ErrorsSomething went wrong on TIDY's side.

Error codes

Every error has a Type and a Code. Type is more generic and could be used to handle a group of errors and Code is a more specific error.

CODETYPEDESCRIPTION
AuthenticationErrorauthentication_errorThis action requires authentication and your request did not have either an incorrect or invalid API Key.
InvalidParamsErrorinvalid_request_errorOne or more parameters you sent are not valid. Try checking the documentation to ensure that you have all of the required params.
ResourceNotFoundErrorinvalid_request_errorA parameter, usually an ID, sent to use in a lookup has returned no records. Usually it means that the wrong ID or parameter was sent.
RateLimitErrorrate_limit_errorYou have exceeded the maximum attempts in a period of time. Check our documentation for more information.
UnexpectedErrorapi_errorAn unexpected error occurred. Try again and if it persists, please reach out to support.

Error Object format

The Error Object has the following attributes:

{
  "object"         : "error",
  "type"           : "{type of the error}",
  "code"           : "{code of the error}",
  "message"        : "{message of the error}",
  "invalid_params" : [],
  "more_info"      : "{error_documentation_url}",
}

Examples

# When the `zipcode` param is invalid.

{
  "object"         : "error",
  "type"           : "invalid_request_error",
  "code"           : "InvalidParamsError",
  "message"        : "One or more parameters you sent are not valid. Try checking the documentation to ensure that you have all of the required params.",
  "invalid_params" : [{ "zipcode" : "not a valid USPS zip code." }],
  "more_info"      : "{error_documentation_url}",
}