Webhooks
Receive real-time notifications when events occur.
Available Events
| Event | Trigger |
|---|---|
content.created | New content created |
content.updated | Content updated |
content.published | Content published |
content.deleted | Content deleted |
media.uploaded | File uploaded |
media.deleted | File deleted |
user.registered | New user registered |
order.created | New order (e-commerce) |
order.updated | Order status changed |
Creating Webhooks
Via GraphQL
mutation CreateWebhook {
createWebhook(input: {
url: "https://your-server.com/webhook"
events: ["content.published", "media.uploaded"]
secret: "your-secret-key"
}) {
id
url
events
active
}
}
Via Admin UI
- Go to Settings → Webhooks
- Click Add Webhook
- Enter URL and select events
- Save
Payload Format
{
"event": "content.published",
"timestamp": "2025-01-01T12:00:00Z",
"webhook_id": "webhook-uuid",
"data": {
"entry_id": "entry-uuid",
"content_type": "page",
"title": "New Page",
"slug": "new-page"
}
}
Signature Verification
Verify webhook authenticity:
import hmac
import hashlib
def verify_signature(payload: bytes, signature: str, secret: str) -> bool:
expected = hmac.new(
secret.encode(),
payload,
hashlib.sha256
).hexdigest()
return hmac.compare_digest(f"sha256={expected}", signature)
Best Practices
- Verify signatures — Always validate authenticity
- Respond quickly — Return 200 within 5 seconds
- Handle retries — Implement idempotency
- Log events — Keep records for debugging