Webhooks
Webhooks allow you to receive real-time notifications about events in your AI Lending workspace. This enables you to integrate OmniAI with your existing systems, CRMs, or custom applications.Overview
Webhooks are HTTP callbacks that send event data to a URL you specify whenever certain events occur in your workspace. This allows you to:- Sync data with your CRM or other systems
- Trigger workflows in external applications
- Monitor activity in real-time
- Create custom integrations with your existing tools
Setting Up Webhooks
1. Create a Webhook Endpoint
First, set up an endpoint in your application that can receive HTTP POST requests. This endpoint should:- Accept POST requests
- Return a 200 status code on success
- Handle webhook payloads securely
2. Configure Webhook in OmniAI
- Go to your workspace settings
- Navigate to the Webhooks section
- Click “Create Webhook”
- Enter your webhook URL
- Select the events you want to subscribe to
- (Optional) Add a webhook secret for security
3. Test Your Webhook
Use the test functionality to verify your webhook is receiving events correctly.Webhook Events
OmniAI supports the following webhook events:Action Log Events
action_log.completed: Triggered when an action log completes successfullyaction_log.failed: Triggered when an action log fails
Document Events
document.received: Triggered when a document is receiveddocument.extracted: Triggered when document extraction completes
Webhook Security
Using Webhook Secrets
For enhanced security, you can configure a webhook secret. OmniAI will include this secret in the webhook request headers, allowing you to verify the request authenticity.Best Practices
- Use HTTPS endpoints only
- Verify webhook signatures when possible
- Implement idempotency to handle duplicate events
- Set up retry logic for failed webhook deliveries
- Monitor webhook delivery status
Webhook Payloads
Each webhook event includes:- Event type: The type of event that occurred
- Event data: The relevant data for the event
- Timestamp: When the event occurred
- Workspace ID: The workspace where the event occurred
Handling Webhooks
Response Requirements
Your webhook endpoint should:- Return a
200 OKstatus code within 5 seconds - Handle the request asynchronously if processing takes longer
- Return appropriate error codes if the request is invalid
Retry Logic
If your endpoint doesn’t respond with a 200 status code, OmniAI will retry the webhook delivery:- Initial retry: After 1 minute
- Subsequent retries: Exponential backoff
- Maximum retries: 3 attempts