Overview
Webhooks deliver real-time notifications about agent lifecycle events to your HTTP endpoints. AgentDoor supports:- Event filtering by type
- HMAC-SHA256 signature verification
- Automatic retries with exponential backoff
- Custom headers
- Multiple endpoints
Configuration
Endpoint Configuration
Event Types
AgentDoor emits the following webhook events:Event Payload
All webhook events follow this structure:Event Data Schemas
agent.registered
agent.authenticated
agent.payment_failed
agent.rate_limited
agent.flagged
agent.spending_cap_warning
Webhook Headers
AgentDoor sends the following headers with each webhook request:Signature Verification (HMAC-SHA256)
If asecret is configured, AgentDoor signs the webhook payload:
Retry Logic
Webhooks are retried automatically on failure:- Retry on: Network errors, timeouts, HTTP 5xx, HTTP 429
- No retry on: HTTP 4xx (except 429)
- Backoff: Exponential with jitter (1s, 2s, 4s, 8s, max 10s)
- Max retries: Configurable per endpoint (default: 3)
Delivery Result
In-Process Listeners
Listen to events in your application without HTTP:Example Handlers
Next.js Route Handler
Express.js Handler
Testing Webhooks
Local Testing with ngrok
Mock Webhook Server
Best Practices
- Verify signatures: Always verify HMAC signatures in production
- Idempotency: Handle duplicate events (same
id) gracefully - Respond quickly: Return 200 within 10 seconds to avoid retries
- Process async: Queue events for background processing
- Monitor failures: Track failed deliveries and alert on patterns
- Filter events: Only subscribe to events you need
- Log everything: Keep audit logs of all webhook deliveries
- Rotate secrets: Periodically rotate webhook secrets
Monitoring
Troubleshooting
Webhook not received
- Check endpoint URL is publicly accessible
- Verify firewall/security group allows incoming requests
- Check webhook endpoint returns 200 status
- Review event type filter in configuration
Signature verification fails
- Verify secret matches on both sides
- Use raw request body for verification (not parsed JSON)
- Check encoding (UTF-8)
- Ensure timestamp header is recent (prevent replay attacks)
Too many retries
- Fix endpoint to return 200 faster
- Move processing to background queue
- Check for timeout issues
- Increase
timeoutMsif needed