What are Webhooks?
Webhooks allow your application to receive real-time notifications when events occur in the Bluma platform, eliminating the need to poll for status updates.How Webhooks Work
1
Register Endpoint
Configure a URL where Bluma should send event notifications
2
Event Occurs
An event happens (e.g., video completes generation)
3
Webhook Fired
Bluma sends an HTTP POST request to your endpoint
4
Process Event
Your server receives and processes the webhook payload
Supported Events
Video Events
Credit Events
Webhook Payload
All webhooks include a consistent structure:Example: Video Completed
Example: Video Failed
Registering Webhooks
Create a Webhook
View Response
View Response
List Your Webhooks
Delete a Webhook
Security
Verifying Signatures
All webhooks include anX-Bluma-Signature header with an HMAC-SHA256 signature. Always verify this signature to ensure the webhook is genuine.
Node.js Example
Python Example
Webhook Headers
Each webhook request includes:Delivery & Retries
Retry Schedule
If your endpoint fails to respond with a 2xx status code:- First retry: 3 seconds
- Second retry: 30 seconds
- Third retry: 5 minutes
- Fourth retry: 1 hour
Automatic Disabling
Webhooks are automatically disabled after 10 consecutive failures to prevent unnecessary load. Re-enable them once your endpoint is fixed.Monitoring Deliveries
Check webhook delivery logs:View Response
View Response
Best Practices
Respond Quickly
Return a 200 status immediately, then process the event asynchronously
Handle Duplicates
Use the
event_id to deduplicate events (store processed IDs)Verify Signatures
Always validate the HMAC signature before processing
Monitor Failures
Track delivery failures and fix issues promptly to avoid auto-disable
Idempotency Example
Testing Webhooks
Using webhook.site
- Create a temporary endpoint at webhook.site
- Register the URL as your webhook endpoint
- Trigger an event (generate a test video)
- View the webhook payload in real-time
Local Testing with ngrok
Troubleshooting
Webhooks not being delivered
Webhooks not being delivered
Possible causes:
- Your endpoint is returning non-2xx status codes
- Firewall blocking Bluma’s servers
- SSL certificate issues
- Check delivery logs for error messages
- Verify your endpoint returns 200 OK
- Ensure HTTPS is properly configured
Receiving duplicate events
Receiving duplicate events
This is normal behavior. Implement idempotency using the
event_id to safely handle duplicates.Signature verification failing
Signature verification failing
Check that:
- You’re using the correct webhook secret
- You’re computing the HMAC on the raw request body (not parsed JSON)
- The secret hasn’t been regenerated or changed
Webhook was auto-disabled
Webhook was auto-disabled
Fix the issues causing failures, then re-enable by creating a new webhook subscription. Review delivery logs to identify root cause.
Next Steps
Webhook Setup Guide
Complete step-by-step integration guide
API Reference
View webhooks API documentation
Error Handling
Handle webhook delivery failures
Best Practices
Build reliable webhook integrations