Webhook Endpoint Requirements
To ensure reliable delivery and security, your webhook endpoint must meet the following requirements:- HTTPS required: Your endpoint must use
HTTPSto ensure secure data transmission. - Public accessibility: It must be accessible from the public internet.
- Support for POST requests: The endpoint must accept
HTTP POSTrequests with aContent-Typeofapplication/json. - Immediate acknowledgment: Your server must respond with an
HTTP 200 OKstatus quickly to acknowledge receipt.
Security
It is strongly recommended to use Basic Authentication to protect your webhook endpoints.Header format
When enabled, every webhook request from CometChat will include the following HTTP header:Set your username and password while configuring the webhook on the CometChat dashboard.
Legacy webhook events
Below are the legacy webhook events supported by CometChat:| Event | Description |
|---|---|
| before_message | Triggered when a message is in-flight—just before it is processed by CometChat. |
| after_message | Triggered after a message has been successfully sent. |
| message_delivery_receipt | Triggered when a message is marked as delivered to a user. |
| message_read_receipt | Triggered when a message is marked as read by the recipient. |
| user_connection_status_change | Triggered when a user connects or disconnects from the CometChat platform. |
Manage legacy webhooks
You can manage and configure legacy webhooks in CometChat either from the dashboard UI or programmatically via Management APIs.Option 1: Manage from the dashboard

Steps
- Log in to your CometChat Dashboard and select your app.
- Go to Settings > Legacy Webhooks from the left menu.
- Click on Add New Webhook.
- Fill in the configuration:
- Webhook ID: A unique identifier for your webhook.
- URL: Endpoint where event payloads will be delivered.
- Triggers: Select the events you want to receive.
- Security: (Recommended) Enable authentication.
- Enable the webhook.
- Save the configuration.
Option 2: Manage via Management APIs
CometChat also provides Management APIs to automate webhook and trigger management.Webhook management endpoints
| Operation | API Reference |
|---|---|
| Create a new webhook | Create Webhook |
| Update an existing webhook | Update Webhook |
| List all webhooks | List Webhooks |
| Get a webhook by ID | Get Webhook |
| Delete a webhook | Delete Webhook |
Trigger management endpoints
| Operation | API Reference |
|---|---|
| Add triggers to a webhook | Add Triggers |
| List all triggers of a webhook | List Triggers |
| Remove triggers from a webhook | Remove Triggers |