/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
2xxrange indicate success. - Codes in the
4xxrange indicate a problem with the request. These are fixable using the information in the error response. - Codes in the
5xxrange 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 andcode. 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.
