What are Webhooks?
Webhooks allow you to be notified when changes are made to parts of the Mindset AI system—without needing to repeatedly check by calling an API. You can use webhooks to:- Be notified of changes made by users to agent configuration
- Monitor processing status of files you send to the ContextFiles API for ingestion
- Track when contexts are created, updated, or deleted
- Receive notifications when agents are modified
Real-World Example
When a tenant admin creates a new AI agent, you receive a notification allowing you to:Update Database
Update your database automatically
Send Notifications
Send notifications to other administrators
Trigger Workflows
Trigger custom workflows
Update Analytics
Update analytics dashboards and log audit trails
Why Use Webhooks?
- With Webhooks
- Without Webhooks
Automatic notifications → Minimal load, immediate response
Notified within 5 seconds of changes
No need to constantly poll APIs
React immediately to tenant actions
Every change recorded with timestamps
Supported Events
Webhooks fire for 3 resource types:Agents
Agents
Events:
agent.createdagent.updatedagent.deleted
Contexts
Contexts
Events:
context.createdcontext.updatedcontext.deleted
Context Files
Context Files
Events:
contextfile.createdcontextfile.updatedcontextfile.deleted
Webhooks fire for all tenants in your app. Use the
externalTenantId field in each payload to identify which tenant made the change.Quick Start Guide
Step 1: Create Your Webhook Endpoint
Create an HTTPS endpoint that accepts POST requests:Step 2: Register Your Webhook
API Endpoint:Step 3: Test Your Integration
1
Make a Change
Make a change in the AMS SDK (create an agent, upload a file, etc.)
2
Verify Receipt
Verify your endpoint receives the webhook
3
Check Logs
Check the browser console or server logs
Webhook Payload Structure
HTTP Headers
Payload Example
Key Fields
Security: Verify Signatures
- Node.js Implementation
- Python Implementation
Handle Webhook Events
Basic Event Handling
Prevent Duplicate Processing (Idempotency)
Webhooks may be delivered multiple times. UseeventId to process each event only once:
Respond Quickly (Async Processing)
Respond within 5 seconds. Move heavy work to background:Manage Webhooks
List All Webhooks
Update Webhook
Pause Webhook
Delete Webhook
Best Practices
Security ✅
Security ✅
- Always verify signatures
- Use HTTPS endpoints
- Store secrets securely
- Rotate secrets periodically
Reliability ✅
Reliability ✅
- Respond within 5 seconds
- Implement idempotency using
eventId - Handle failures gracefully
- Process heavy work asynchronously
Monitoring ✅
Monitoring ✅
- Log successful and failed deliveries
- Monitor
lastTriggeredAttimestamps - Alert on extended periods without webhooks
Troubleshooting
Webhooks Not Received
1
Check Webhook Status
Webhook is registered and
active: true2
Verify Endpoint URL
Endpoint URL is correct and accessible
3
Check Firewall
Firewall allows HTTPS traffic from Mindset servers
Signature Verification Fails
Check:Using correct secret from registration response
Using raw request body (not parsed JSON)
UTF-8 encoding is correct
Duplicate Deliveries
Solution: Implement idempotency usingeventId (see example above)