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
- Go to Slack API: Incoming Webhooks
- Click Create New App (or select an existing app you own)
- Under Features, select Incoming Webhooks and toggle it On
- Click Add New Webhook to Workspace
- Select the channel where notifications should appear (e.g.,
#document-notifications) - Click Allow — Slack generates a webhook URL in the format:
https://hooks.slack.com/services/T.../B.../...- 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
- Navigate to the Integrations page in the Ocriva dashboard
- Find the Slack template card and click it
- Paste your Slack webhook URL into the URL field
- Select the events you want to receive (defaults:
document.processed,document.failed,batch.completed) - Review the pre-filled payload template — you can leave it as-is or customize it (see Customizing the Payload)
- 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
| Variable | Description | Example |
|---|---|---|
{{eventType}} | The event that fired | document.processed |
{{payload.fileName}} | Name of the uploaded file | invoice-2026-03.pdf |
{{payload.status}} | Processing result | completed or failed |
{{timestamp}} | ISO 8601 timestamp of the event | 2026-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
- Open the endpoint you just created and click the Test button
- Ocriva sends a sample
document.processedpayload to your Slack webhook URL - Verify the message appears in the Slack channel you selected
- Open the Logs tab on the endpoint to confirm delivery status is
successand the HTTP response code is200
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
| Symptom | Likely Cause | Fix |
|---|---|---|
| Message not appearing in channel | Wrong webhook URL or channel was deleted | Verify the URL copied from Slack API matches exactly; recreate the webhook if the channel no longer exists |
invalid_payload error in logs | Malformed JSON in the payload template | Check the template for unescaped quotes or trailing commas; use a JSON validator |
Delivery failed with HTTP 403 | The Slack webhook has been deactivated or revoked | Go to your Slack app settings, regenerate the Incoming Webhook, and update the URL in Ocriva |
Delivery failed with HTTP 404 | Slack app was deleted | Create a new Slack app, enable Incoming Webhooks, and generate a new URL |
| Variable shows as literal text | Typo in the variable name | Variable names are case-sensitive — use {{payload.fileName}} not {{payload.filename}} |
