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.

Last updated:

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

EndpointUse Case
POST /api/v1/ingestSend new leads into Lead Distro AI for distribution
POST /api/v1/pingReal-time bid request (ping-post protocol)
POST /api/v1/lead-updateUpdate 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_KEY

Lead 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"
  }'
FieldTypeRequiredDescription
lead_idUUIDYesThe Lead Distro AI lead ID
call_outcomeenumNoStandardized 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_rawstringNoThe original label from your dialer (e.g. "VM - Left Message"). Stored for reference alongside the standardized call_outcome.
sales_repstringNoName of the sales rep who handled this lead
outcomeenumNoUpdates the lead outcome: converted, not_qualified, or pending. Triggers billing and Meta CAPI events.
revenuenumberNoActual revenue the buyer generated from this lead
notestringNoFree-text note attached to the lead (max 2000 chars)
external_idstringNoYour platform's internal ID for cross-referencing
metadataobjectNoArbitrary key-value pairs merged into the lead's data
idempotency_keystringNoPrevents 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 EventWhen It FiresUse Case
lead.createdNew lead ingestedSync all leads to your analytics platform
lead.acceptedLead distributed to a buyerTrack sold leads and buyer assignments
lead.rejectedNo buyer accepted the leadTrack unsold inventory
lead.convertedLead marked as convertedSync conversions back to ad platforms
lead.status_changedAny status transitionReal-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

EndpointLimitKey
POST /api/v1/ingest100 req/minPer API key
POST /api/v1/ping100 req/minPer API key
POST /api/v1/lead-update120 req/minPer 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

StatusMeaningAction
200SuccessRequest processed. Check the response body for details.
201CreatedLead was created and distributed.
400Bad RequestValidation failed. Check the error message and fix the payload.
401UnauthorizedMissing or invalid API key / buyer secret.
404Not FoundLead, campaign, or supplier not found.
409ConflictDuplicate lead detected, or ping session already consumed.
410GonePing session expired (5-minute TTL).
429Rate LimitedToo many requests. Wait and retry after the Retry-After period.
500Server ErrorInternal error. Retry with exponential backoff.

Frequently Asked Questions

Which endpoint should I use to send lead updates?
Use POST /api/v1/lead-update with a supplier API key. It accepts outcome changes, sales rep, speed-to-lead, call count, call disposition, revenue, and arbitrary metadata in a single call.
Can I send leads to Lead Distro AI and receive updates back?
Yes, this is a common bi-directional pattern. Your platform sends leads via /api/v1/ingest. The agency configures an automation webhook on the lead.accepted (or lead.status_changed) trigger to POST events to your endpoint. When your platform has post-delivery data, it pushes it back via /api/v1/lead-update.
How do I match leads between systems?
Lead Distro AI returns a 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?
The new value overwrites the old one. All fields are merged into the lead's data JSONB with a shallow merge. The activity timeline preserves a full audit trail of every update, so the history is never lost.
Is there a sandbox or test environment?
Send a test lead with 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?
Both 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.

If you have any questions, send us an email at support@leaddistro.ai