Get Lead
Returns the full detail of a single lead, identified by its Sodtrack id.
/api/integration/lead/{leadId}Request
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
| Name | Type | Description |
|---|---|---|
leadIdrequired | string | — |
Responses
{
"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
| Field | Type | Required | Description |
|---|---|---|---|
x-api-key (header) | string | ✅ | External integration API key provided by Sodtrack. |
🔎 Path parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
leadId | number | ✅ | Sodtrack lead id. Must be an integer. |
Example Request
Path parameter example:
leadId = 4521Response Example
{
"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:
{
"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
| Field | Type | Description |
|---|---|---|
id | number | Sodtrack lead id. |
reference | string | null |
status | string | Lead status. One of: "created", "active", "scheduled", "quoted", "in_execution", "sold", "completed", "done", "cancelled". |
paymentStatus | string | null |
approvalStatus | string | null |
cancelReason | string | null |
customer | object | null |
provider | object | null |
project | object | null |
booking | object | null |
createdDate | string | Lead creation timestamp. |
qualifyingQuestions | array | Answers to the lead form (see Qualifying question). Empty when the lead has none. |
dynamicForms | array | Dynamic forms filled for the lead (see Dynamic form). Empty when none was filled. |
statusHistory | array | Status changes of the lead, most recent first (see Status change). Empty when no change was recorded. |
Customer (customer)
| Field | Type | Description |
|---|---|---|
id | number | Sodtrack customer id. |
reference | string | null |
name | string | null |
lastname | string | null |
email | string | null |
phone | string | null |
Provider (provider)
| Field | Type | Description |
|---|---|---|
id | number | Provider id. When the assignee belongs to a company, this is the company id. |
reference | string | null |
name | string | Provider first name or company name. |
lastname | string | Provider last name. |
email | string | Provider email. |
phone | string | null |
identificationNumber | string | null |
assignedTo | object | null |
Qualifying question (qualifyingQuestions[])
| Field | Type | Description |
|---|---|---|
id | number | Answer id. |
fieldId | number | null |
label | string | null |
type | string | null |
value | string | Submitted answer. |
Dynamic form (dynamicForms[])
| Field | Type | Description |
|---|---|---|
id | number | Id of this form submission. |
name | string | Form name. |
flow | string | null |
createdDate | string | Timestamp of the submission. |
fields | array | Fields of the form (see Dynamic form field). |
Dynamic form field (dynamicForms[].fields[])
| Field | Type | Description |
|---|---|---|
id | number | Field id within this submission. |
reference | string | null |
label | string | Field label. |
type | string | Field type, for example "text", "short_text", "numeric", "currency", "date", "hour", "boolean", "select", "checkbox", "attachment" or "signature". |
value | string | null |
secondaryValue | string | null |
Status change (statusHistory[])
| Field | Type | Description |
|---|---|---|
id | number | Status change id. |
status | string | Status the lead moved to. Same values as status. |
flow | string | null |
triggerUser | object | null |
createdDate | string | Timestamp of the change. |
Error Responses
| HTTP Status | Error | Description |
|---|---|---|
400 Bad Request | Validation 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 Found | LEAD_NOT_FOUND | No 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
qualifyingQuestionscontains the answers sent inqualifyingQuestionsof Create Lead, ordered by the position of each question in the lead form.fieldIdmatches thefieldReferencesent on creation, so each answer can be traced back to the question it answers.labelis 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
fieldIdandtypeset tonull.
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:
flow | When 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"):valueis 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:
valueis 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
valueset tonull.
Status history
statusHistorylists 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.