Get Lead

Returns the full detail of a single lead, identified by its Sodtrack id.

GET/api/integration/lead/{leadId}

Request

cURL
curl -X GET "https://uat.integration.cl.sodtrack-shared.sodtrack.com/api/integration/lead/{leadId}" \
  -H "Authorization: Bearer $SODTRACK_TOKEN"

Base URL: https://uat.integration.cl.sodtrack-shared.sodtrack.com · other environments

Path parameters

NameTypeDescription
leadIdrequiredstring—

Responses

Get Lead
{
  "id": 4521,
  "reference": "LEAD-EXT-1001",
  "status": "sold",
  "paymentStatus": "paid",
  "approvalStatus": "approved",
  "cancelReason": null,
  "customer": {
    "id": 2001,
    "reference": "EXT-CUSTOMER-REF-001",
    "name": "Laura",
    "lastname": "Gómez",
    "email": "laura.gomez@example.com",
    "phone": "+56987654321"
  },
  "provider": {
    "id": 42,
    "reference": "PROV-REF-42",
    "name": "Servicios del Sur",
    "lastname": "SpA",
    "email": "contacto@serviciosdelsur.example.com",
    "phone": "+56912345678",
    "identificationNumber": "76123456-7",
    "assignedTo": {
      "name": "María",
      "lastname": "Técnica",
      "email": "maria.tecnica@example.com"
    }
  },
  "project": {
    "id": 88,
    "reference": "PROJ-EXT-100"
  },
  "booking": {
    "id": 10452,
    "reference": "ORD-2025-001"
  },
  "createdDate": "2025-03-10T14:22:00.000Z",
  "qualifyingQuestions": [
    {
      "id": 9001,
      "fieldId": 31,
      "label": "Which service do you need?",
      "type": "text",
      "value": "Interior painting"
    },
    {
      "id": 9002,
      "fieldId": 32,
      "label": "Urgency",
      "type": "select",
      "value": "High"
    }
  ],
  "dynamicForms": [
    {
      "id": 7310,
      "name": "Additional information",
      "flow": "lead_additional_info",
      "createdDate": "2025-03-10T14:22:05.000Z",
      "fields": [
        {
          "id": 51020,
          "reference": "square_meters",
          "label": "Square meters",
          "type": "numeric",
          "value": "120",
          "secondaryValue": null
        },
        {
          "id": 51021,
          "reference": "has_garage",
          "label": "Has a garage?",
          "type": "select",
          "value": "Yes",
          "secondaryValue": null
        },
        {
          "id": 51022,
          "reference": "garage_cars",
          "label": "How many cars?",
          "type": "short_text",
          "value": "2",
          "secondaryValue": null
        },
        {
          "id": 51024,
          "reference": "rooms",
          "label": "Rooms to paint",
          "type": "checkbox",
          "value": "Living room, Kitchen",
          "secondaryValue": null
        }
      ]
    }
  ],
  "statusHistory": [
    {
      "id": 15004,
      "status": "sold",
      "flow": "manual_sold",
      "triggerUser": {
        "id": 3120,
        "reference": null
      },
      "createdDate": "2025-03-20T16:40:00.000Z"
    },
    {
      "id": 15003,
      "status": "scheduled",
      "flow": "first_booking_scheduled",
      "triggerUser": {
        "id": 3120,
        "reference": null
      },
      "createdDate": "2025-03-12T10:15:00.000Z"
    },
    {
      "id": 15002,
      "status": "active",
      "flow": "automatically_set_lead_status_to_active",
      "triggerUser": null,
      "createdDate": "2025-03-10T14:23:00.000Z"
    },
    {
      "id": 15001,
      "status": "created",
      "flow": "create",
      "triggerUser": null,
      "createdDate": "2025-03-10T14:22:00.000Z"
    }
  ]
}

Error responses for this endpoint follow the shared error reference.

Purpose

Returns the full detail of a single lead, identified by its Sodtrack id.

Besides the lead data, customer, assigned provider, project and booking, the response includes:

  • Qualifying questions: the answers to the lead form sent in Create Lead.
  • Dynamic forms: every dynamic form filled for the lead, for example the additional information sent in Create Lead or the cancellation form sent in Cancel Lead.
  • Status history: every status change of the lead, most recent first.

To find a lead by reference or by customer, use Search Leads.


Field Definitions

🔐 Authentication

FieldTypeRequiredDescription
x-api-key (header)string✅External integration API key provided by Sodtrack.

