Skip to main content
GET
/
v1
/
webhook
curl -X GET https://api.livchat.ai/v1/webhook \
  -H "Authorization: Bearer YOUR_API_KEY"
{
  "success": true,
  "code": 200,
  "data": {
    "webhook": "https://your-site.com/webhook",
    "subscribe": ["Message", "ReadReceipt"]
  }
}
Configure a webhook URL to receive real-time events like incoming messages and read receipts.

Get Webhook Configuration

/v1/webhook
Retrieve current webhook configuration

Set Webhook Configuration

/v1/webhook
Configure or update webhook URL

Request Body (POST)

webhookUrl
string
required
URL to receive webhook events (must be HTTPS)

Event Types

Subscribe to events when connecting the session:
EventDescription
MessageIncoming and outgoing messages
ReadReceiptMessage read confirmations
HistorySyncChat history synchronization
ChatPresenceOnline status and typing indicators

Webhook Payload

Events are sent as POST requests to your webhook URL:
{
  "event": {
    "info": {
      "id": "3EB04A45DCA355D01DB68C",
      "messageSource": {
        "chat": "5511999999999@s.whatsapp.net",
        "sender": "5511888888888@s.whatsapp.net",
        "isFromMe": false,
        "isGroup": false
      },
      "pushName": "John",
      "timestamp": "2024-12-10T10:00:00Z"
    },
    "message": {
      "conversation": "Hello!"
    }
  },
  "type": "Message"
}

Securing Webhooks (HMAC)

Configure HMAC signing for webhook verification:
# Configure HMAC key (min 32 characters)
curl -X POST https://api.livchat.ai/v1/session/hmac/config \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"hmacKey": "your_secret_key_minimum_32_characters"}'
Webhooks will include x-hmac-signature header for verification.
curl -X GET https://api.livchat.ai/v1/webhook \
  -H "Authorization: Bearer YOUR_API_KEY"
{
  "success": true,
  "code": 200,
  "data": {
    "webhook": "https://your-site.com/webhook",
    "subscribe": ["Message", "ReadReceipt"]
  }
}