Generic HTTP webhooks enable you to trigger HTTP endpoints and notify external services when events occur in Ably. Events include when messages are published, presence events occur, changes in channel occupancy, and when channels are created or discarded. Data can be delivered individually or in batches to any HTTP endpoint.
Create a generic HTTP webhook integration
On the Integrations page of your app:
- Click New Integration Rule.
- Choose Webhook.
- Choose Webhook.
- Configure the webhook settings.
- Click Create.
Settings
The following settings are available when creating a generic HTTP webhook integration:
| Setting | Description |
|---|---|
| URL | The HTTP/HTTPS endpoint URL where webhook requests will be sent. Ably strongly recommends using HTTPS for security. |
| Headers | Optional HTTP headers to include with each request. Use the format key:value, for example, X-Custom-Header:my-value. Each header should be on a new line. |
| Request Mode | Choose between Single request (sends each event individually) or Batch request (groups multiple events into a single request). |
| Event types | Choose which event types trigger the webhook: channel.message, channel.presence, channel.lifecycle, or channel.occupancy. |
| Channel filter | Filters the source channels based on a regular expression. |
| Encoding | Specifies the encoding format of messages. Either JSON or MsgPack. |
| Sign with key | Choose whether to sign webhook requests with your API key for security. |
| Enveloped | When enabled (default), messages are wrapped in additional metadata. When disabled, only the raw message data is sent. |