curl -X POST https://app.leadtrackr.io/api/leads/createServerSideLead \
-H "Content-Type: application/json" \
-H "X-API-Key: your-api-key-here" \
-d '{
"projectId": "your-project-id",
"userData": {
"firstName": "Jane",
"lastName": "Smith",
"email": "jane@example.com",
"phone": "+31687654321",
"companyName": "Acme Inc."
},
"attributionData": {
"gclid": "xyz789",
"cid": "9876543210.9876543210",
"fbp": "fb.1.1612345678.9876543210"
},
"formData": {
"formName": "Contact Form",
"formMessage": "Interested in your services",
"uniqueEventId": "evt_xyz789"
},
"deviceData": {
"ipAddress": "203.0.113.50",
"userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7)"
},
"uniqueIdentifier": "crm-lead-789"
}'
const response = await fetch("https://app.leadtrackr.io/api/leads/createServerSideLead", {
method: "POST",
headers: {
"Content-Type": "application/json",
"X-API-Key": "your-api-key-here"
},
body: JSON.stringify({
projectId: "your-project-id",
userData: {
firstName: "Jane",
lastName: "Smith",
email: "jane@example.com",
phone: "+31687654321",
companyName: "Acme Inc."
},
attributionData: {
gclid: "xyz789",
cid: "9876543210.9876543210"
},
formData: {
formName: "Contact Form",
uniqueEventId: "evt_xyz789"
},
uniqueIdentifier: "crm-lead-789"
})
});
const data = await response.json();
console.log(data);
$ch = curl_init("https://app.leadtrackr.io/api/leads/createServerSideLead");
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_POST => true,
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-API-Key: your-api-key-here"
],
CURLOPT_POSTFIELDS => json_encode([
"projectId" => "your-project-id",
"userData" => [
"firstName" => "Jane",
"lastName" => "Smith",
"email" => "jane@example.com",
"phone" => "+31687654321",
"companyName" => "Acme Inc."
],
"attributionData" => [
"gclid" => "xyz789",
"cid" => "9876543210.9876543210"
],
"formData" => [
"formName" => "Contact Form",
"uniqueEventId" => "evt_xyz789"
],
"uniqueIdentifier" => "crm-lead-789"
])
]);
$response = curl_exec($ch);
curl_close($ch);
$data = json_decode($response, true);
print_r($data);
{
"message": "Lead created successfully",
"leadId": 43,
"uniqueIdentifier": "crm-lead-789"
}
Leads
Create Server-Side Lead
Create a lead from your backend with API key authentication.
POST
/
api
/
leads
/
createServerSideLead
curl -X POST https://app.leadtrackr.io/api/leads/createServerSideLead \
-H "Content-Type: application/json" \
-H "X-API-Key: your-api-key-here" \
-d '{
"projectId": "your-project-id",
"userData": {
"firstName": "Jane",
"lastName": "Smith",
"email": "jane@example.com",
"phone": "+31687654321",
"companyName": "Acme Inc."
},
"attributionData": {
"gclid": "xyz789",
"cid": "9876543210.9876543210",
"fbp": "fb.1.1612345678.9876543210"
},
"formData": {
"formName": "Contact Form",
"formMessage": "Interested in your services",
"uniqueEventId": "evt_xyz789"
},
"deviceData": {
"ipAddress": "203.0.113.50",
"userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7)"
},
"uniqueIdentifier": "crm-lead-789"
}'
const response = await fetch("https://app.leadtrackr.io/api/leads/createServerSideLead", {
method: "POST",
headers: {
"Content-Type": "application/json",
"X-API-Key": "your-api-key-here"
},
body: JSON.stringify({
projectId: "your-project-id",
userData: {
firstName: "Jane",
lastName: "Smith",
email: "jane@example.com",
phone: "+31687654321",
companyName: "Acme Inc."
},
attributionData: {
gclid: "xyz789",
cid: "9876543210.9876543210"
},
formData: {
formName: "Contact Form",
uniqueEventId: "evt_xyz789"
},
uniqueIdentifier: "crm-lead-789"
})
});
const data = await response.json();
console.log(data);
$ch = curl_init("https://app.leadtrackr.io/api/leads/createServerSideLead");
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_POST => true,
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-API-Key: your-api-key-here"
],
CURLOPT_POSTFIELDS => json_encode([
"projectId" => "your-project-id",
"userData" => [
"firstName" => "Jane",
"lastName" => "Smith",
"email" => "jane@example.com",
"phone" => "+31687654321",
"companyName" => "Acme Inc."
],
"attributionData" => [
"gclid" => "xyz789",
"cid" => "9876543210.9876543210"
],
"formData" => [
"formName" => "Contact Form",
"uniqueEventId" => "evt_xyz789"
],
"uniqueIdentifier" => "crm-lead-789"
])
]);
$response = curl_exec($ch);
curl_close($ch);
$data = json_decode($response, true);
print_r($data);
{
"message": "Lead created successfully",
"leadId": 43,
"uniqueIdentifier": "crm-lead-789"
}
This endpoint is designed for server-side integrations. It requires an API key sent via the
X-API-Key header.
If a lead with the same uniqueEventId already exists, it will be updated instead of duplicated.
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
required
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/createServerSideLead \
-H "Content-Type: application/json" \
-H "X-API-Key: your-api-key-here" \
-d '{
"projectId": "your-project-id",
"userData": {
"firstName": "Jane",
"lastName": "Smith",
"email": "jane@example.com",
"phone": "+31687654321",
"companyName": "Acme Inc."
},
"attributionData": {
"gclid": "xyz789",
"cid": "9876543210.9876543210",
"fbp": "fb.1.1612345678.9876543210"
},
"formData": {
"formName": "Contact Form",
"formMessage": "Interested in your services",
"uniqueEventId": "evt_xyz789"
},
"deviceData": {
"ipAddress": "203.0.113.50",
"userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7)"
},
"uniqueIdentifier": "crm-lead-789"
}'
const response = await fetch("https://app.leadtrackr.io/api/leads/createServerSideLead", {
method: "POST",
headers: {
"Content-Type": "application/json",
"X-API-Key": "your-api-key-here"
},
body: JSON.stringify({
projectId: "your-project-id",
userData: {
firstName: "Jane",
lastName: "Smith",
email: "jane@example.com",
phone: "+31687654321",
companyName: "Acme Inc."
},
attributionData: {
gclid: "xyz789",
cid: "9876543210.9876543210"
},
formData: {
formName: "Contact Form",
uniqueEventId: "evt_xyz789"
},
uniqueIdentifier: "crm-lead-789"
})
});
const data = await response.json();
console.log(data);
$ch = curl_init("https://app.leadtrackr.io/api/leads/createServerSideLead");
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_POST => true,
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-API-Key: your-api-key-here"
],
CURLOPT_POSTFIELDS => json_encode([
"projectId" => "your-project-id",
"userData" => [
"firstName" => "Jane",
"lastName" => "Smith",
"email" => "jane@example.com",
"phone" => "+31687654321",
"companyName" => "Acme Inc."
],
"attributionData" => [
"gclid" => "xyz789",
"cid" => "9876543210.9876543210"
],
"formData" => [
"formName" => "Contact Form",
"uniqueEventId" => "evt_xyz789"
],
"uniqueIdentifier" => "crm-lead-789"
])
]);
$response = curl_exec($ch);
curl_close($ch);
$data = json_decode($response, true);
print_r($data);
{
"message": "Lead created successfully",
"leadId": 43,
"uniqueIdentifier": "crm-lead-789"
}
⌘I