Skip to main content
POST
https://mtxbiyilvgwhbdptysex.supabase.co/functions/v1
/
list-chat-sessions
curl -X POST https://mtxbiyilvgwhbdptysex.supabase.co/functions/v1/list-chat-sessions \
  -H "Authorization: Bearer YOUR_API_TOKEN" \
  -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": "[email protected]",
      "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

limit
integer
default:50
Maximum sessions to return. Max: 100.
offset
integer
default:0
Number of records to skip for pagination.
widget_id
string
Filter by specific widget UUID.
status
string
Filter by session status: active or closed.
from_date
string
Filter sessions after this ISO 8601 date.

Response

sessions
array
Array of chat session objects with last message preview.
total
integer
Total number of sessions matching filters.
curl -X POST https://mtxbiyilvgwhbdptysex.supabase.co/functions/v1/list-chat-sessions \
  -H "Authorization: Bearer YOUR_API_TOKEN" \
  -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": "[email protected]",
      "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
}