Leads
Look up a customer's record with all their conversations and tickets.
A lead is the record Tolky keeps for each customer: name, contact data, a summary of who they are, a score, the pipeline stage, and every conversation and ticket they had with your avatar.
You can find a lead three ways, depending on the ID you have at hand:
| You have | Use |
|---|---|
| The Tolky lead ID | Lead details |
Your own customer ID (externalId) | Lead by external ID |
| A conversation ID | Lead by conversation |
To give a lead your own ID, send externalId when you create a conversation.
Lead details
ReferenceTechnical details
POST /api/externalAPIs/public/tolkyReasoning/leads/getLeadDetails
Authentication: host token. Only leads of your account are returned.
| Parameter | Type | Required | Description |
|---|---|---|---|
leadId | string (UUID) | Yes | Tolky lead ID. |
curl -X POST "https://api.tolky.to/api/externalAPIs/public/tolkyReasoning/leads/getLeadDetails" \
-H "Authorization: Bearer $TOLKY_TOKEN" \
-H "Content-Type: application/json" \
-d '{ "leadId": "9b1d4c7e-..." }'{
"code": 200,
"message": "OK",
"data": {
"id": "9b1d4c7e-...",
"external_id": "customer-1042",
"lead_name": "Ana Souza",
"user_name": "Ana Souza",
"email": "ana@example.com",
"phone": "5541999990000",
"created_at": "2026-10-02T12:00:00.000Z",
"updated_at": "2026-11-16T13:58:02.000Z",
"host_id": "<your-host-id>",
"lead_summary": "Recurring customer, interested in express delivery.",
"sentiment": 8,
"location": "Curitiba",
"last_interaction_at": "2026-11-16T13:58:02.000Z",
"pipeline_stage": 2,
"user_score": 70,
"user_score_explain": "Asked for prices twice this week.",
"ask_human_help": false,
"is_paused": false,
"conversations": [
{
"conversation_id": "3f0c2a8e-...",
"dialogue_summary": "Asked about Saturday delivery.",
"created_at": "2026-11-16T13:50:00.000Z",
"ask_human_help": false,
"closed": false
}
],
"tickets": [
{
"id": "1a2b3c4d-...",
"subject": "Change delivery address",
"description": "Customer wants to deliver to a new address.",
"status_name": "Open",
"status_level": 1,
"closed": false,
"created_at": "2026-11-16T13:55:00.000Z",
"conversation_id": "3f0c2a8e-...",
"friendly_protocol": "20261116-0001"
}
]
}
}| Field | Description |
|---|---|
id, external_id | Tolky ID and your ID. |
lead_name, user_name, email, phone, location | Contact data. |
lead_summary | Summary of the customer. |
sentiment | Sentiment score. |
user_score, user_score_explain | Lead score and its explanation. |
pipeline_stage | Pipeline stage number. |
ask_human_help | true when the customer is waiting for a person. |
is_paused | true when the avatar is paused for this lead. |
last_interaction_at, created_at, updated_at | Dates. |
conversations | All conversations of the lead, oldest first: conversation_id, dialogue_summary, created_at, ask_human_help, closed. |
tickets | Tickets of the lead: id, subject, description, status_name, status_level, closed, created_at, conversation_id, friendly_protocol. |
Lead by external ID
Returns the same data as lead details, found by your own customer ID.
ReferenceTechnical details
POST /api/externalAPIs/public/tolkyReasoning/leads/getLeadByExternalId
| Parameter | Type | Required | Description |
|---|---|---|---|
externalId | string | Yes | The ID you gave the customer. |
curl -X POST "https://api.tolky.to/api/externalAPIs/public/tolkyReasoning/leads/getLeadByExternalId" \
-H "Authorization: Bearer $TOLKY_TOKEN" \
-H "Content-Type: application/json" \
-d '{ "externalId": "customer-1042" }'The response has the same fields as lead details.
Lead by conversation
Returns the lead ID of a conversation and the list of all conversations of that lead. Use it to rebuild a customer's history from any of their conversations.
ReferenceTechnical details
POST /api/externalAPIs/public/tolkyReasoning/leads/getLeadByConversation
| Parameter | Type | Required | Description |
|---|---|---|---|
conversationId | string (UUID) | Yes | Any conversation of the lead. |
curl -X POST "https://api.tolky.to/api/externalAPIs/public/tolkyReasoning/leads/getLeadByConversation" \
-H "Authorization: Bearer $TOLKY_TOKEN" \
-H "Content-Type: application/json" \
-d '{ "conversationId": "3f0c2a8e-..." }'{
"code": 200,
"message": "OK",
"data": {
"lead_id": "9b1d4c7e-...",
"conversations": [
{
"conversation_id": "3f0c2a8e-...",
"dialogue_summary": "Asked about Saturday delivery.",
"created_at": "2026-11-16T13:50:00.000Z",
"ask_human_help": false,
"closed": false
}
]
}
}Errors
ErrorsTechnical details
| Status | When |
|---|---|
400 | The ID field is missing, or the token does not resolve to an account. |
404 | The lead or conversation does not exist in your account. |
500 | Internal error. |