Conversations API
List, retrieve, and manage chat conversations.
List Conversations
GET
/v1/conversationscurl -X GET "https://api.chatmefy.com/v1/conversations?limit=20" \
-H "Authorization: Bearer YOUR_API_KEY"
# Response
{
"data": [
{
"id": "conv_abc123",
"bot_id": "bot_xyz",
"status": "active",
"visitor": {
"email": "john@company.com",
"name": "John Smith"
},
"messages_count": 12,
"created_at": "2024-01-15T10:30:00Z",
"updated_at": "2024-01-15T10:45:00Z"
}
],
"meta": {
"total": 1250,
"page": 1,
"per_page": 20
}
}Query Parameters
limitintegerResults per page (1-100, default 20)pageintegerPage number (default 1)statusstringFilter by status: active, ended, handoffbot_idstringFilter by specific botsinceISO8601Filter by created dateGet Single Conversation
GET
/v1/conversations/:idcurl -X GET "https://api.chatmefy.com/v1/conversations/conv_abc123" \
-H "Authorization: Bearer YOUR_API_KEY"
# Response includes full conversation with messages
{
"data": {
"id": "conv_abc123",
"bot_id": "bot_xyz",
"status": "ended",
"visitor": {...},
"messages": [
{
"id": "msg_1",
"role": "bot",
"content": "Hello! How can I help you?",
"created_at": "2024-01-15T10:30:00Z"
},
{
"id": "msg_2",
"role": "user",
"content": "I have a question about pricing",
"created_at": "2024-01-15T10:30:15Z"
}
],
"lead": {...},
"metadata": {...}
}
}End Conversation
POST
/v1/conversations/:id/endcurl -X POST "https://api.chatmefy.com/v1/conversations/conv_abc123/end" \
-H "Authorization: Bearer YOUR_API_KEY"
# Response
{
"data": {
"id": "conv_abc123",
"status": "ended",
"ended_at": "2024-01-15T10:45:00Z"
}
}