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 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