Errors

All errors use this shape:

{
  "error": {
    "code": "insufficient_credits",
    "message": "Not enough credits to add this lead.",
    "details": {}
  }
}

Branch on error.code, not only HTTP status.

HTTP status

StatusWhen
200Success
400Validation
401Missing / invalid key
403Plan required, insufficient credits (normal or Lookalike), Sales Nav required, account disconnected
404Unknown campaign / lead
409Idempotency conflict, wrong campaign state for start/pause, or batch-delete while the campaign is still finding/importing leads
413Request body over 128 KiB
429Rate limit or LinkedIn daily quota
502 / 503Temporary upstream failure

A 400 also covers a malformed id in the path (for example a campaignId we cannot address); error.details.fields names the segment.

On POST .../leads, POST .../leads/batch, POST .../leads/batch-update, POST .../leads/batch-delete, POST /inbox/messages, and POST /campaigns/lookalike, a 503 may mean we could not record your Idempotency-Key. In that case nothing was performed — the message states so — and retrying the same key is safe.

Success bodies are top-level JSON (no { "data": ... } wrapper).

Error codes

CodeMeaning
unauthorizedBad or missing API key
plan_requiredPlan not eligible for API (or Lookalike blocked for workspace)
validation_errorBad body/query (unknown fields, bad URL, bad cursor)
not_foundUnknown resource
conflictIdempotency conflict, wrong campaign state (start/pause / batch-delete during lead import), or similar
insufficient_creditsNeed credits to insert lead
insufficient_lookalike_creditsNeed Lookalike allowance to create/extend (403)
lookalike_exhaustedNo more Lookalike results for this profile/titles/locations on this campaign (400)
account_disconnectedLinkedIn account not usable
sales_nav_requiredSales Nav search without SN, or SN session not usable (reconnect the LinkedIn account)
rate_limitedRPM / burst limit
linkedin_daily_quotaDaily LinkedIn quota
send_failedMessage send failed
upstream_unavailableTemporary failure