Skip to main content

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

  1. Go to your workspace settings
  2. Navigate to the Webhooks section
  3. Click “Create Webhook”
  4. Enter your webhook URL
  5. Select the events you want to subscribe to
  6. (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 successfully
  • action_log.failed: Triggered when an action log fails

Document Events

  • document.received: Triggered when a document is received
  • document.extracted: Triggered when document extraction completes
See the Webhook Events API Reference for detailed payload structures.

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 OK status 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

Use Cases

CRM Integration

Sync lead data and activity to your CRM system:
// Example webhook handler
app.post('/webhook/omniai', (req, res) => {
  const { event, actionLog } = req.body;
  
  if (event === 'action_log.completed') {
    // Sync to CRM
    syncToCRM(actionLog);
  }
  
  res.status(200).send('OK');
});

Custom Notifications

Send custom notifications when specific events occur:
app.post('/webhook/omniai', (req, res) => {
  const { event, document } = req.body;
  
  if (event === 'document.received') {
    // Send notification
    sendSlackNotification(`New document received: ${document.filename}`);
  }
  
  res.status(200).send('OK');
});