curl -X POST https://app.leadtrackr.io/api/leads/createLead \
-H "Content-Type: application/json" \
-d '{
"projectId": "your-project-id",
"userData": {
"firstName": "John",
"lastName": "Doe",
"email": "john@example.com",
"phone": "+31612345678",
"companyName": "Acme Inc."
},
"attributionData": {
"gclid": "abc123",
"cid": "1234567890.1234567890",
"fbp": "fb.1.1612345678.1234567890"
},
"formData": {
"formName": "Contact Form",
"formMessage": "I would like to request a quote",
"uniqueEventId": "evt_abc123"
},
"deviceData": {
"ipAddress": "203.0.113.42",
"userAgent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64)"
},
"uniqueIdentifier": "crm-lead-456"
}'
const response = await fetch("https://app.leadtrackr.io/api/leads/createLead", {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({
projectId: "your-project-id",
userData: {
firstName: "John",
lastName: "Doe",
email: "john@example.com",
phone: "+31612345678",
companyName: "Acme Inc."
},
attributionData: {
gclid: "abc123",
cid: "1234567890.1234567890"
},
formData: {
formName: "Contact Form",
uniqueEventId: "evt_abc123"
},
uniqueIdentifier: "crm-lead-456"
})
});
const data = await response.json();
console.log(data);
$ch = curl_init("https://app.leadtrackr.io/api/leads/createLead");
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_POST => true,
CURLOPT_HTTPHEADER => ["Content-Type: application/json"],
CURLOPT_POSTFIELDS => json_encode([
"projectId" => "your-project-id",
"userData" => [
"firstName" => "John",
"lastName" => "Doe",
"email" => "john@example.com",
"phone" => "+31612345678",
"companyName" => "Acme Inc."
],
"attributionData" => [
"gclid" => "abc123",
"cid" => "1234567890.1234567890"
],
"formData" => [
"formName" => "Contact Form",
"uniqueEventId" => "evt_abc123"
],
"uniqueIdentifier" => "crm-lead-456"
])
]);
$response = curl_exec($ch);
curl_close($ch);
$data = json_decode($response, true);
print_r($data);
{
"message": "Lead created successfully",
"leadId": 42,
"uniqueIdentifier": "crm-lead-456"
}
Leads
Create Lead
Create a lead from a client-side source such as Google Tag Manager or a browser script.
POST
/
api
/
leads
/
createLead
curl -X POST https://app.leadtrackr.io/api/leads/createLead \
-H "Content-Type: application/json" \
-d '{
"projectId": "your-project-id",
"userData": {
"firstName": "John",
"lastName": "Doe",
"email": "john@example.com",
"phone": "+31612345678",
"companyName": "Acme Inc."
},
"attributionData": {
"gclid": "abc123",
"cid": "1234567890.1234567890",
"fbp": "fb.1.1612345678.1234567890"
},
"formData": {
"formName": "Contact Form",
"formMessage": "I would like to request a quote",
"uniqueEventId": "evt_abc123"
},
"deviceData": {
"ipAddress": "203.0.113.42",
"userAgent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64)"
},
"uniqueIdentifier": "crm-lead-456"
}'
const response = await fetch("https://app.leadtrackr.io/api/leads/createLead", {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({
projectId: "your-project-id",
userData: {
firstName: "John",
lastName: "Doe",
email: "john@example.com",
phone: "+31612345678",
companyName: "Acme Inc."
},
attributionData: {
gclid: "abc123",
cid: "1234567890.1234567890"
},
formData: {
formName: "Contact Form",
uniqueEventId: "evt_abc123"
},
uniqueIdentifier: "crm-lead-456"
})
});
const data = await response.json();
console.log(data);
$ch = curl_init("https://app.leadtrackr.io/api/leads/createLead");
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_POST => true,
CURLOPT_HTTPHEADER => ["Content-Type: application/json"],
CURLOPT_POSTFIELDS => json_encode([
"projectId" => "your-project-id",
"userData" => [
"firstName" => "John",
"lastName" => "Doe",
"email" => "john@example.com",
"phone" => "+31612345678",
"companyName" => "Acme Inc."
],
"attributionData" => [
"gclid" => "abc123",
"cid" => "1234567890.1234567890"
],
"formData" => [
"formName" => "Contact Form",
"uniqueEventId" => "evt_abc123"
],
"uniqueIdentifier" => "crm-lead-456"
])
]);
$response = curl_exec($ch);
curl_close($ch);
$data = json_decode($response, true);
print_r($data);
{
"message": "Lead created successfully",
"leadId": 42,
"uniqueIdentifier": "crm-lead-456"
}
This endpoint is designed for client-side use. It does not require an API key — the project is identified by the
projectId field in the request body.
If a lead with the same uniqueEventId already exists, it will be updated instead of duplicated.
For server-side integrations where you control the backend, use Create Server-Side Lead instead — it requires an API key and provides stronger security.
Request body
string
required
The public ID of the project to create the lead in. You can find this in the LeadTrackr Dashboard under Settings.
object
object
Attribution and tracking data. At least one of
userData or attributionData must contain data.object
Form submission data. You can include any additional custom fields — they are stored as-is.
Any additional fields you include (e.g.
Show formData properties
Show formData properties
formCustomField1, campaign, source) are passed through and stored as-is.object
string
Channel flow tracking value (UTM journey). Also accepted as
lt_channelflow.string
A user-provided identifier to link this lead to your own system (e.g. your CRM lead ID or form submission ID). Max 255 characters. Also accepted as
unique_identifier.Response
string
A description of the result. Either
"Lead created successfully" or "Lead updated successfully".number
The ID of the created or updated lead.
string | null
The unique identifier for the lead, or
null if not provided.curl -X POST https://app.leadtrackr.io/api/leads/createLead \
-H "Content-Type: application/json" \
-d '{
"projectId": "your-project-id",
"userData": {
"firstName": "John",
"lastName": "Doe",
"email": "john@example.com",
"phone": "+31612345678",
"companyName": "Acme Inc."
},
"attributionData": {
"gclid": "abc123",
"cid": "1234567890.1234567890",
"fbp": "fb.1.1612345678.1234567890"
},
"formData": {
"formName": "Contact Form",
"formMessage": "I would like to request a quote",
"uniqueEventId": "evt_abc123"
},
"deviceData": {
"ipAddress": "203.0.113.42",
"userAgent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64)"
},
"uniqueIdentifier": "crm-lead-456"
}'
const response = await fetch("https://app.leadtrackr.io/api/leads/createLead", {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({
projectId: "your-project-id",
userData: {
firstName: "John",
lastName: "Doe",
email: "john@example.com",
phone: "+31612345678",
companyName: "Acme Inc."
},
attributionData: {
gclid: "abc123",
cid: "1234567890.1234567890"
},
formData: {
formName: "Contact Form",
uniqueEventId: "evt_abc123"
},
uniqueIdentifier: "crm-lead-456"
})
});
const data = await response.json();
console.log(data);
$ch = curl_init("https://app.leadtrackr.io/api/leads/createLead");
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_POST => true,
CURLOPT_HTTPHEADER => ["Content-Type: application/json"],
CURLOPT_POSTFIELDS => json_encode([
"projectId" => "your-project-id",
"userData" => [
"firstName" => "John",
"lastName" => "Doe",
"email" => "john@example.com",
"phone" => "+31612345678",
"companyName" => "Acme Inc."
],
"attributionData" => [
"gclid" => "abc123",
"cid" => "1234567890.1234567890"
],
"formData" => [
"formName" => "Contact Form",
"uniqueEventId" => "evt_abc123"
],
"uniqueIdentifier" => "crm-lead-456"
])
]);
$response = curl_exec($ch);
curl_close($ch);
$data = json_decode($response, true);
print_r($data);
{
"message": "Lead created successfully",
"leadId": 42,
"uniqueIdentifier": "crm-lead-456"
}