curl -X POST https://api.magpipe.ai/functions/v1/list-chat-sessions \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"limit": 20, "status": "active"}'
{
"sessions": [
{
"id": "e5f6a7b8-c9d0-1e2f-3a4b-567890cdef12",
"widget_id": "d4e5f6a7-b8c9-0d1e-2f3a-456789bcdef0",
"widget_name": "Support Widget",
"visitor_id": "v_abc123def456",
"visitor_name": "John",
"visitor_email": "john@example.com",
"status": "active",
"last_message": "Thanks, that helps!",
"last_message_at": "2024-01-15T10:45:00Z",
"message_count": 8,
"page_url": "https://example.com/pricing",
"created_at": "2024-01-15T10:30:00Z"
}
],
"total": 24
}
List all chat sessions for your account
curl -X POST https://api.magpipe.ai/functions/v1/list-chat-sessions \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"limit": 20, "status": "active"}'
{
"sessions": [
{
"id": "e5f6a7b8-c9d0-1e2f-3a4b-567890cdef12",
"widget_id": "d4e5f6a7-b8c9-0d1e-2f3a-456789bcdef0",
"widget_name": "Support Widget",
"visitor_id": "v_abc123def456",
"visitor_name": "John",
"visitor_email": "john@example.com",
"status": "active",
"last_message": "Thanks, that helps!",
"last_message_at": "2024-01-15T10:45:00Z",
"message_count": 8,
"page_url": "https://example.com/pricing",
"created_at": "2024-01-15T10:30:00Z"
}
],
"total": 24
}
active or closed.curl -X POST https://api.magpipe.ai/functions/v1/list-chat-sessions \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"limit": 20, "status": "active"}'
{
"sessions": [
{
"id": "e5f6a7b8-c9d0-1e2f-3a4b-567890cdef12",
"widget_id": "d4e5f6a7-b8c9-0d1e-2f3a-456789bcdef0",
"widget_name": "Support Widget",
"visitor_id": "v_abc123def456",
"visitor_name": "John",
"visitor_email": "john@example.com",
"status": "active",
"last_message": "Thanks, that helps!",
"last_message_at": "2024-01-15T10:45:00Z",
"message_count": 8,
"page_url": "https://example.com/pricing",
"created_at": "2024-01-15T10:30:00Z"
}
],
"total": 24
}