SmileCloudDocs

Webhooks API

These endpoints manage webhook subscriptions - the URLs the API delivers events to. For the delivery model, signature verification, and event payloads, see the Webhooks guide. All endpoints require the webhooks:manage scope.

#The subscription object

FieldTypeDescription
idstringSubscription id.
urlstringHTTPS endpoint events are delivered to.
event_typesstring[]Event types this subscription receives. Empty means every type.
activebooleanWhether delivery is active. Turns false when the subscription is auto-disabled.
disabled_reasonstring | nullWhy delivery was disabled, when it was.
secretstringSigning secret - returned only once, at creation.
created_atstringISO 8601 timestamp.

#Create a subscription

POST /v1/webhooks

Body fieldTypeDescription
urlstringHTTPS endpoint to receive events.
event_typesstring[]Event types to subscribe to. Omit or leave empty for every type your key's scopes allow.

Any whatsapp.* event needs whatsapp:read on the key as well as webhooks:manage, because the payload carries the message body. Asking for one without it returns 403; omitting event_types on a key that lacks it stores the catalogue minus the WhatsApp family rather than silently including it.

Returns 201 with the subscription, unwrapped, including the one-time secret.

bash
curl -X POST https://api.smile-app.co.il/v1/webhooks \
  -H "Authorization: Bearer sk_live_..." \
  -H "Content-Type: application/json" \
  -d '{
    "url": "https://example.com/hooks/smile",
    "event_types": ["appointment.created", "appointment.updated"]
  }'
json
{
  "id": "wh_2a9f",
  "url": "https://example.com/hooks/smile",
  "event_types": ["appointment.created", "appointment.updated"],
  "active": true,
  "disabled_reason": null,
  "secret": "whsec_8f2c...",
  "created_at": "2026-06-27T12:00:00+03:00"
}

Save the secret now

secret (the whsec_... signing key) is shown once. Store it securely - you'll need it to verify delivery signatures, and it can't be retrieved later. If lost, delete the subscription and create a new one.

#List subscriptions

GET /v1/webhooks

Returns the clinic's subscriptions with the secret masked.

bash
curl https://api.smile-app.co.il/v1/webhooks \
  -H "Authorization: Bearer sk_live_..."

#Retrieve a subscription

GET /v1/webhooks/{id}

bash
curl https://api.smile-app.co.il/v1/webhooks/wh_2a9f \
  -H "Authorization: Bearer sk_live_..."

#Delete a subscription

DELETE /v1/webhooks/{id}

Stops all future deliveries to the subscription.

bash
curl -X DELETE https://api.smile-app.co.il/v1/webhooks/wh_2a9f \
  -H "Authorization: Bearer sk_live_..."

#Re-enable a subscription

POST /v1/webhooks/{id}/enable

A subscription whose endpoint keeps failing (20 consecutive failures sustained for three days) is automatically disabled: active becomes false and disabled_reason says why. Once your endpoint is healthy, turn it back on. Events that fired while it was disabled are not replayed.

bash
curl -X POST https://api.smile-app.co.il/v1/webhooks/wh_2a9f/enable \
  -H "Authorization: Bearer sk_live_..."

#List deliveries

GET /v1/webhooks/{id}/deliveries

A paginated log of delivery attempts for a subscription - useful for debugging failures.

bash
curl https://api.smile-app.co.il/v1/webhooks/wh_2a9f/deliveries \
  -H "Authorization: Bearer sk_live_..."

#Retry a delivery

POST /v1/webhooks/{id}/deliveries/{deliveryId}/retry

Manually re-attempts a failed delivery.

bash
curl -X POST \
  https://api.smile-app.co.il/v1/webhooks/wh_2a9f/deliveries/dl_771/retry \
  -H "Authorization: Bearer sk_live_..."