List collected data
GET/v2/agents/{agentId}/collected-data
Return the records an agent gathered with its Collect data and Collect leads actions, filtered by action, conversation or date.
Working draft. These docs are illustrative: names, endpoints and examples describe the intended behaviour and can change before launch.
Returns the data an agent collected from customers during conversations: form answers from Collect data and contact details from Collect leads. Call it to sync new leads into your CRM or to export answers for a report.
Request
GET /v2/agents/{agentId}/collected-data
Path parameters:
| Name | Type | Required | Description |
|---|---|---|---|
agentId |
string | Yes | The ID of the agent, starting with agt_. |
Query parameters:
| Name | Type | Required | Description |
|---|---|---|---|
limit |
integer | No | Items per page, from 1 to 100. Defaults to 20. |
cursor |
string | No | The nextCursor value from the previous page. |
type |
string | No | data for Collect data records or lead for Collect leads records. |
actionId |
string | No | Return only records collected by this action, starting with act_. |
conversationId |
string | No | Return only records from this conversation, starting with conv_. |
from |
string | No | Only records created at or after this ISO 8601 UTC time. |
to |
string | No | Only records created before this ISO 8601 UTC time. |
Records come back newest first. Set up what the agent asks for in Collect data and Collect leads.
Example request
curl "https://api.askocto.co/v2/agents/agt_8f3k2m/collected-data?type=lead&from=2026-03-01T00:00:00Z" \
-H "Authorization: Bearer $OCTO_API_KEY"
const url = new URL("https://api.askocto.co/v2/agents/agt_8f3k2m/collected-data")
url.searchParams.set("type", "lead")
url.searchParams.set("from", "2026-03-01T00:00:00Z")
const response = await fetch(url, {
headers: { Authorization: `Bearer ${process.env.OCTO_API_KEY}` },
})
const { data, nextCursor } = await response.json()
for (const record of data) console.log(record.fields.email)
Example response
A successful call returns 200 OK.
{
"data": [
{
"id": "dat_2k8v5n",
"type": "lead",
"actionId": "act_7p3w9b",
"conversationId": "conv_5n2p8w",
"contactId": "con_6c4y1h",
"fields": {
"name": "Sam Rivera",
"email": "sam@example.com",
"company": "Rivera Outdoors"
},
"createdAt": "2026-03-20T14:02:00Z"
}
],
"nextCursor": null
}
Response fields
| Name | Type | Description |
|---|---|---|
id |
string | The record ID, starting with dat_. |
type |
string | data or lead. |
actionId |
string | The action that collected the record. |
conversationId |
string | The conversation where it was collected. |
contactId |
string or null | The contact the record is linked to, starting with con_. |
fields |
object | The values, keyed by the field names you configured on the action. |
createdAt |
string | When the record was created, as an ISO 8601 UTC time. |
Errors
| Status | Code | When |
|---|---|---|
| 400 | invalid_request |
limit is outside 1 to 100, or type, from or to has an invalid value. |
| 401 | unauthorized |
The API key is missing, malformed or deleted. |
| 404 | not_found |
No agent has this ID in your workspace. |
| 429 | rate_limited |
Too many requests. Wait for the number of seconds in the Retry-After header. |
Read more about cursors in Pagination.