API Authentication
Authenticate Lead Distro AI API requests: the source x-api-key header for lead ingest and the organization API key (Bearer) for the Actions API. Key types, header format, error codes (401/403), and FAQs.
Authentication Model
Lead Distro AI's ingest API uses a per-supplier API key authentication model. Every request includes the key in the x-api-key HTTP header. The key identifies the supplier; the request body's flo_campaign_id specifies which campaign to route the lead into. The supplier must be attached to that campaign or the request returns 403.
Header Format
x-api-key: <your-supplier-api-key>The header name is case-insensitive per HTTP spec. The key value is treated as opaque — don't parse it; treat it as a single secret string.
Two kinds of key
| Key | Header | Who holds it | What it does |
|---|---|---|---|
| Source key | x-api-key: | A lead source (vendor, form, your own site) | Sends leads into one campaign and reads back its own leads. Found on the source detail page. |
| Organization API key | Authorization: Bearer ldk_live_... | Your team (admins create it in Settings, MCP & API) | Manages the account: campaigns, destinations, sources, leads, funnels, reports, Partner Portal. Powers the Actions API and the MCP. Permissions are set per area, read or write. |
A new organization API key is read only until you turn on Write for an area. Billing actions are never available to any key.
Error Codes
| Status | Reason | Fix |
|---|---|---|
| 401 Unauthorized | Header missing or key invalid | Check the header name (x-api-key), confirm the key matches what's on the supplier detail page |
| 403 Forbidden | Key valid but supplier not attached to the specified campaign | Attach the supplier to the campaign in the dashboard, or fix the flo_campaign_id in the request body |
| 429 Too Many Requests | Rate limit exceeded | Back off — see Rate Limits for the response headers indicating retry-after |
Authentication for Different Endpoints
| Endpoint | Auth required | Header |
|---|---|---|
| POST /api/v1/ingest | Yes | x-api-key |
| POST /api/v1/ping (V2) | Yes | x-api-key |
| GET /api/v1/leads/lookup | Yes | x-api-key (read-only scope) |
Server-to-server only. Never embed x-api-key in client-side JavaScript, mobile apps, or any code reachable from a browser — keys exposed to clients can be extracted within minutes by attackers and used to flood your campaign with junk leads.
Frequently Asked Questions
What HTTP header authenticates Lead Distro AI API requests?
x-api-key. Pass the supplier's API key as the value. The header is required on every POST to the ingest endpoint and every POST to the ping endpoint. Missing or invalid keys return 401; valid keys for the wrong campaign return 403.Can I use Bearer token authentication instead of x-api-key?
x-api-key. Bearer tokens (Authorization: Bearer ...) are not recognized and return 401. The simpler API-key model fits the supplier integration pattern; OAuth-style flows would add complexity without security benefit at this layer.What's the difference between 401 and 403 on the ingest endpoint?
flo_campaign_id. 401 = fix the key; 403 = attach the supplier to the campaign or fix the campaign ID.Can I rotate an API key without breaking the integration?
How do I rate-limit suppliers that misbehave?
Are API requests authenticated over TLS?
https:// URLs, never http://. TLS 1.2 minimum.Related Articles
If you have any questions, send us an email at support@leaddistro.ai