Skip to main content
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"
  }'
{
  "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

projectId
string
required
The public ID of the project to create the lead in. You can find this in the LeadTrackr Dashboard under Settings.
userData
object
required
Contact information for the lead.
attributionData
object
Attribution and tracking data. At least one of userData or attributionData must contain data.
formData
object
Form submission data. You can include any additional custom fields — they are stored as-is.Any additional fields you include (e.g. formCustomField1, campaign, source) are passed through and stored as-is.
deviceData
object
Device and browser information. Used to improve attribution accuracy for GA4 and Meta integrations.
channelFlow
string
Channel flow tracking value (UTM journey). Also accepted as lt_channelflow.
uniqueIdentifier
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

message
string
A description of the result. Either "Lead created successfully" or "Lead updated successfully".
leadId
number
The ID of the created or updated lead.
uniqueIdentifier
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"
  }'
{
  "message": "Lead created successfully",
  "leadId": 43,
  "uniqueIdentifier": "crm-lead-789"
}