Webhooks Guide
Set up webhook endpoints to receive immediate notifications when Meter detects content changes.Overview
Webhooks allow Meter to push change notifications to your application in real-time, eliminating the need for polling. Use webhooks when:- Changes need immediate action
- Building event-driven systems
- Triggering downstream workflows
- Batch processing changes
- Webhooks aren’t feasible (firewall, no public endpoint)
- Prefer manual control over timing
How it works
Webhook payload
Meter sends a POST request with this payload:Implementation
Step 1: Create a webhook endpoint
TODO: Implement for your framework- FastAPI (Python)
- Express (Node.js)
- Flask (Python)
Step 2: Make endpoint publicly accessible
TODO: Deploy your webhook endpoint Options:- Deploy to cloud (AWS Lambda, Google Cloud Functions, etc.)
- Use ngrok for local development:
ngrok http 3000 - Use a VPS with public IP
Step 3: Create schedule with webhook URL
Best practices
1. Respond quickly
Respond with 200 OK within 30 seconds:2. Validate requests (optional security)
TODO: Implement signature verification3. Handle failures gracefully
TODO: Add retry logic4. Monitor webhook health
TODO: Add monitoringTesting webhooks
Local testing with ngrok
Testing with webhook.site
- Go to https://webhook.site
- Copy the unique URL
- Use it in your Meter schedule
- Trigger a job and view the payload on webhook.site
Manual testing
Troubleshooting
Not receiving webhooks
Not receiving webhooks
Solutions:
- Verify URL is publicly accessible
- Check endpoint returns 200 OK
- Test with webhook.site
- Check server logs for errors
Timeout errors
Timeout errors
Cause: Endpoint takes >30 seconds to respondSolution: Return 200 OK immediately, process asynchronously:
Duplicate webhooks
Duplicate webhooks
Cause: Network issues may cause retriesSolution: Make processing idempotent:
Complete example
TODO: Add complete working example See Example: E-commerce Monitoring for a full implementation with webhooks.Next steps
- Try Pull-Based Monitoring as an alternative
- See RAG Integration for vector database updates
- Check Schedule API Reference for webhook configuration