Developers
ENPT

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 haveUse
The Tolky lead IDLead details
Your own customer ID (externalId)Lead by external ID
A conversation IDLead 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.

ParameterTypeRequiredDescription
leadIdstring (UUID)YesTolky 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"
      }
    ]
  }
}
FieldDescription
id, external_idTolky ID and your ID.
lead_name, user_name, email, phone, locationContact data.
lead_summarySummary of the customer.
sentimentSentiment score.
user_score, user_score_explainLead score and its explanation.
pipeline_stagePipeline stage number.
ask_human_helptrue when the customer is waiting for a person.
is_pausedtrue when the avatar is paused for this lead.
last_interaction_at, created_at, updated_atDates.
conversationsAll conversations of the lead, oldest first: conversation_id, dialogue_summary, created_at, ask_human_help, closed.
ticketsTickets 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

ParameterTypeRequiredDescription
externalIdstringYesThe 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

ParameterTypeRequiredDescription
conversationIdstring (UUID)YesAny 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
StatusWhen
400The ID field is missing, or the token does not resolve to an account.
404The lead or conversation does not exist in your account.
500Internal error.

Previous

Follow-up settings

Next

Avatars