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

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
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/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"
  }'
{
  "message": "Lead created successfully",
  "leadId": 42,
  "uniqueIdentifier": "crm-lead-456"
}