Passa al contenuto principale

POST /subscriptions

Creates a new webhook or updates an existing one.

caution

Each account can only register 1 webhook.

Required Parameters

ParameterTypeDescription
urlstringThe identifier of the contact (e.g. phone number in WhatsApp)
subscriptionsstring[]Comma separated values of the events to subscribe on this webhook (e.g message_created)

Example Request

curl -X POST "https://api.callbell.eu/v1/webhooks/subscribe" \
-H "Authorization: Bearer test_gshuPaZoeEG6ovbc8M79w0QyM" \
-H "Content-Type: application/json" \
-d '{
"url": "https://my-app.com/my-webhook-endpoint",
"subscriptions": ["message_created", "contact_created"]
}'

Response

ParameterTypeDescription
contactWebhookThe webhook which was created or updated.

Example Response

response.json
{
"webhook": {
"url": "https://my-app.com/my-webhook-endpoint",,
"subscriptions": [
"message_created"
],
"createdAt": "2022-10-18 17:01:20 +0200",
"enabled": true
}
}