How to Submit a Lead via API
LeadsSingle-Lead API Submission
For real-time integrations (web-form webhooks, CRM sync,
third-party lead vendors) submit leads individually to
POST /api/v1/leads. Each request creates or updates one
Lead.
Finding the Live API Docs in the App
In the left sidebar choose Leads -> Submit Leads. The
Submit Leads page (/leads/import_type) presents five
tiles: File Upload, Manual Test, Typeform Integration,
Instapage Guide, and API Usage. Clicking the API
Usage tile opens the apipie reference at
/api/docs/1.0/leads_external/create.html, which lists
every parameter your deployment accepts along with
copy-ready curl examples scoped to your domain.
Request Format
The endpoint accepts form-encoded or JSON bodies.
Form-encoded example:
curl -X POST \
"https://your-domain.com/api/v1/leads?lead_token=YOUR_TOKEN&caller_id=+18004506787&email=john@example.com&loan_amount=500"
JSON example:
curl -H "Content-Type: application/json" -X POST \
-d '{
"lead_token":"YOUR_TOKEN",
"caller_id":"+18004506787",
"data":{"email":"john@example.com","interest":"kittens"}
}' \
https://your-domain.com/api/v1/leads?lead_token=YOUR_TOKEN
Required Fields
-
lead_token: either a schedule lead token or an offer lead token. If neither matches, the request is rejected. You may also passschedule_lead_tokenoroffer_lead_tokenexplicitly. -
caller_id: the lead's phone number. The platform normalizes to E.164 automatically.
Documented Parameters
The following first-class params are accepted:
lead_token, caller_id, email,
contact_field_type, schedule_callback_at,
schedule_callback_in_seconds,
update_all_matching_leads, apply_to,
unblock_contact, blocked, assign_trackdrive_number,
assign_sms_number, expire_existing,
delete_existing, update_only, lead_priority,
restart_schedule, auto_format_nested_fields,
next_action_at, hours_to_expire,
max_contact_attempts, data.
Any keys outside a reserved list are captured as Lead
tokens, available for substitution in SMS templates,
call whispers, and webhook payloads. Reserved keys
include lead_token, offer_lead_token, data_json,
auth_token, update_only, etc.
Response Codes
-
200 OKwith a serialized Lead on success. -
422 Unprocessable Entitywith validation errors if the lead fails to save. -
422 Unprocessable Entityif thelead_tokendoes not resolve to a Schedule or Offer.
Browser-Side Submission with jQuery
Lead submission also works directly from a web page. The
request is an ordinary cross-origin POST, so jQuery's
$.ajax (or any fetch call) is sufficient:
$.ajax({
url: "https://your-domain.com/api/v1/leads?lead_token=YOUR_TOKEN",
method: "POST",
data: {
caller_id: "+17192221234",
data: { loan_amount: "500" }
}
});
This is the pattern used by TrackDrive's own in-app help
snippets. Place it inside the form's submit handler, or
fire it from a confirmation page after the visitor has
consented.
Traffic Source and Sub ID Attribution
Two optional parameters power click-level attribution:
-
traffic_source_id: the ID of a traffic source record configured on the company. This associates the lead with a specific acquisition channel for reporting. -
sub_id: a free-form string that identifies a sub-publisher, affiliate, or creative within a single traffic source. Any opaque string works.
Example:
https://your-domain.com/api/v1/leads?lead_token=YOUR_TOKEN
&caller_id=+17192223333
&traffic_source_id=google_ads
&sub_id=a1b2c3d
When the lead subsequently produces a call or conversion,
these tokens roll up into the source/sub-source breakdowns
on the reporting dashboards.
Full API Documentation
The live apipie docs are served at
/api/docs/1.0/leads_external/create.html on your
TrackDrive domain and reflect the exact fields your
deployment accepts.