Getting Started
To start using webhooks, you’ll need to:- Set up an endpoint - Create a URL that can receive POST requests
- Configure the webhook - Add your endpoint in the Consumer App Portal
- Verify signatures - Implement signature verification for security
- Handle events - Process the incoming webhook data
Adding Endpoints
Animus uses Svix for processing webhook events. You will be given a portal link by the Animus team where you can use this portal to set up webhook endpoints and subscribe to events. In order to start listening to messages, you will need to configure your endpoints. To add an endpoint, select the “Endpoints” tab from the left sidebar. From there you can add a new endpoint and set the events you want to be notified about. If you don’t specify any event types, by default, your endpoint will receive all events, regardless of type. You can also edit any existing endpoints. You’ll be able to view and inspect webhooks sent to your Svix Play URL, making it effortless to get started.
Events
The following is a list of events you can subscribe to.
Available Event Types
media.completed
- A video processing job has finished successfully or with a failure.
Event Payload Structure
When a webhook event is triggered, you’ll receive a POST request to your configured endpoint with a JSON payload containing:Verifying Webhook Signatures
Webhook signatures let you verify that webhook messages are actually sent by us and not a malicious actor. For a more detailed explanation, check out this article on why you should verify webhooks. Our webhook partner Svix offers a set of useful libraries that make verifying webhooks very simple:For detailed information on how to use the Svix portal to manage your webhooks, refer to the Svix documentation.
Complete Webhook Handler Examples
Here are complete examples of webhook handlers in different frameworks:Advanced Webhook Handling
Retry Logic and Idempotency
Implement proper retry handling and idempotency:Webhook Queue Processing
For high-volume applications, consider using a queue:Best Practices
- Always verify signatures - This ensures the webhook is actually from Animus and not a malicious actor
- Respond quickly - Return a 200 status code as soon as possible. Do heavy processing asynchronously
- Handle retries - If your endpoint is down, we’ll retry the webhook. Make sure your handler is idempotent
- Log events - Keep logs of received webhooks for debugging and monitoring
- Use HTTPS - Always use HTTPS endpoints for security
- Handle failures gracefully - Your webhook handler should be robust and handle unexpected data
- Implement rate limiting - Protect your endpoint from potential abuse
- Monitor webhook health - Set up alerts for failed webhook deliveries
Testing Webhooks
You can test your webhook integration by sending sample webhook events to your endpoints. This allows you to verify that your application correctly processes the webhook events before deploying to production.
- ngrok - To expose your local development server to the internet
- Svix Play - A webhook testing tool that provides a temporary URL for testing
- Webhook.site - Another testing service for inspecting webhook payloads
Local Development Setup
Troubleshooting
Common issues and solutions:- Webhook not received: Check that your endpoint is publicly accessible and returns a 200 status code
- Signature verification fails: Ensure you’re using the correct webhook secret and the raw request body
- Timeouts: Make sure your webhook handler responds within 30 seconds
- Duplicate events: Implement idempotency checks using the event ID or timestamp
- Missing events: Check your webhook endpoint configuration and ensure it’s subscribed to the correct event types