Ocriva Logo

Documents

Slack Integration

Send document processing notifications to Slack channels.

integrationsslackmessagingnotifications

Published: 4/5/2026

Slack Integration

Get instant Slack notifications when documents are processed, fail, or batches complete. Ocriva's Slack integration uses Slack's native Incoming Webhooks feature — no third-party middleware required.


Prerequisites

  • A Slack workspace where you have permission to install apps (admin or app-installation permission)
  • An Ocriva organization with available webhook quota

Step 1: Create a Slack Incoming Webhook

  1. Go to Slack API: Incoming Webhooks
  2. Click Create New App (or select an existing app you own)
  3. Under Features, select Incoming Webhooks and toggle it On
  4. Click Add New Webhook to Workspace
  5. Select the channel where notifications should appear (e.g., #document-notifications)
  6. Click Allow — Slack generates a webhook URL in the format:
https://hooks.slack.com/services/T.../B.../...
  1. Copy the full webhook URL — you will need it in the next step

TIP

Create a dedicated channel such as #ocriva-notifications to keep document events separate from team conversations. You can always route different event types to different channels by creating multiple webhooks.


Step 2: Configure in Ocriva

  1. Navigate to the Integrations page in the Ocriva dashboard
  2. Find the Slack template card and click it
  3. Paste your Slack webhook URL into the URL field
  4. Select the events you want to receive (defaults: document.processed, document.failed, batch.completed)
  5. Review the pre-filled payload template — you can leave it as-is or customize it (see Customizing the Payload)
  6. Click Create Endpoint

The endpoint status will be active immediately and Ocriva will begin delivering events to your Slack channel.


Payload Template

The default Slack payload uses Block Kit formatting to produce a structured, readable message:

{
  "text": "{{eventType}} - {{payload.fileName}}",
  "blocks": [
    {
      "type": "section",
      "text": {
        "type": "mrkdwn",
        "text": "*{{eventType}}*\n>File: {{payload.fileName}}\n>Status: {{payload.status}}\n>Time: {{timestamp}}"
      }
    }
  ]
}

Variable Reference

VariableDescriptionExample
{{eventType}}The event that fireddocument.processed
{{payload.fileName}}Name of the uploaded fileinvoice-2026-03.pdf
{{payload.status}}Processing resultcompleted or failed
{{timestamp}}ISO 8601 timestamp of the event2026-04-05T09:30:00Z

Rendered Slack Message

The template produces a two-part message: a plain-text fallback line (used in notifications and search) and a Block Kit section rendered in the Slack client. The section appears as a quoted block with bold event type, file name, status, and timestamp on separate lines.


Customizing the Payload

You can edit the payload template directly in the endpoint settings to include additional data fields.

Adding Extracted Data

To include AI-extracted content — for example, a total amount from an invoice — add {{payload.extractedData}} to the block:

{
  "text": "{{eventType}} - {{payload.fileName}}",
  "blocks": [
    {
      "type": "section",
      "text": {
        "type": "mrkdwn",
        "text": "*{{eventType}}*\n>File: {{payload.fileName}}\n>Status: {{payload.status}}\n>Extracted: {{payload.extractedData}}\n>Time: {{timestamp}}"
      }
    }
  ]
}

Adding a Confidence Score

"text": "*{{eventType}}*\n>File: {{payload.fileName}}\n>Status: {{payload.status}}\n>Confidence: {{payload.confidence}}\n>Time: {{timestamp}}"

For the full list of available template variables, see the Webhook Events reference.

WARNING

The payload must be valid JSON after variable substitution. If {{payload.extractedData}} contains special characters (quotes, newlines), they may break the JSON structure. Consider using only scalar fields like payload.fileName, payload.status, and payload.confidence inside JSON string values.


Example: Invoice Processing Notification

Scenario: A user uploads invoice-2026-03.pdf. Ocriva's AI extracts the data and fires a document.processed event.

What Ocriva sends to Slack:

{
  "text": "document.processed - invoice-2026-03.pdf",
  "blocks": [
    {
      "type": "section",
      "text": {
        "type": "mrkdwn",
        "text": "*document.processed*\n>File: invoice-2026-03.pdf\n>Status: completed\n>Time: 2026-04-05T09:30:00Z"
      }
    }
  ]
}

How it appears in Slack: A message with a bold document.processed header followed by three quoted lines showing the file name, status, and timestamp. The plain-text fallback also appears in desktop and mobile push notifications.


Testing the Integration

  1. Open the endpoint you just created and click the Test button
  2. Ocriva sends a sample document.processed payload to your Slack webhook URL
  3. Verify the message appears in the Slack channel you selected
  4. Open the Logs tab on the endpoint to confirm delivery status is success and the HTTP response code is 200

TIP

Run a test immediately after creating the endpoint, before uploading any real documents. This confirms your webhook URL is correct and the channel has the expected permissions.


Troubleshooting

SymptomLikely CauseFix
Message not appearing in channelWrong webhook URL or channel was deletedVerify the URL copied from Slack API matches exactly; recreate the webhook if the channel no longer exists
invalid_payload error in logsMalformed JSON in the payload templateCheck the template for unescaped quotes or trailing commas; use a JSON validator
Delivery failed with HTTP 403The Slack webhook has been deactivated or revokedGo to your Slack app settings, regenerate the Incoming Webhook, and update the URL in Ocriva
Delivery failed with HTTP 404Slack app was deletedCreate a new Slack app, enable Incoming Webhooks, and generate a new URL
Variable shows as literal textTypo in the variable nameVariable names are case-sensitive — use {{payload.fileName}} not {{payload.filename}}