GET /v1/ai-agent/leads/{projectId}/{chatbotId}| Parameter | Type | Required | Description |
|---|---|---|---|
projectId | integer | Yes | Unique identifier of the project. |
chatbotId | string | Yes | Unique identifier of the chatbot. |
| Parameter | Type | Required | Description |
|---|---|---|---|
nextPageToken | string | No | Token used to retrieve the next page of lead records. |
sessionId | string | No | Unique identifier of a session. If provided, the API returns leads captured for the given session only. |
200 OK{
"message": "Leads retrieved successfully.",
"data": {
"report": {
"columns": [
"id",
"created_at",
"source",
"page_url",
"ip_address",
"lead_data"
],
"rows": [
{
"id": "lead_12345",
"created_at": "2025-01-15 10:30:00",
"source": "chatbot",
"page_url": "https://example.com/contact",
"ip_address": "192.168.1.1",
"lead_data": [
{
"field_name": "name",
"field_type": "text",
"field_value": "John Doe"
},
{
"field_name": "email",
"field_type": "email",
"field_value": "john@example.com"
}
]
}
],
"next_page_token": "eyJwYWdlIjoyfQ=="
}
}
}| Field | Type | Description |
|---|---|---|
message | string | Response status message. |
data | object | Response data object. |
data.report | object | Lead report object containing columns, rows, and pagination details. |
data.report.columns | array of strings | List of column names included in the lead report. |
data.report.rows | array of objects | List of lead records captured by the AI agent. |
data.report.rows[].id | string | Unique identifier of the lead record. |
data.report.rows[].created_at | string | Date and time when the lead was captured. |
data.report.rows[].source | string | Source from which the lead was captured. |
data.report.rows[].page_url | string | Page URL where the lead was captured. |
data.report.rows[].ip_address | string | IP address of the user who submitted the lead. |
data.report.rows[].lead_data | array of objects | List of captured lead form fields and their values. |
data.report.rows[].lead_data[].field_name | string | Name of the captured form field. |
data.report.rows[].lead_data[].field_type | string | Type of the captured form field. |
data.report.rows[].lead_data[].field_value | string | Value submitted for the captured form field. |
data.report.next_page_token | string | Token used to fetch the next page of results. If no more records are available, this may be empty or null. |
curl --location 'https://agents.robofy.ai/v1/ai-agent/leads//?nextPageToken=undefined&sessionId=undefined' \
--header 'Authorization: Bearer <token>'{
"message": "string",
"data": {
"report": {
"columns": [
"string"
],
"rows": [
{
"id": "string",
"created_at": "string",
"source": "string",
"page_url": "string",
"ip_address": "string",
"lead_data": [
{
"field_name": "string",
"field_type": "string",
"field_value": "string"
}
]
}
]
},
"next_page_token": "string"
}
}