Services
Webhooks
Webhooks automate reactions to supported account events.
#Overview
Webhooks automate reactions to supported account events.
#Receive events safely
A webhook associates an HTTPS URL with events available in the form or API. Store any secret returned at creation on the receiver and never log it.
The receiver should respond quickly, process idempotently, and queue heavy work. Validate the signature mechanism actually provided before trusting a payload; if none is available, use a secret URL and additional network controls.
#Put a receiver into production
Create a dedicated HTTPS endpoint.
Register the webhook and store its secret once.
Validate the event and reject invalid payloads.
Deduplicate, acknowledge quickly, and monitor failures.
#Permissions by role
| Action | owner | admin | member | viewer |
|---|---|---|---|---|
| List destinations and events | Read | Read | Read | Read |
| Create a destination and its secret | Allowed | Allowed | No | No |
| Delete a destination | Allowed | Allowed | No | No |
#Customer REST operations
Base URL:
https://api.cdn.pizzaDownload OpenAPI 3.1Webhooks 3
GET
/api/webhooks#List webhooks
Example
curl --request GET \
--url 'https://api.cdn.pizza/api/webhooks' \
--header 'Accept: application/json' \
--header 'Authorization: Bearer YOUR_API_TOKEN'
POST
/api/webhooks#Create a webhook
Request fields
| Field | Type | Required | Description |
|---|---|---|---|
url | string | yes | Public HTTP(S) receiver URL; HTTPS is recommended.format: uri · length: 0…500 |
events | array<string> | yes | Subscribed events.items: file.uploaded | file.deleted | domain.created | zone.created | zone.updated | zone.deleted | cache.purged | node.online | node.offline | node.deployed | billing.updated | invoice.paid | mail.accepted | mail.rejected | mail.deferred |
secret | string | no | Customer-selected signing secret.length: 0…255 |
Example
curl --request POST \
--url 'https://api.cdn.pizza/api/webhooks' \
--header 'Accept: application/json' \
--header 'Authorization: Bearer YOUR_API_TOKEN' \
--header 'Content-Type: application/json' \
--data '{"url":"https://hooks.example.com/cdn-pizza","events":["file.uploaded","file.deleted"]}'
DELETE
/api/webhooks/{id}#Delete a webhook
Request fields
| Field | Type | Required | Description |
|---|---|---|---|
id | integer | yes | Webhook identifier. |
Example
curl --request DELETE \
--url 'https://api.cdn.pizza/api/webhooks/WEBHOOK_ID' \
--header 'Accept: application/json' \
--header 'Authorization: Bearer YOUR_API_TOKEN'