API setup
Errors
Every error is { error: { code, message, details?, docs_url, request_id } } with the matching HTTP status. Branch on code; the message is for people and can change.
The error shape
402 example
{
"error": {
"code": "credits.insufficient",
"message": "Not enough credits: need 2, have 1",
"details": {
"need": 2,
"have": 1
},
"docs_url": "https://leadlayer.com/docs/errors",
"request_id": "req_Jx4mT0pQa9cL"
}
}Codes
400
request.invalidA field is missing, unknown, mistyped or out of range, a range's min is over its max (details.code min_gt_max), a seniority, department or industry the search does not know, in include or exclude (details.code unknown_value; details.values names up to 10, each cut to 80 characters, with control characters and Unicode direction marks replaced by U+FFFD, details.count says how many there were when more than 10, details.side says include or exclude; GET /v1/filters lists the terms), a filter's data is not loaded yet (details.field names it), or a page is past the 10,000-result reach; the message names it.400
request.invalid_jsonThe body is not a JSON object.401
auth.missing_keyNo key in x-api-key. A browser session is not accepted.401
auth.invalid_keyThe key is wrong or revoked, or its maker left the team or became a member.402
credits.insufficientNot enough credits. details.need and details.have say how many. Nothing was charged.403
plan.upgrade_requiredEmails through the API (the emails endpoints, reveal_email) or a paid filter (revenue, revenue_known, funding, founded_year, ownership, sic_codes, naics_codes, technologies, experience_years, time_in_role_days, work_urls) need a paid plan; for a filter, the message and details.fields name the ones sent.403
auth.scope_deniedThe key does not have this endpoint's scope.403
auth.forbiddenThe key maker's seat is paused.404
resource.not_foundNo such person, company or job on this account.404
request.unknown_endpointNo endpoint at this path. The message names the method and path.405
request.method_not_allowedThe endpoint does not take this method. The Allow header names the ones it takes.409
request.in_progressA request with this Idempotency-Key is still running.422
request.idempotency_mismatchThis Idempotency-Key was used with a different body.429
usage.rate_limitedToo fast for this key, or too many of its calls running at once (details.busy is true, and the message says how many may run). Wait Retry-After seconds.429
usage.daily_limitThe seat's daily allowance is used. Retry-After says how long until midnight UTC.500
server.errorSomething broke on our side. Nothing was charged; quote the request id.