🔎 Path parameters

ParameterTypeRequiredDescription
leadIdnumber✅Sodtrack lead id. Must be an integer.

Example Request

Path parameter example:

code
leadId = 4521

Response Example

json
{
  "id": 4521,
  "reference": "LEAD-EXT-1001",
  "status": "sold",
  "paymentStatus": "paid",
  "approvalStatus": "approved",
  "cancelReason": null,
  "customer": {
    "id": 2001,
    "reference": "EXT-CUSTOMER-REF-001",
    "name": "Laura",
    "lastname": "Gómez",
    "email": "laura.gomez@example.com",
    "phone": "+56987654321"
  },
  "provider": {
    "id": 42,
    "reference": "PROV-REF-42",
    "name": "Servicios del Sur",
    "lastname": "SpA",
    "email": "contacto@serviciosdelsur.example.com",
    "phone": "+56912345678",
    "identificationNumber": "76123456-7",
    "assignedTo": {
      "name": "María",
      "lastname": "Técnica",
      "email": "maria.tecnica@example.com"
    }
  },
  "project": {
    "id": 88,
    "reference": "PROJ-EXT-100"
  },
  "booking": {
    "id": 10452,
    "reference": "ORD-2025-001"
  },
  "createdDate": "2025-03-10T14:22:00.000Z",
  "qualifyingQuestions": [
    {
      "id": 9001,
      "fieldId": 31,
      "label": "Which service do you need?",
      "type": "text",
      "value": "Interior painting"
    },
    {
      "id": 9002,
      "fieldId": 32,
      "label": "Urgency",
      "type": "select",
      "value": "High"
    }
  ],
  "dynamicForms": [
    {
      "id": 7310,
      "name": "Additional information",
      "flow": "lead_additional_info",
      "createdDate": "2025-03-10T14:22:05.000Z",
      "fields": [
        {
          "id": 51020,
          "reference": "square_meters",
          "label": "Square meters",
          "type": "numeric",
          "value": "120",
          "secondaryValue": null
        },
        {
          "id": 51021,
          "reference": "has_garage",
          "label": "Has a garage?",
          "type": "select",
          "value": "Yes",
          "secondaryValue": null
        },
        {
          "id": 51022,
          "reference": "garage_cars",
          "label": "How many cars?",
          "type": "short_text",
          "value": "2",
          "secondaryValue": null
        },
        {
          "id": 51024,
          "reference": "rooms",
          "label": "Rooms to paint",
          "type": "checkbox",
          "value": "Living room, Kitchen",
          "secondaryValue": null
        }
      ]
    }
  ],
  "statusHistory": [
    {
      "id": 15004,
      "status": "sold",
      "flow": "manual_sold",
      "triggerUser": {
        "id": 3120,
        "reference": null
      },
      "createdDate": "2025-03-20T16:40:00.000Z"
    },
    {
      "id": 15003,
      "status": "scheduled",
      "flow": "first_booking_scheduled",
      "triggerUser": {
        "id": 3120,
        "reference": null
      },
      "createdDate": "2025-03-12T10:15:00.000Z"
    },
    {
      "id": 15002,
      "status": "active",
      "flow": "automatically_set_lead_status_to_active",
      "triggerUser": null,
      "createdDate": "2025-03-10T14:23:00.000Z"
    },
    {
      "id": 15001,
      "status": "created",
      "flow": "create",
      "triggerUser": null,
      "createdDate": "2025-03-10T14:22:00.000Z"
    }
  ]
}

Lead without provider, forms or status changes:

json
{
  "id": 4498,
  "reference": "LEAD-EXT-0987",
  "status": "created",
  "paymentStatus": "active",
  "approvalStatus": null,
  "cancelReason": null,
  "customer": {
    "id": 2001,
    "reference": "EXT-CUSTOMER-REF-001",
    "name": "Laura",
    "lastname": "Gómez",
    "email": "laura.gomez@example.com",
    "phone": "+56987654321"
  },
  "provider": null,
  "project": null,
  "booking": null,
  "createdDate": "2025-03-02T09:05:00.000Z",
  "qualifyingQuestions": [],
  "dynamicForms": [],
  "statusHistory": []
}

Response Fields

