API Authentication
Authenticate Lead Distro AI API requests with the supplier x-api-key header. Key generation, rotation, 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.
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](/docs/api-response-codes) 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?
Can I use Bearer token authentication instead of x-api-key?
What's the difference between 401 and 403 on the ingest endpoint?
Can I rotate an API key without breaking the integration?
How do I rate-limit suppliers that misbehave?
Are API requests authenticated over TLS?
Related Articles
If you have any questions, send us an email at support@leaddistro.ai