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 types
Meter supports four webhook formats:
The webhook type is auto-detected from the URL:
You can also set it explicitly:
Webhook payload
Meter sends a POST request for both successful and failed jobs. Success payload:metadata field contains your custom JSON from webhook_metadata — it’s included in every payload so you can identify which project or environment the webhook belongs to.
See Webhook payload formats for full field documentation.
Webhook metadata
Attach custom JSON data to every webhook payload. This is useful for routing, tagging, or identifying which schedule triggered the webhook:Webhook secrets
Webhook secrets let you verify that incoming requests are from Meter, not a third party.How it works
- When you create a schedule with a
webhook_url, Meter auto-generates a secret with awhsec_prefix - Every webhook request includes the secret in the
X-Webhook-Secretheader - Your endpoint verifies the header matches your stored secret
Storing the secret
The secret is returned once when the schedule is created. Store it securely:Verifying requests
Check theX-Webhook-Secret header in your webhook handler:
- FastAPI (Python)
- Express (Node.js)
- Flask (Python)
Regenerating secrets
If a secret is compromised, regenerate it:Retry behavior
Meter automatically retries failed webhook deliveries with exponential backoff:
Retry rules:
- 2xx response: Delivery successful, no retry
- 4xx response (client error): Delivery stops immediately — no retries. Fix your endpoint and the next scheduled job will deliver normally
- 5xx response (server error): Retries with backoff
- Timeout (>30 seconds): Retries with backoff
- Connection failure: Retries with backoff
Implementation
Step 1: Create a webhook endpoint
- FastAPI (Python)
- Express (Node.js)
- Flask (Python)
Step 2: Make endpoint publicly accessible
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
Slack webhooks
Send notifications directly to Slack channels using incoming webhooks:Slack Workflow webhooks
Trigger Slack Workflow Builder automations with scrape results. Use this when you’ve built a workflow in Slack’s Workflow Builder and want Meter to trigger it.Slack Workflow webhooks do not require a webhook secret. The URL itself serves as the authentication mechanism.
Discord webhooks
Send formatted notifications to Discord channels:Discord webhooks do not require a webhook secret. Discord authenticates via the webhook URL.
Best practices
1. Respond quickly
Return200 OK within 30 seconds. Process payloads asynchronously:
2. Handle duplicates
Make processing idempotent using thejob_id:
3. Handle failures gracefully
Testing 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
Test endpoint
Use the Meter test endpoint to verify delivery: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
- Verify the schedule has a
webhook_urlset
Timeout errors
Timeout errors
Cause: Endpoint takes >30 seconds to respondSolution: Return 200 OK immediately, process asynchronously:
Duplicate webhooks
Duplicate webhooks
Cause: Retries after timeout or connection issuesSolution: Make processing idempotent using
job_id:4xx errors stopping delivery
4xx errors stopping delivery
Cause: Your endpoint returns a 4xx status codeSolution: Meter treats 4xx as a permanent failure and does not retry. Check your endpoint for:
- Invalid webhook secret (401)
- Incorrect URL path (404)
- Request validation errors (422)
Next steps
- Try Pull-Based Monitoring as an alternative
- See RAG Integration for vector database updates
- Check Schedule API Reference for webhook configuration
- See Webhook payload formats for full field documentation