API reference
Send a lead, collect a receipt or check a buyer delivery. Start with the connection your workspace gave you.
Choose your connection
Send leads to LeadRoute over HTTPS and have them validated, deduplicated, and routed to the right buyer in real time. The API uses standard HTTP, JSON payloads, and API key authentication.
Route and deliver: use the v1 supplier webhook with a workspace integration key. This is the default onboarding connection.
Capture with receipts: use a provisioned v2 receipt endpoint with its supplier-only key. Onboarding's “Store without delivery” option uses this path.
Use the URL, key and payload shown by your saved connection. Each connection type has its own key and request body.
https://app.leadroute.appUse the HTTPS host shown in your saved connection. The examples use the hosted LeadRoute app.
Authentication
The v1 ingestion endpoints require a workspace integration API key from an administrator. Workspace administrators manage these in Settings → Integration API keys. Save a newly created key when it appears. It is stored as a hash and cannot be retrieved later. Send it in the x-api-key header:
x-api-key: lr_live_your_api_key_hereThe supplier webhook (/api/v1/suppliers/{id}/webhook) requires the same x-api-key header; the key must belong to the supplier's organization.
curl https://app.leadroute.app/api/v1/leads \
-H "x-api-key: $LEADROUTE_API_KEY" \
-H "Content-Type: application/json" \
-d '{ "email": "jane@example.com", "firstName": "Jane" }'The JavaScript and Python examples run on your server. Set LEADROUTE_API_KEY in its environment. Treat API keys like passwords. Never expose them in browser-side code or commit them to source control. Rotate immediately if leaked.
Receipt intake
POST /api/v2/sources/:supplierId/receipts
Use this endpoint only when receipt intake is enabled and a receipt connection has been provisioned. Use its supplier-only source key in x-api-key; workspace integration keys and validation-provider keys do not authenticate this endpoint.
The API connection step in onboarding supplies the URL and key for “Store without delivery”. A storage-only contract bypasses routing and sends nothing to buyers. Forwarding contracts, when configured by an administrator, can queue receiver delivery separately.
| Field | Type | Required | Description |
|---|---|---|---|
| submissionId | string | Yes | A unique source reference, up to 200 characters. Reuse it only when retrying the same submission and payload. |
| submittedAt | ISO 8601 timestamp | Yes | The actual submission time, including a UTC offset or Z. |
| data | object | Yes | Lead fields, including a valid email. Custom fields go inside data.customFields. Configured supplier fields may add requirements. |
curl -X POST "https://app.leadroute.app/api/v2/sources/YOUR_SUPPLIER_ID/receipts" \
-H "x-api-key: YOUR_SOURCE_KEY" \
-H "Content-Type: application/json" \
-d '{
"submissionId": "sample-enquiry-001",
"submittedAt": "2026-01-01T00:00:00.000Z",
"data": {
"email": "sample@example.test",
"firstName": "Sample",
"customFields": {
"interest": "battery"
}
}
}'Illustrative payload only. Replace the supplier ID, key, submission reference, timestamp and lead fields. Sending it creates a real receipt and may queue delivery according to the saved contract.
A new receipt returns HTTP 202 with receiptId, leadId, state, reason, receivedAt and duplicate. Save receiptId so your agency can look up the submission. An identical retry returns the existing receipt with HTTP 200; a conflicting payload for the same reference returns HTTP 409. Acceptance of the request does not confirm receiver delivery or CRM creation.
Your agency team can review progress in Leads → Intake receipts. Receipt history and raw-payload access require workspace sign-in; a source key does not grant access to those workspace APIs.
Outcome meanings
Routing-managed leads and receipt-managed submissions have different lifecycles. These are existing recorded states, not extra setup steps. Open either guide to check a recorded state and its meaning.
Lead processing outcomes
- Pending
pending - Waiting for lead processing.
- Validated
validated - Passed the configured validation stage; delivery is separate.
- Routed
routed - A route has been selected; inspect delivery attempts for the receiver result.
- Delivered
delivered - A successful routing-stage delivery was recorded.
- Accepted
accepted - A receiver acceptance was recorded for this routing-stage lead.
- Rejected
rejected - Lead processing rejected this lead. Open it to review the recorded reason.
- Flagged
flagged - Lead processing flagged this lead for review.
Receipt outcomes
- Received
received - The submission was captured and is waiting for intake processing.
- Stored
stored - Stored without forwarding. No buyer delivery was requested.
- Rejected
rejected - Intake rejected the submission. Review its recorded reason.
- Delivery pending
delivery_pending - Stored and queued for a receiver delivery attempt.
- Needs reconciliation
uncertain - The receiver may have accepted it. Check its records before retrying.
- Receiver acknowledged
delivered - The receiver acknowledged the submission. This does not confirm CRM record creation.
- Failed
failed - The delivery attempt failed. Review receipt history before deciding what to do.
- Historical import
imported - Imported as historical data without live routing or delivery.
Webhook Signatures
Inbound requests are authenticated by the x-api-key header — no request signing is required. LeadRoute signs outbound requests when a signing secret is configured, so you can verify that a delivery genuinely came from us.
Verifying outbound webhooks
With a buyer signing secret configured, each signed delivery carries an X-Timestamp header (Unix seconds) and an X-Signature header. The signature is HMAC-SHA256(secret, "<timestamp>." + rawBody) as lowercase hex. Recompute it and compare in constant time — reject the delivery if the timestamp falls outside your freshness window. The examples below use five minutes.
# Inspect a signed fixture using its header and exact body bytes.
# Set TIMESTAMP from X-Timestamp and BUYER_SECRET to the test signing secret.
{ printf '%s.' "$TIMESTAMP"; cat body.json; } | openssl dgst -sha256 -hmac "$BUYER_SECRET"
# In your receiver, check freshness and compare digests in constant time./api/v1/suppliers/:campaignId/webhookSubmit a Lead via Supplier Webhook
Use the URL in Suppliers → Setup Guide. Send a workspace integration key in the x-api-key header; the supplier ID identifies the source and does not authenticate it. Create a key in Settings → Integration keys and keep it in your server-side automation.
Request body
| Field | Type | Required | Description |
|---|---|---|---|
| string | Yes | Lead email address. Normalized to lowercase. | |
| phone | string | No | Phone number. Normalized to E.164 using the supplier country. |
| firstName | string | No | Lead first name. |
| lastName | string | No | Lead last name. |
| company | string | No | Company name. |
| address | string | No | Street address. |
| city | string | No | City. |
| state | string | No | State or province code. |
| zipCode | string | No | Postal / ZIP code. |
| country | string | No | Two-letter country code. |
| source | string | No | Lead source label. Defaults to "webhook". |
| ipAddress | string | No | End-user IP for fraud scoring. |
| customFields | object | No | Any extra supplier-defined fields. |
Example
curl https://app.leadroute.app/api/v1/suppliers/CAMPAIGN_ID/webhook \
-H "Content-Type: application/json" \
-H "x-api-key: $LEADROUTE_API_KEY" \
-d '{
"email": "jane@example.com",
"firstName": "Jane",
"lastName": "Doe",
"phone": "+15551234567",
"source": "landing-page-a"
}'Success response · 201
| Field | Type | Required | Description |
|---|---|---|---|
| status | string | Yes | Always "success" on a 201. |
| message | string | Yes | Human-readable confirmation. |
| lead_id | uuid | Yes | Identifier of the newly created lead. |
| validation_results | object | Yes | Detail object with isValid, errors[], warnings[], and per-field results. |
| routing | object | Yes | Routing decision: success, routingReason, routeId, routeName and selectedBuyers. A match is not receiver acknowledgment. |
| quota_warnings | string[] | No | Present when usage crosses 80/90/100% of plan. |
{
"status": "success",
"message": "Lead received and processed",
"lead_id": "b9f3...c2",
"validation_results": { "isValid": true, "errors": [], "warnings": [] },
"routing": { "success": true, "routeId": "...", "selectedBuyers": [{ "buyerId": "..." }] }
}/api/v1/leadsSubmit a Lead via API Key
Use the same lead fields and workspace integration key as the supplier webhook. Useful when the source system isn't tied to a single supplier — pass campaignId in the body to target a specific supplier.
curl https://app.leadroute.app/api/v1/leads \
-H "x-api-key: $LEADROUTE_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"campaignId": "SUPPLIER_ID",
"email": "jane@example.com",
"firstName": "Jane",
"phone": "+15551234567"
}'Returns HTTP 200 on success with status, lead_id, validation_results and routing. The response may include quota_warnings.
/api/v1/leads/:idRetrieve a Lead
Fetch a single lead by ID, including validation results, current status, and the assigned route/buyer. Authenticate with your API key.
curl https://app.leadroute.app/api/v1/leads/LEAD_ID \
-H "x-api-key: $LEADROUTE_API_KEY"Response · 200
| Field | Type | Required | Description |
|---|---|---|---|
| id | uuid | Yes | Lead identifier. |
| campaignId | uuid | No | Supplier ID, when a supplier is associated with the lead. The API calls this field campaignId. |
| string | Yes | Lead email (lowercased). | |
| phone | string | No | Phone in E.164 format. |
| firstName | string | No | First name. |
| lastName | string | No | Last name. |
| company | string | No | Company. |
| address / city / state / zipCode / country | string | No | Postal address parts. |
| status | enum | Yes | pending | validated | routed | delivered | accepted | rejected | flagged. |
| score | decimal(5,2) | No | Quality score 0–100. |
| fraudScore | decimal(5,2) | No | Fraud risk 0–100 (higher = riskier). |
| assignedAgentId | uuid | No | Agent the lead was routed to, if any. |
| validationResults | object | No | Per-field validation breakdown. |
| customFields | object | No | Supplier-defined extra fields. |
| source | string | No | Source label provided at ingestion. |
| createdAt | ISO date | Yes | Server-side creation timestamp. |
{
"id": "b9f3...c2",
"email": "jane@example.com",
"phone": "+15551234567",
"firstName": "Jane",
"lastName": "Doe",
"status": "delivered",
"score": "82.50",
"campaignId": "...",
"assignedAgentId": "...",
"validationResults": { "email": { "valid": true } },
"createdAt": "2026-05-03T12:00:00.000Z"
}/api/v1/leadsList Leads
List leads scoped to your account. Supports filtering and pagination via query parameters.
Query parameters
| Field | Type | Required | Description |
|---|---|---|---|
| campaignId | uuid | No | Filter by supplier ID (campaignId). |
| status | string | No | One of pending, validated, routed, delivered, accepted, rejected, flagged. |
| from | ISO date | No | Inclusive lower bound on createdAt. |
| to | ISO date | No | Inclusive upper bound on createdAt. |
| limit | integer | No | Page size, max 200, default 50. |
| offset | integer | No | Pagination offset, default 0. |
curl "https://app.leadroute.app/api/v1/leads?status=delivered&limit=25" \
-H "x-api-key: $LEADROUTE_API_KEY"Response · 200
| Field | Type | Required | Description |
|---|---|---|---|
| data | Lead[] | Yes | Array of lead objects (same shape as GET /api/v1/leads/:id). |
| total | integer | Yes | Total matching leads (across all pages). |
| limit | integer | Yes | Page size echoed back. |
| offset | integer | Yes | Pagination offset echoed back. |
{
"data": [ { "id": "...", "email": "...", "status": "delivered" } ],
"total": 142,
"limit": 25,
"offset": 0
}Errors
Error responses vary by endpoint. Check the HTTP status, a human-readable message, and (where useful) a stable machine-readable code.
| HTTP status | Category | Meaning |
|---|---|---|
| 400 Bad Request | validation | Body failed schema validation. Inspect the errors array for field details. |
| 401 Unauthorized | auth | Check the API key type, workspace and endpoint. A signed read request can also fail a timestamp or signature check. |
| 403 Forbidden | permission | API key lacks access to the resource. |
| 404 Not Found | resource | Lead, supplier, or other resource does not exist. |
| 409 Conflict | duplicate | A v1 lead matched a duplicate. Receipt intake also returns 409 when a reference is reused with a different payload. |
| 422 Unprocessable Entity | business | Lead suppressed or failed validation rules. |
| 429 Too Many Requests | rate-limit | Rate or plan limit hit. See codes LEAD_LIMIT_REACHED, LIFETIME_LIMIT_REACHED. |
| 500 Internal Server Error | server | Unexpected error. Check whether the submission was recorded before retrying. For receipt intake, reuse the same reference and unchanged payload. |
Example error body
{
"status": "error",
"message": "Monthly lead limit reached for your plan",
"code": "LEAD_LIMIT_REACHED"
}Rate Limits
Two layers of limits apply: a request-rate limit per API key, and a per-plan lead quota. Both surface as 429 Too Many Requests.
Per-key request rate
600 requests / minute per API key by default across the public /api/v1 endpoints. Deployment configuration may change this limit. Standard rate-limit headers (RateLimit-Limit, RateLimit-Remaining, RateLimit-Reset) describe the applicable request limit. Dashboard requests use a separate per-IP budget.
Plan lead quotas
| Plan | Monthly price | Lead allowance |
|---|---|---|
| Free Trial | Free | 25 leads total. No expiry or monthly reset. Returns LIFETIME_LIMIT_REACHED once consumed. |
| Starter | US$79 / mo | 1,000 leads / month. |
| Growth | US$249 / mo | 5,000 leads / month. |
| Professional | US$499 / mo | 20,000 leads / month. |
| Enterprise | US$999 / mo | 100,000 leads / month. |
Need more headroom? Compare plans and allowances
Need help? hello@leadroute.io