Webhooks are available on Pro, Business, and Enterprise plans. Upgrade your plan to unlock this feature.
Overview
Webhooks allow you to receive real-time HTTP notifications when important events occur in AgentWarden. Instead of polling for changes, AgentWarden will send a POST request to your specified URL whenever an event happens.Available Events
AgentWarden supports the following webhook events:| Event | Description |
|---|---|
log.blocked | Triggered when an action is blocked by permissions |
log.pending_approval | Triggered when an action requires human approval |
log.failed | Triggered when an action fails during execution |
approval.approved | Triggered when a pending approval is approved |
approval.rejected | Triggered when a pending approval is rejected |
Configuration
1. Set Up Your Webhook Endpoint
Create an HTTP endpoint in your application that can receive POST requests:2. Configure Webhook in Dashboard
- Go to Settings → Webhooks in your AgentWarden dashboard
- Enter your webhook URL:
https://your-domain.com/webhook/agentwarden - Select the events you want to subscribe to
- Click Save Configuration
- Click Test Webhook to verify it’s working
3. Make Your Endpoint Public
Your webhook endpoint must be publicly accessible. Options include:- Deploy to a cloud provider (AWS, Google Cloud, Heroku, etc.)
- Use ngrok for local development:
ngrok http 5000 - Use a serverless function (AWS Lambda, Google Cloud Functions, etc.)
Webhook Payload
All webhooks follow this structure:Event Payloads
log.pending_approval
log.pending_approval
approval.approved
approval.approved
approval.rejected
approval.rejected
Best Practices
1. Respond Quickly
Your webhook endpoint should respond with a200 OK status within 5 seconds. Process time-consuming tasks asynchronously:
2. Handle Retries
AgentWarden will retry failed webhook deliveries up to 3 times with exponential backoff. Make your endpoint idempotent:3. Validate Webhook Source
Verify requests are actually from AgentWarden by checking theUser-Agent header:
4. Log Webhook Events
Keep a log of webhook events for debugging:Troubleshooting
Webhook Not Receiving Events
- Check URL accessibility: Ensure your endpoint is publicly accessible
- Verify event subscription: Confirm you’ve subscribed to the event in Settings
- Check endpoint logs: Look for incoming requests and errors
- Test the webhook: Use the “Test Webhook” button in dashboard
Webhook Timing Out
- Respond within 5 seconds
- Move long-running tasks to background workers
- Use async processing (queues, threads, etc.)
Duplicate Events
- Implement idempotency using event IDs
- Store processed event IDs in database or cache
- Return
200 OKfor duplicate events