Webhook
Use Webhooks to get notified when events happen.
note
The webhook integration is not enabled by default.
For more details on how to enable it, refer to our Configuration Section.
The outbound webhook integration enables you to programmatically participate in conversations by sending messages or reacting to them. Here's a common integration pattern:
- Call the
subscribe
endpoint - Consume on your URL of choice events
- React to those events by calling the
send message
endpoint
You must de-duplicate messages on arrival as the webhook does not guarantee
events uniqueness. Your webhook also has to respond to every message with a status code of 200
.
#
SubscribingPOST /webhooks.subscribe
Subscribes the webhook for the first time or update its parameters.
Sample request
url
Endpoint to be called when sending events.id
(optional) provide for updates.name
(optional) name to identify the webhook.headers
(optional) HTTP headers to set on each request (useful for authentication).signature_key
(optional) when set, the webhook will also send a headerX-Airy-Content-Signature
that contains the SHA256 HMAC of the specified key and the content.events
(optional) List of event types to receive. See below for a detailed list. Omit to receive all event types.
Sample response
#
UnsubscribingPOST /webhooks.unsubscribe
Sample response
#
UpdatePOST /webhooks.update
Update the webhook parameters.
Sample request
id
(required) provide for updatesurl
(optional) Endpoint to be called when sending events.headers
(optional) HTTP headers to set on each request (useful for authentication)signature_key
(optional) when set, the webhook will also send a headerX-Airy-Content-Signature
that contains the SHA256 HMAC of the specified key and the content.events
(optional) List of event types to receive. See below for a detailed list. Omit to receive all event types.
Sample response
#
ListPOST /webhooks.list
List of subscribed webhooks.
#
InfoPOST /webhooks.info
Sample request
Sample response
#
EventsAfter subscribing to an Airy webhook, you will start receiving events on your URL of choice. The event will always be a POST request with one the following payloads:
message.created
#
message.updated
#
Sent whenever a message is updated (e.g. delivery state) or its metadata changed.
conversation.updated
#
Sample payload
channel.updated
#
Sent whenever a channel is (un-) subscribed or its metadata changes.