Get leads for a chatbot
GET/v1/chatbots/{chatbotId}/leads
List the leads a chatbot captured in conversations with the legacy v1 API, with contact details and the answers collected.
Working draft. These docs are illustrative: names, endpoints and examples describe the intended behaviour and can change before launch.
Returns the leads captured by a chatbot. Call it to push new leads to your CRM or to a sales channel on a schedule.
Request
GET /v1/chatbots/{chatbotId}/leads
Path parameters:
| Name | Type | Required | Description |
|---|---|---|---|
chatbotId |
string | Yes | The ID of the chatbot, starting with agt_. |
Query parameters:
| Name | Type | Required | Description |
|---|---|---|---|
page |
integer | No | Page number, starting at 1. Defaults to 1. |
size |
integer | No | Number of leads per page. Defaults to 20. |
from |
string | No | Only leads captured at or after this ISO 8601 UTC time. |
to |
string | No | Only leads captured before this ISO 8601 UTC time. |
A lead appears here when the agent runs the Collect leads action in a conversation. See Collect leads for how to set it up. To get a push instead of polling, subscribe to the lead.captured webhook, described in Webhooks.
Example request
curl "https://api.askocto.co/v1/chatbots/agt_8f3k2m/leads?from=2026-03-01T00:00:00Z" \
-H "Authorization: Bearer $OCTO_API_KEY"
const url = new URL("https://api.askocto.co/v1/chatbots/agt_8f3k2m/leads")
url.searchParams.set("from", "2026-03-01T00:00:00Z")
const response = await fetch(url, {
headers: { Authorization: `Bearer ${process.env.OCTO_API_KEY}` },
})
const { data } = await response.json()
for (const lead of data) {
console.log(lead.email, lead.conversationId)
}
Example response
A successful call returns 200 OK.
{
"data": [
{
"id": "led_3q8v1c",
"chatbotId": "agt_8f3k2m",
"conversationId": "conv_5n2p8w",
"name": "Maya Jensen",
"email": "maya@example.com",
"phone": null,
"fields": {
"company": "Harbor Outfitters",
"interest": "Team plan"
},
"createdAt": "2026-03-20T14:02:00Z"
}
],
"page": 1,
"size": 20,
"total": 1
}
Response fields
| Name | Type | Description |
|---|---|---|
data[].id |
string | The lead ID, starting with led_. |
data[].conversationId |
string | The conversation where the lead was captured. |
data[].name, email, phone |
string | Contact details the visitor gave. Missing details are null. |
data[].fields |
object | Extra answers the agent collected, keyed by field name. |
data[].createdAt |
string | ISO 8601 UTC time of capture. |
page, size, total |
integer | Paging details, as in all v1 lists. |
Errors
| Status | Code | When |
|---|---|---|
| 400 | invalid_request |
page or size is invalid, or from or to is not an ISO 8601 time. |
| 401 | unauthorized |
The API key is missing, malformed or revoked. |
| 404 | not_found |
No chatbot with this ID exists in your workspace. |
| 429 | rate_limited |
Too many requests. Wait for the number of seconds in the Retry-After header. |