Docs/Getting started

Errors

When a request fails, the API answers with an HTTP status code and a JSON body that says why:

JSON
{ "error": "campaign not found" }

The error message is written for a person to read. Some endpoints add fields your code can check, such as a stable code. Each endpoint's page in the API reference lists the statuses it can return.

Each status code means one kind of problem

StatusMeaningRetry?
400Something in the request is wrong: a missing field, a bad value or a body that isn't valid JSON. Read the message.No, fix the request
401The API key is missing, wrong, paused or expired. Authentication lists every message.No
402A payment or plan limit, such as no card on file, a failed payment, no email account seats left or a used-up trial allowance.No, until the account changes
403Your key or plan can't do this: a read-only key calling a write endpoint, or a feature that needs an add-on or a higher plan.No
404Not found. Items that belong to another workspace also answer 404, so a key never learns what other workspaces hold.No
409A conflict with the current state, such as a campaign still processing leads, a duplicate done-for-you order or a draft that can't be sent.After the state changes
422The request is valid but can't be done, such as adding leads past your plan's contact limit.No
429Too many requests on an endpoint with its own limit. See Rate limits.Yes, after Retry-After
500Something went wrong on our side.Yes, with backoff
502A service we depend on failed, for example a mailbox provider during a connection test.Yes, with backoff
503Temporarily unavailable.Yes, later

Some endpoints add a machine-readable code

EndpointExtra fieldsCodes to check
POST /credits/purchasecodebilling_required (402), payment_failed (402), credits_free (409), temporarily_unavailable (503), purchase_incomplete and purchase_unconfirmed (500)
Inbox Placement endpointscode, tierinbox_placement_required and inbox_placement_hypergrowth_required (403)
Lead Finder endpointsreason, field, value, retryAfterSeconds and morerate_limited and budget_exhausted (429)
Email verification jobsmessage, needed_usd, available_usd, allowance, remainingtrial_allowance_exceeded (402)
POST /dfy/ordersexistingOrderIdA 409 when the same order is already in progress

Do not retry purchase_incomplete on POST /credits/purchase: the payment may have gone through. Check GET /credits/transactions first.

Three answers are not JSON objects

  • A wrong path or method answers 404 with the plain text 404 page not found. Check the method and that the path starts with /r.
  • API key errors have a JSON body but a Content-Type of text/plain. Parse the body as JSON anyway.
  • An unexpected crash answers 500 with the plain text Internal Server Error.

Retry safely

Retry 429, 500, 502 and 503 with a growing wait between tries. Before retrying a call that creates or buys something, check whether the first try worked: POST /campaigns and POST /webhooks create a second item on every call, and POST /credits/purchase charges your card every time. POST /dfy/orders accepts an Idempotency-Key header, so the same key never orders twice.

Questions about the API? Email support@emailchaser.com.