Webhook event

LeadCreatedEvent

Sodtrack sends this payload when a new lead is created in the platform, regardless of the channel it originated from: the admin panel, the customer web, the Integration API or a referral raised by a…

Sodtrack sends POST with Content-Type: application/json to the endpoint configured for your tenant. See webhooks overview for delivery and security guidance.

Payload

Payload
{
  "id": 1001,
  "reference": "EXT-REF-0001",
  "status": "created",
  "customerName": "John",
  "customerFullName": "Doe",
  "customerEmail": "john.doe@example.com",
  "customer": {
    "id": 2001,
    "email": "john.doe@example.com",
    "phone": "+56900000000",
    "name": "John",
    "lastname": "Doe",
    "identification_number": "11111111-1"
  },
  "address": {
    "id": 3001,
    "address": "Av. Example 123",
    "formattedAddress": "Av. Example 123, Santiago, Región Metropolitana, Chile",
    "coordinate": {
      "lng": -70.65,
      "lat": -33.45
    }
  },
  "service": {
    "id": 4001,
    "name": "Sample Service"
  },
  "leadUrl": "https://network.example.com/leads/1001",
  "createdBy": "technician@example.com"
}

Purpose

Sodtrack sends this payload when a new lead is created in the platform, regardless of the channel it originated from: the admin panel, the customer web, the Integration API or a referral raised by a technician from the provider mobile app.

The payload is a snapshot of the lead at the moment of creation, together with the customer, the address and the service it refers to, so the receiving system can register the opportunity without any additional call to Sodtrack.


Trigger Condition

This webhook is triggered when:

  • A new lead has been successfully persisted in the Sodtrack system, and

  • The lead has been initialized with the "created" status.

The event is emitted immediately after the lead row is saved, before the lead's form answers are persisted and before the lead's final trigger is resolved.


Example Use Cases

  • Register new sales opportunities in an external CRM in real time.

  • Trigger qualification or follow-up workflows for incoming leads.

  • Keep third-party dashboards synchronized with lead generation activity.


Field Definitions

📋 Lead

FieldTypeDescription
idnumberUnique Sodtrack lead ID.
referencestringExternal reference supplied by the originating system. null when the lead was not created through the Integration API.
statusstringLead status. Always created in this event.
customerNamestringCustomer first name, as captured when the lead was created.
customerFullNamestringCustomer last name, as captured when the lead was created.
customerEmailstringCustomer email, as captured when the lead was created.
leadUrlstringDirect link to the lead in the Sodtrack network panel.
createdBystringEmail of the user that triggered the creation. system when no user is associated with the request.

🧍 Customer — customer

Current values read from the customer record at the moment the event is emitted. The whole object is null when the lead has no customer associated.

FieldTypeDescription
customer.idnumberSodtrack customer ID.
customer.emailstringCustomer email address.
customer.phonestringCustomer phone number.
customer.namestringCustomer first name.
customer.lastnamestringCustomer last name.
customer.identification_numberstringCustomer national identification number.

🏠 Address — address

Address where the referred service will be performed. The whole object is null when the lead has no address associated.

FieldTypeDescription
address.idnumberSodtrack address ID.
address.addressstringAddress as entered.
address.formattedAddressstringNormalized address as resolved by Sodtrack.
address.coordinateobjectGeographic coordinate of the address. null when the address has no coordinate.
address.coordinate.lngnumberLongitude.
address.coordinate.latnumberLatitude.

🛠️ Service — service

FieldTypeDescription
service.idnumberSodtrack service ID.
service.namestringService name.

Payload Example

code
{
    "id": 1001,
    "reference": "EXT-REF-0001",
    "status": "created",
    "customerName": "John",
    "customerFullName": "Doe",
    "customerEmail": "john.doe@example.com",
    "customer": {
        "id": 2001,
        "email": "john.doe@example.com",
        "phone": "+56900000000",
        "name": "John",
        "lastname": "Doe",
        "identification_number": "11111111-1"
    },
    "address": {
        "id": 3001,
        "address": "Av. Example 123",
        "formattedAddress": "Av. Example 123, Santiago, Región Metropolitana, Chile",
        "coordinate": {
            "lng": -70.6500000,
            "lat": -33.4500000
        }
    },
    "service": {
        "id": 4001,
        "name": "Sample Service"
    },
    "leadUrl": "https://network.example.com/leads/1001",
    "createdBy": "technician@example.com"
}

Business Rules & Constraints

When the webhook is sent

  • The event is emitted for every lead created in Sodtrack. The payload carries no field identifying the origin channel, so referrals, admin-created leads and Integration API leads cannot be told apart from the payload alone.

  • The event is emitted asynchronously. A delivery failure does not affect the creation of the lead.

Snapshot fields vs. live customer data

  • customerName, customerFullName and customerEmail are stored on the lead when it is created and never change afterwards.

  • The customer object is read from the customer record at the moment the event is emitted.

  • Both are identical for a newly created lead, but they diverge if the customer later updates their profile. Use the customer object as the source of truth for contact data.

Nullable objects

  • customer, address and service can each be null as a whole, not only their inner fields. A lead can be created without an address, and a receiver must not assume the objects are present.

  • address.coordinate is null when the address was registered without geolocation.

Data and format

  • All identifiers are delivered as numbers.

  • address.coordinate is a flat object with lng and lat properties. It is not GeoJSON.

  • customerFullName holds the customer's last name, despite its name.