Partner API
Integration guide for analytics platforms, CRMs, and lead buyers who want to connect with Lead Distro AI via API. Covers lead ingest, ping-post, outcome webhooks, and the lead update endpoint.
Overview
The Lead Distro AI Partner API lets external platforms exchange lead data, push post-delivery updates, and receive real-time events. It is designed for analytics platforms (like Attribute), CRMs (Salesforce, HubSpot, GHL), affiliate networks, and any system that needs bi-directional data flow with a lead distribution pipeline.
There are two directions of data flow: inbound (your platform sends data to Lead Distro AI) and outbound (Lead Distro AI sends events to your platform via webhooks).
| Endpoint | Use Case |
|---|---|
| POST /api/v1/ingest | Send new leads into Lead Distro AI for distribution |
| POST /api/v1/ping | Real-time bid request (ping-post protocol) |
| POST /api/v1/lead-update | Update a lead after delivery: outcome, sales rep, speed-to-lead, call metrics, revenue |
Lead Distro AI can also send events to your platform via outbound webhooks. See the Outbound Webhooks section below.
Authentication
All Partner API endpoints authenticate with a Supplier API Key passed in the x-api-key header. Each supplier gets a unique API key when created in the dashboard. The key scopes all operations to the supplier's organization.
x-api-key: YOUR_SUPPLIER_API_KEYLead Ingest (POST /api/v1/ingest)
Send new leads into Lead Distro AI for validation, scoring, and distribution to buyers. Accepts both JSON and form-encoded bodies.
curl -X POST https://www.leaddistro.ai/api/v1/ingest \
-H "x-api-key: YOUR_SUPPLIER_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"flo_campaign_id": "campaign-uuid",
"flo_supplier_id": "supplier-uuid",
"first_name": "Jane",
"last_name": "Doe",
"phone": "5551234567",
"email": "jane@example.com",
"state": "TX",
"zip_code": "75001"
}'Required fields: flo_campaign_id, flo_supplier_id, first_name, last_name, phone, email. Additional fields depend on the campaign's field mapping configuration.
Response (201): Returns success: true, lead_id, status, price, and distribution details (buyer name, delivery result). For ping-post campaigns, also includes the deliveries array with per-buyer bid and delivery status.
Ping Endpoint (POST /api/v1/ping)
For ping-post campaigns, the ping endpoint lets suppliers submit partial lead data to get real-time bids from buyers before committing the full lead. The response includes the BAM (Bid After Margin) price and a ping_id token used in the follow-up POST.
curl -X POST https://www.leaddistro.ai/api/v1/ping \
-H "x-api-key: YOUR_SUPPLIER_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"flo_campaign_id": "campaign-uuid",
"flo_supplier_id": "supplier-uuid",
"state": "CA",
"zip_code": "90210"
}'Ping payloads must NOT include PII (first_name, last_name, SSN, date of birth, street address). The endpoint rejects requests with PII fields and returns a 400 error listing the offending fields.
Response (200, accepted): accepted: true, ping_id, price (BAM), expires_at (5-minute TTL). Use the ping_id in the follow-up /api/v1/ingest POST to complete the transaction.
Lead Update (POST /api/v1/lead-update)
Push post-delivery data back to Lead Distro AI. This is the primary integration point for analytics platforms, CRMs, and any system that tracks what happens after a lead is delivered. Accepts fields like sales rep, speed-to-lead, call count, outcome, and revenue.
curl -X POST https://www.leaddistro.ai/api/v1/lead-update \
-H "x-api-key: YOUR_SUPPLIER_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"lead_id": "lead-uuid",
"call_outcome": "appointment_set",
"call_outcome_raw": "Requested Appointment",
"sales_rep": "John Smith",
"outcome": "converted",
"revenue": 2500.00,
"note": "Signed retainer agreement"
}'| Field | Type | Required | Description |
|---|---|---|---|
| lead_id | UUID | Yes | The Lead Distro AI lead ID |
| call_outcome | enum | No | Standardized call result. Each call event increments the call count automatically. Values: no_answer, voicemail, contacted, not_interested, wrong_number, follow_up, appointment_set, disconnected, busy. |
| call_outcome_raw | string | No | The original label from your dialer (e.g. "VM - Left Message"). Stored for reference alongside the standardized call_outcome. |
| sales_rep | string | No | Name of the sales rep who handled this lead |
| outcome | enum | No | Updates the lead outcome: converted, not_qualified, or pending. Triggers billing and Meta CAPI events. |
| revenue | number | No | Actual revenue the buyer generated from this lead |
| note | string | No | Free-text note attached to the lead (max 2000 chars) |
| external_id | string | No | Your platform's internal ID for cross-referencing |
| metadata | object | No | Arbitrary key-value pairs merged into the lead's data |
| idempotency_key | string | No | Prevents duplicate processing on retries |
Speed-to-lead and call count are computed automatically. When the first call_outcome event arrives, Lead Distro AI calculates how many seconds elapsed since the lead was delivered and stores it as speed_to_lead_seconds. Every subsequent call event increments the call_count. You don't need to track or send these values.
Response (200): Returns success: true, lead_id, external_id, outcome (with change details), call_count, speed_to_lead_seconds, and fields_updated.
There is also a buyer-scoped endpoint at POST /api/webhooks/buyer-outcome that uses an X-Buyer-Secret header instead of an API key. It only updates leads assigned to that buyer and supports matching by phone or email. Use it when a buyer's CRM needs a dedicated webhook. For new integrations, /api/v1/lead-update is the recommended endpoint since it accepts all the same fields plus more.
Outbound Webhooks (Lead Distro AI to Your Platform)
Lead Distro AI sends lead events to your platform via automation webhooks. Agencies configure these per campaign in the Automations section. No code changes needed on the Lead Distro AI side.
| Trigger Event | When It Fires | Use Case |
|---|---|---|
| lead.created | New lead ingested | Sync all leads to your analytics platform |
| lead.accepted | Lead distributed to a buyer | Track sold leads and buyer assignments |
| lead.rejected | No buyer accepted the lead | Track unsold inventory |
| lead.converted | Lead marked as converted | Sync conversions back to ad platforms |
| lead.status_changed | Any status transition | Real-time status sync for all events |
Webhooks are HTTP POST requests with a JSON payload containing all lead fields, campaign context, buyer/supplier details, UTM data, and custom fields from the campaign's field mapping. Outbound webhooks include an HMAC-SHA256 signature in the X-LeadDistro-Signature header for verification. See the Webhook Signing doc for verification recipes.
Rate Limits
| Endpoint | Limit | Key |
|---|---|---|
| POST /api/v1/ingest | 100 req/min | Per API key |
| POST /api/v1/ping | 100 req/min | Per API key |
| POST /api/v1/lead-update | 120 req/min | Per API key |
Rate-limited responses return HTTP 429 with a Retry-After header (seconds). Back off and retry after the indicated delay. For high-volume integrations, contact support for limit increases.
Error Codes
| Status | Meaning | Action |
|---|---|---|
| 200 | Success | Request processed. Check the response body for details. |
| 201 | Created | Lead was created and distributed. |
| 400 | Bad Request | Validation failed. Check the error message and fix the payload. |
| 401 | Unauthorized | Missing or invalid API key / buyer secret. |
| 404 | Not Found | Lead, campaign, or supplier not found. |
| 409 | Conflict | Duplicate lead detected, or ping session already consumed. |
| 410 | Gone | Ping session expired (5-minute TTL). |
| 429 | Rate Limited | Too many requests. Wait and retry after the Retry-After period. |
| 500 | Server Error | Internal error. Retry with exponential backoff. |
Frequently Asked Questions
Which endpoint should I use to send lead updates?
Can I send leads to Lead Distro AI and receive updates back?
How do I match leads between systems?
lead_id (UUID) in the ingest response. Store this ID on your side. When pushing updates, pass it as lead_id. You can also store your own ID in external_id for cross-referencing. The outcome webhook additionally supports matching by phone + campaign_id or email + campaign_id.What happens when I push a field that already has a value?
Is there a sandbox or test environment?
test_lead: true (or flo_test_mode: true) in the ingest payload. Test leads flow through validation and distribution but are tagged and excluded from billing and Meta CAPI events. You can also use the in-app Test Send tool to simulate ingestion without an API call.What content types does the ingest endpoint accept?
application/json and application/x-www-form-urlencoded. Form-encoded is recommended for Zapier, Make, and webhook-based integrations. JSON is recommended for direct API integrations.Related Articles
If you have any questions, send us an email at support@leaddistro.ai