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"}'
const response = await fetch(
'https://api.magpipe.ai/functions/v1/list-chat-sessions',
{
method: 'POST',
headers: {
'Authorization': 'Bearer YOUR_API_KEY',
'Content-Type': 'application/json',
},
body: JSON.stringify({ limit: 20, status: 'active' }),
}
);
const { sessions, total } = await response.json();
console.log(`Found ${total} active sessions`);
import requests
response = requests.post(
'https://api.magpipe.ai/functions/v1/list-chat-sessions',
headers={
'Authorization': 'Bearer YOUR_API_KEY',
'Content-Type': 'application/json',
},
json={'limit': 20, 'status': 'active'}
)
data = response.json()
print(f"Found {data['total']} active sessions")
{
"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
}
Chat Widget
List Chat Sessions
List all chat sessions for your account
POST
/
list-chat-sessions
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"}'
const response = await fetch(
'https://api.magpipe.ai/functions/v1/list-chat-sessions',
{
method: 'POST',
headers: {
'Authorization': 'Bearer YOUR_API_KEY',
'Content-Type': 'application/json',
},
body: JSON.stringify({ limit: 20, status: 'active' }),
}
);
const { sessions, total } = await response.json();
console.log(`Found ${total} active sessions`);
import requests
response = requests.post(
'https://api.magpipe.ai/functions/v1/list-chat-sessions',
headers={
'Authorization': 'Bearer YOUR_API_KEY',
'Content-Type': 'application/json',
},
json={'limit': 20, 'status': 'active'}
)
data = response.json()
print(f"Found {data['total']} active sessions")
{
"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
}
Retrieve all chat sessions from your chat widgets with pagination support.
Request Body
integer
default:50
Maximum sessions to return. Max: 100.
integer
default:0
Number of records to skip for pagination.
string
Filter by specific widget UUID.
string
Filter by session status:
active or closed.string
Filter sessions after this ISO 8601 date.
Response
array
Array of chat session objects with last message preview.
integer
Total number of sessions matching filters.
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"}'
const response = await fetch(
'https://api.magpipe.ai/functions/v1/list-chat-sessions',
{
method: 'POST',
headers: {
'Authorization': 'Bearer YOUR_API_KEY',
'Content-Type': 'application/json',
},
body: JSON.stringify({ limit: 20, status: 'active' }),
}
);
const { sessions, total } = await response.json();
console.log(`Found ${total} active sessions`);
import requests
response = requests.post(
'https://api.magpipe.ai/functions/v1/list-chat-sessions',
headers={
'Authorization': 'Bearer YOUR_API_KEY',
'Content-Type': 'application/json',
},
json={'limit': 20, 'status': 'active'}
)
data = response.json()
print(f"Found {data['total']} active sessions")
{
"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
}
⌘I