Skip to main content
POST
/
v1
/
session
/
connect
curl -X POST https://api.livchat.ai/v1/session/connect \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "subscribe": ["Message", "ReadReceipt"],
    "immediate": false
  }'
{
  "success": true,
  "code": 200,
  "data": {
    "details": "Connected!",
    "events": "Message,ReadReceipt",
    "jid": "5511999999999.0:52@s.whatsapp.net",
    "webhook": "https://your-site.com/webhook"
  }
}
Initialize a connection to WhatsApp servers. If no existing session, it will generate a QR code for pairing.

Request Body

subscribe
string[]
Event types to receive via webhook. Options:
  • Message - Incoming messages
  • ReadReceipt - Read receipts
  • HistorySync - Chat history
  • ChatPresence - Online/typing status
immediate
boolean
If false, waits 10 seconds to verify successful login. Default: true

Response Fields

data.jid
string
Your WhatsApp JID if logged in
data.events
string
Subscribed event types
data.webhook
string
Configured webhook URL
curl -X POST https://api.livchat.ai/v1/session/connect \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "subscribe": ["Message", "ReadReceipt"],
    "immediate": false
  }'
{
  "success": true,
  "code": 200,
  "data": {
    "details": "Connected!",
    "events": "Message,ReadReceipt",
    "jid": "5511999999999.0:52@s.whatsapp.net",
    "webhook": "https://your-site.com/webhook"
  }
}