Initialize a new live chat session for your website or app
POST
/
live-chat
/
sessions
Copy
Ask AI
curl -X POST https://api.avoca.ai/v1/live-chat/sessions \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "X-Workspace-ID: YOUR_WORKSPACE_ID" \ -H "Content-Type: application/json" \ -d '{ "source_id": "site_abc123", "visitor": { "ip_address": "192.168.1.1", "user_agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64)...", "referrer": "https://google.com", "page_url": "https://yoursite.com/services/ac-repair" }, "initial_message": "Hi, I need help with my AC unit", "custom_fields": { "lead_source": "Google Ads", "service_interest": "AC Repair" } }'
Copy
Ask AI
{ "data": { "session_id": "chat_jkl012", "assistant_id": "asst_chat_001", "status": "active", "websocket_url": "wss://chat.avoca.ai/v1/sessions/chat_jkl012", "widget_config": { "theme_color": "#2563EB", "greeting_message": "Hi! I'm here to help with your HVAC needs. What can I assist you with today?", "business_hours": true }, "estimated_wait": 0 }, "meta": { "request_id": "req_xyz789", "timestamp": "2024-01-20T10:30:00Z" }}
Create AI-powered live chat sessions for website or app visitors. The chat widget can be embedded on any page and provides real-time communication with intelligent responses.
curl -X POST https://api.avoca.ai/v1/live-chat/sessions \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "X-Workspace-ID: YOUR_WORKSPACE_ID" \ -H "Content-Type: application/json" \ -d '{ "source_id": "site_abc123", "visitor": { "ip_address": "192.168.1.1", "user_agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64)...", "referrer": "https://google.com", "page_url": "https://yoursite.com/services/ac-repair" }, "initial_message": "Hi, I need help with my AC unit", "custom_fields": { "lead_source": "Google Ads", "service_interest": "AC Repair" } }'
Copy
Ask AI
{ "data": { "session_id": "chat_jkl012", "assistant_id": "asst_chat_001", "status": "active", "websocket_url": "wss://chat.avoca.ai/v1/sessions/chat_jkl012", "widget_config": { "theme_color": "#2563EB", "greeting_message": "Hi! I'm here to help with your HVAC needs. What can I assist you with today?", "business_hours": true }, "estimated_wait": 0 }, "meta": { "request_id": "req_xyz789", "timestamp": "2024-01-20T10:30:00Z" }}
curl -X POST https://api.avoca.ai/v1/live-chat/sessions \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "X-Workspace-ID: YOUR_WORKSPACE_ID" \ -H "Content-Type: application/json" \ -d '{ "source_id": "site_abc123", "visitor": { "ip_address": "192.168.1.1", "user_agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64)...", "referrer": "https://google.com", "page_url": "https://yoursite.com/services/ac-repair" }, "initial_message": "Hi, I need help with my AC unit", "custom_fields": { "lead_source": "Google Ads", "service_interest": "AC Repair" } }'
Copy
Ask AI
{ "data": { "session_id": "chat_jkl012", "assistant_id": "asst_chat_001", "status": "active", "websocket_url": "wss://chat.avoca.ai/v1/sessions/chat_jkl012", "widget_config": { "theme_color": "#2563EB", "greeting_message": "Hi! I'm here to help with your HVAC needs. What can I assist you with today?", "business_hours": true }, "estimated_wait": 0 }, "meta": { "request_id": "req_xyz789", "timestamp": "2024-01-20T10:30:00Z" }}