Skip to main content
Legacy Notice: Legacy extensions are no longer actively maintained and will not receive feature updates or enhancements.For new projects, use Webhooks.
CometChat legacy webhooks enable real-time event-driven communication with your system. They allow you to receive HTTP POST requests whenever specific events occur—such as sending a message or a user coming online. These webhooks are ideal for integrating external services like SMS, email, analytics, or auditing systems.

Webhook Endpoint Requirements

To ensure reliable delivery and security, your webhook endpoint must meet the following requirements:
  1. HTTPS required: Your endpoint must use HTTPS to ensure secure data transmission.
  2. Public accessibility: It must be accessible from the public internet.
  3. Support for POST requests: The endpoint must accept HTTP POST requests with a Content-Type of application/json.
  4. Immediate acknowledgment: Your server must respond with an HTTP 200 OK status 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:

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

  1. Log in to your CometChat Dashboard and select your app.
  2. Go to Settings > Legacy Webhooks from the left menu.
  3. Click on Add New Webhook.
  4. 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.
  5. Enable the webhook.
  6. Save the configuration.

Option 2: Manage via Management APIs

CometChat also provides Management APIs to automate webhook and trigger management.

Webhook management endpoints

Trigger management endpoints


Event payloads

Message events

before_message

The endpoint will be triggered when a message is in-flight.

after_message

The endpoint will be triggered after a message is sent.

message_delivery_receipt

The endpoint will be triggered when a message is marked delivered.

message_read_receipt

The endpoint will be triggered when a message is marked read.

user_connection_status_change

The endpoint will be triggered when a users logs in or logs out of CometChat.