Webhooks let you receive real-time notifications when events occur in Cula, such as when
a new sink is verified. The implementation follows the
Standard Webhooks specification, using signatures
for secure verification.
Setting Up Your Endpoint
Before creating a webhook, prepare an HTTPS endpoint on your server that can:
- Accept POST requests with a JSON payload.
- Verify the signature using your webhook secret.
- Respond with a 2xx status code within 10 seconds to acknowledge receipt.
Example endpoint structure:
Creating a Webhook
Create a webhook by specifying your endpoint URL and the events you want to listen for:
Response:
Save the secret (prefixed with whsec_) — you need it to verify webhook
signatures. It is only returned when the webhook is created.
Available Events
sink.verified — triggered when a sink is verified.
Every webhook request includes three standard headers:
Event Payload
When an event occurs, Cula sends a POST request to your endpoint:
Verifying Signatures
Webhook signatures must be verified to ensure authenticity. The verification process
follows the Standard Webhooks specification.
Security considerations:
- Verify the
webhook-timestamp is within an acceptable tolerance (for example, 5
minutes) to prevent replay attacks.
- Use the
webhook-id as an idempotency key to prevent processing the same event
multiple times.
- Store processed webhook IDs temporarily (for example, in Redis for 24 hours) to
detect duplicates.
For implementation, use the official
Standard Webhooks libraries,
available for multiple languages, which handle signature verification automatically.