GET — Chats / Leads Listing
Retrieve a paginated list of chats or leads and their metadata for a specific bot. Use the type parameter to switch between leads and non-lead chats.
Last updated
Was this helpful?
Was this helpful?
curl 'https://api.v7.botpenguin.com/inbox/direct/chats?botId=638d99eeee9e558f1247ae03&customerId=5fed38e56fb193dcc6c933f5&page=1&type=lead' \
-H 'x-bot-token: YOUR_API_TOKEN' \
-H 'Content-Type: application/json'{
"success": true,
"message": "ok",
"code": 200,
"data": [
{
"_id": "63d9ffa77a8d152facbe2f2f",
"uuid": "7e88d192-9b20-4035-9b68-d4ac3d58a34f",
"isOnline": false,
"status": "INPROGRESS",
"websiteVisits": 1,
"_agentAssigned": "631aa793bcfa100487d13d0d",
"lastMessage": {
"at": "2023-02-01T06:00:20.000Z",
"by": "bot",
"text": "Welcome to BotPenguin. I am here to help you."
},
"lastSeenAt": "2023-02-01T06:00:21.000Z",
"profile": {
"notes": [
{
"_id": "63db5c4abcbc3be2e95b20ae",
"title": "Sample title",
"description": "Sample description"
}
],
"userDetails": {
"name": "Sample name",
"picture": "https://example.com/avatar.jpg",
"contact": {
"email": "sample@email.com",
"phone": {
"number": "9876543210",
"prefix": "91"
}
},
"city": "Sample city",
"country": "Sample country",
"gender": "MALE",
"tags": ["Sample tag"],
"attributes": [
{ "key": "ID", "value": "BP001" }
]
}
},
"createdAt": "2023-02-01T05:59:03.533Z",
"updatedAt": "2023-02-02T06:46:34.119Z"
}
]
}{
"success": true,
"message": "ok",
"code": 200,
"data": [...]
}{
"success": false,
"message": "Bad request / invalid parameters",
"code": 400
}{
"success": false,
"message": "Unauthorized request",
"code": 401
}