Skip to main content
Every endpoint under the /v2 path returns errors in the shape described on this page. Endpoints on earlier versions keep their existing error format. See Errors for those. Lead uses HTTP status codes to indicate the success or failure of an API request.
  • Codes in the 2xx range indicate success.
  • Codes in the 4xx range indicate a problem with the request. These are fixable using the information in the error response.
  • Codes in the 5xx range indicate a problem on Lead’s side. These are rare and are usually safe to retry.

Error response

An error response has three parts: the HTTP status line, response headers, and a JSON body.

Headers

Body

What you can rely on

Build your error handling on the HTTP status and code. Together they’re stable: Lead treats any change to a status and code combination as a breaking change and announces it in advance. Fields in the right column may change without notice. Don’t parse message or errors[].message. Show them to developers, not end users.
You can branch on errors[].code for more specific error handling, but always fall back to code. If an errors[].code value changes or is removed, your integration should still handle the error correctly using code alone.

Error codes

V2 APIs return 26 codes. Each code always uses the same HTTP status.