Leads
List the people your agents have met, and fetch one lead with their meetings.
A lead is a person who told one of your agents who they are, usually through the visitor form. Leads are unique by email within your workspace, so a person who comes back is the same lead. Both endpoints need a key with the leads:read scope.
A visitor who never gave an email (an agent with its visitor form off) still gets a lead, as an anonymous placeholder whose email ends in @anonymous.invalid. The list leaves those out unless you ask for them. Their meetings are always in GET /api/v1/meetings.
The lead object
| Name | Type | Description |
|---|---|---|
id | string | The lead's id. Meetings and webhooks refer to it as lead_id. |
tenant_id | string | Your workspace's id. |
email | string | The email the person gave. Unique within the workspace, compared without regard to case. |
name | string | null | Their name, when they gave one. |
company | string | null | Their company, when they gave one. |
role | string | null | Their role, when they gave one. |
first_seen_at | number | When the lead was created, in Unix seconds. |
last_seen_at | number | When the person was last seen, in Unix seconds. |
meeting_count | number | How many meetings they have had. |
lead_score | 'hot' | 'warm' | 'cold' | null | The score from their latest scored meeting. Only presentation and tour meetings are scored; null until one is. |
status | 'new' | 'engaged' | 'qualified' | 'disqualified' | new until their first meeting, then engaged. Your team sets qualified or disqualified on the lead in the dashboard. |
custom_fields | object | Answers to your own visitor-form questions, keyed by field. An empty object when there are none. |
language | string | null | A language code such as hi-IN when one was set for this person. null means the workspace default. |
List leads
GET /api/v1/leads returns leads, most recently seen first.
| Name | Type | Description |
|---|---|---|
status | string | Only leads with this status: new, engaged, qualified or disqualified. |
score | string | Only leads with this lead_score: hot, warm or cold. |
q | string | Search text. Matches the lead's name, email, company or any answer on your visitor form. |
include_anonymous | boolean | true also lists anonymous visitors.Default: false |
limit | number | Leads per page, 1 to 500.Default: 100 |
offset | number | How many leads to skip.Default: 0 |
curl 'https://api.insurgeai.com/api/v1/leads?status=engaged&limit=50' \
-H "Authorization: Bearer $INSURGE_API_KEY"{
"leads": [
{
"id": "c41e7b2a9d3f4e6a8b1c5d7f9e2a4b6c",
"tenant_id": "acme",
"email": "arjun@example.org",
"name": "Arjun Rao",
"company": "Northwind Traders",
"role": null,
"first_seen_at": 1796122800.4,
"last_seen_at": 1796122800.5,
"meeting_count": 1,
"lead_score": null,
"status": "engaged",
"custom_fields": {},
"language": null
},
{
"id": "3f6c1a9e2b7d4e5f8a9b0c1d2e3f4a5b",
"tenant_id": "acme",
"email": "priya@example.com",
"name": "Priya Sharma",
"company": "Example Labs",
"role": "Head of Operations",
"first_seen_at": 1796119198.3,
"last_seen_at": 1796119200.6,
"meeting_count": 1,
"lead_score": "hot",
"status": "engaged",
"custom_fields": {
"team_size": "40"
},
"language": null
}
],
"count": 2
}count is the number of leads in this page. Keep asking with a larger offset until a page has fewer than limit leads.
| Status | When |
|---|---|
401 | The key is missing, wrong, expired or revoked. |
403 | The key doesn't have leads:read. |
422 | limit or offset is out of range. |
Get a lead
GET /api/v1/leads/{lead_id} returns one lead and their meetings, newest first (up to 100). Each meeting has the shape of an item in List meetings.
| Name | Type | Description |
|---|---|---|
lead_id required | string | The lead's id, from a meeting, a webhook or the list. |
curl 'https://api.insurgeai.com/api/v1/leads/your_lead_id' \
-H "Authorization: Bearer $INSURGE_API_KEY"{
"lead": {
"id": "3f6c1a9e2b7d4e5f8a9b0c1d2e3f4a5b",
"tenant_id": "acme",
"email": "priya@example.com",
"name": "Priya Sharma",
"company": "Example Labs",
"role": "Head of Operations",
"first_seen_at": 1796119198.3,
"last_seen_at": 1796119200.6,
"meeting_count": 1,
"lead_score": "hot",
"status": "engaged",
"custom_fields": {
"team_size": "40"
},
"language": null
},
"meetings": [
{
"id": "9b2e7c4d1a3f4b6e8d0c2a4e6f8b1d3c",
"lead_id": "3f6c1a9e2b7d4e5f8a9b0c1d2e3f4a5b",
"client_id": "b0c6f1e2-5a7d-4c39-9e8b-2f4d6a1c3e5b",
"started_at": 1796119200.4,
"ended_at": 1796119612.4,
"duration_s": 412.0,
"plan_slug": "agent:product-tour",
"final_phase": null,
"status": "completed",
"objectives_total": 4,
"objectives_completed": 4,
"lang": "en-IN",
"channel": null,
"agent_id": "product-tour",
"platform": "desktop_web",
"source": null,
"embed_host": "www.example.com",
"progress": {
"sections_done": [
"Workspace",
"Pipelines",
"Alerts",
"Reports"
],
"sections_total": 4,
"next_section": null
},
"resumed_from_meeting_id": null,
"lead_name": "Priya Sharma",
"lead_email": "priya@example.com",
"lead_company": "Example Labs",
"lead_role": "Head of Operations",
"lead_score": "hot",
"lead_status": "engaged",
"requested_follow_up": 1
}
]
}| Status | When |
|---|---|
403 | The key doesn't have leads:read. |
404 | Lead not found: <id>. There is no lead with this id in the key's workspace. |