> ## Documentation Index
> Fetch the complete documentation index at: https://cometchat-013b37f0.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Legacy Webhooks Overview

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:

```html theme={null}
Authorization: Basic <Base64-encoded-credentials>
```

> Set your username and password while configuring the webhook on the CometChat dashboard.

***

## Webhook Triggers

Below are the legacy webhook events supported by CometChat:

### Message Events

These events are triggered during the lifecycle of a message.

| Event                                                                           | Description                                                                     |
| ------------------------------------------------------------------------------- | ------------------------------------------------------------------------------- |
| [before\_message](./webhooks-legacy-events#before_message)                      | Triggered when a message is in-flight—just before it is processed by CometChat. |
| [after\_message](./webhooks-legacy-events#after_message)                        | Triggered after a message has been successfully sent.                           |
| [message\_delivery\_receipt](./webhooks-legacy-events#message_delivery_receipt) | Triggered when a message is marked as delivered to a user.                      |
| [message\_read\_receipt](./webhooks-legacy-events#message_read_receipt)         | Triggered when a message is marked as read by the recipient.                    |

### User Events

These events relate to changes in user presence status.

| Event                                                                                      | Description                                                                |
| ------------------------------------------------------------------------------------------ | -------------------------------------------------------------------------- |
| [user\_connection\_status\_change](./webhooks-legacy-events#user_connection_status_change) | Triggered when a user connects or disconnects from the CometChat platform. |

***

Next Steps:

* [Manage Webhooks](/fundamentals/webhooks-legacy-management)
* [View Full Event Payloads](/fundamentals/webhooks-legacy-events)
