Getting started
Go-live checklist
Twelve checks before a live API key goes to production: key storage and scope, startup check, timeouts, retries, statuses, balance alerts and logging.
Run through this list before you put a live key in production. Each item takes a few minutes and prevents a failure that costs money, leaks data or turns real users away. Each one links to the page that explains it.
Before you switch to a live key
-
Keep the live key in a secret store. Put it in your secret manager or your platform's encrypted environment variables, never in source code, a client bundle or a mobile app. Your frontend calls your backend, and only your backend calls the API. See Keep keys secret.
-
Restrict the key to the endpoints it calls. A key limited to
emailcannot start a bulk job if it leaks. In the dashboard, choose Only some under Access when you create the key, and includeaccountif the service runs the startup check. See Restricted keys. -
Use one key per service and environment. Name each key after where it runs, such as
signup-service-production. You can then rotate or revoke one key without touching the others. See Rotate a key. -
Check the key mode at startup. Call
GET /account, which is free, and stop the service if production runs with a key whosekey.modeis notlive. A test key in production accepts simulated answers as real. See Check which key a service runs with. -
Set a client timeout on every call. A full-mode email check waits for the recipient's mail server, and a VAT check waits for VIES, which can take longer than 12 seconds when it is busy. About 15 seconds suits a full-mode email check; run VAT checks in the background when you can. See the email and VAT references.
-
Retry
429afterRetry-After, and only retry what can succeed. Wait the number of seconds in theRetry-Afterheader on a429. Retry500and502with backoff. Never retry400,401,402,403,404or422: they fail the same way every time. See Retry correctly. -
Handle every status and reason. Branch on
status, then onreasonwhere the endpoint has one, and onerror.typefor errors, never onerror.message. Each reference page has a table of statuses with what to do, such as the email statuses. See Handle errors in code. -
Never block a user on
unknown. Anunknownemail means the checks could not conclude, for example because the mail server did not answer in time or asked to retry later. Accept the address and confirm it another way, or check again later. Do the same when the API itself fails: fail open, let the user through and check in the background. See Validate signup forms. -
Get warned before the balance runs out. Subscribe to the
credits.lowwebhook, which fires when the balance falls under 10% of your plan's monthly credits, and check that the low-balance email goes to someone who reads it. Turn on auto top-up if a stop would hurt. See Get warned before the balance runs out and Webhooks. -
Monitor
X-Credits-Remaining. Every response carries your balance after the call. Send it to your metrics and alert under a threshold that leaves you time to react. At zero, calls fail with402 insufficient_credits. See Credits. -
Log
X-Request-Idand the resultid. Every response has anX-Request-Idheader, and every check result has anidstarting withlkp_. Log them with failures and with results you may need to discuss: support can find a request from them without you sending the data you checked. See Response headers. -
Send only the data you need. Use
fastemail mode when you do not need the mailbox check, thebasicphone level when you do not need the current carrier, and upload only the column to check in bulk jobs. Do not log full email addresses or phone numbers on your side either. See Send less data.
After launch
- Watch the dashboard. The logs page lists each call with its status and outcome for 30 days, and the usage page shows credits per day and per endpoint.
- Follow incidents on the status page.
- Store results with your records so the same value is not checked twice: cached results cost the same as fresh ones. See Caching.
- Ask for help at support@qelka.com with the
X-Request-Idof the call in question.