FieldTypeDescription
idnumberSodtrack lead id.
referencestringnull
statusstringLead status. One of: "created", "active", "scheduled", "quoted", "in_execution", "sold", "completed", "done", "cancelled".
paymentStatusstringnull
approvalStatusstringnull
cancelReasonstringnull
customerobjectnull
providerobjectnull
projectobjectnull
bookingobjectnull
createdDatestringLead creation timestamp.
qualifyingQuestionsarrayAnswers to the lead form (see Qualifying question). Empty when the lead has none.
dynamicFormsarrayDynamic forms filled for the lead (see Dynamic form). Empty when none was filled.
statusHistoryarrayStatus changes of the lead, most recent first (see Status change). Empty when no change was recorded.

Customer (customer)

FieldTypeDescription
idnumberSodtrack customer id.
referencestringnull
namestringnull
lastnamestringnull
emailstringnull
phonestringnull

Provider (provider)

FieldTypeDescription
idnumberProvider id. When the assignee belongs to a company, this is the company id.
referencestringnull
namestringProvider first name or company name.
lastnamestringProvider last name.
emailstringProvider email.
phonestringnull
identificationNumberstringnull
assignedToobjectnull

Qualifying question (qualifyingQuestions[])

FieldTypeDescription
idnumberAnswer id.
fieldIdnumbernull
labelstringnull
typestringnull
valuestringSubmitted answer.

Dynamic form (dynamicForms[])

FieldTypeDescription
idnumberId of this form submission.
namestringForm name.
flowstringnull
createdDatestringTimestamp of the submission.
fieldsarrayFields of the form (see Dynamic form field).

Dynamic form field (dynamicForms[].fields[])

FieldTypeDescription
idnumberField id within this submission.
referencestringnull
labelstringField label.
typestringField type, for example "text", "short_text", "numeric", "currency", "date", "hour", "boolean", "select", "checkbox", "attachment" or "signature".
valuestringnull
secondaryValuestringnull

Status change (statusHistory[])

FieldTypeDescription
idnumberStatus change id.
statusstringStatus the lead moved to. Same values as status.
flowstringnull
triggerUserobjectnull
createdDatestringTimestamp of the change.

Error Responses

HTTP StatusErrorDescription
400 Bad RequestValidation failed (numeric string is expected)leadId is not an integer.
401 Unauthorized—API key missing or invalid, or the request does not come from an authorized network.
403 Forbidden—The request origin is not allowed.
404 Not FoundLEAD_NOT_FOUNDNo lead matches leadId, or the lead was deleted.
500 Internal Server Error—Unexpected server error. Contact Sodtrack support.

Business Rules & Constraints

Provider

When the provider assigned to the lead belongs to a company, provider describes the company and assignedTo carries the person actually assigned. For an independent provider, provider describes that provider and assignedTo is null.

Qualifying questions

  • qualifyingQuestions contains the answers sent in qualifyingQuestions of Create Lead, ordered by the position of each question in the lead form.
  • fieldId matches the fieldReference sent on creation, so each answer can be traced back to the question it answers.
  • label is the question label at the time the lead was created. If it was not stored, the current label of the lead form field is returned.
  • Answers whose field was later removed from the lead form are still returned, at the end of the list, with fieldId and type set to null.

Dynamic forms

Each entry in dynamicForms is one form submission. The same form can appear more than once if it was filled more than once. flow indicates when the form was filled:

flowWhen it is filled
"lead_additional_info"Additional information, for example the dynamicForms sent in Create Lead.
"lead_status_cancelled"When the lead is cancelled, for example the dynamicForms sent in Cancel Lead.
"lead_status_sold"When the lead is marked as sold in Sodtrack.
"lead_status_completed"When the lead is marked as completed in Sodtrack.

Leads created before some of these forms existed may also show "lead_status_done" or "lead_payment_status_paid".

Only forms visible to Sodtrack administrators are returned.

Dynamic form values

  • Option fields ("select", "boolean", "checkbox"): value is the selected option. For "checkbox", all selected options are returned in a single string, separated by ", ".
  • Conditional fields: when a field is shown only for a specific option of another field, it is returned only if that option was selected.
  • Attachment and signature fields: value is a temporary signed URL to download the file, valid for 24 hours. Request the lead again to get a new URL.
  • An option field with no option selected, or any field without a stored answer, is returned with value set to null.

Status history

  • statusHistory lists every recorded status change, ordered from the most recent to the oldest.
  • Changes that did not modify the lead status are not recorded.

Data and format

  • Timestamps use ISO 8601 (UTC).
  • Deleted leads are not returned; requesting one responds 404 Not Found.