Webhook Task Retrieval
Instead of repeatedly polling the API for results, you can set up webhooks to automatically receive document data whenever processing is complete.
Overview
Webhooks allow Koncile to push extracted document data to your server as soon as processing finishes. This is more efficient than polling and enables real-time integrations.
Key features:
Create multiple webhooks with different configurations
Filter webhooks by folders and/or document templates
Secure requests with signing secrets
Choose between JSON and CSV output formats
Test your endpoint before going live
Setting Up Webhooks
Accessing Webhook Configuration
Navigate to Settings > API in your Koncile dashboard
Only company administrators can create and manage webhooks


Creating a Webhook
Click the Add Webhook button to open the configuration dialog.

Configuration options:
Name
A descriptive name for your webhook (e.g., "staging", "production")
Select folders
Optional. Limit this webhook to documents from specific folders
Select document templates
Optional. Limit this webhook to documents matching specific templates
Your webhook URL
The endpoint URL where Koncile will send POST requests
Output format
Choose between JSON or CSV format
Signing secret
Optional. A secret key used to verify requests came from Koncile
Webhook Filtering
You can control which documents trigger a webhook by linking it to specific folders and/or document templates:
No filters: Webhook receives all processed documents
Folders only: Webhook receives documents from selected folders (regardless of template)
Templates only: Webhook receives documents matching selected templates (regardless of folder)
Both filters: Webhook receives documents that match either the selected folders OR the selected templates
Testing Your Webhook
Before saving, use the Test URL button to verify your endpoint is working correctly:
Enter your webhook URL
Click Test URL
Koncile will send a sample payload to your endpoint
The response will be displayed in the Response section
If successful, click Validate to save the webhook
Webhook Payload
JSON Format
When a document finishes processing, Koncile sends a POST request with the following JSON structure:
Payload fields:
status
Processing status: DONE, DUPLICATE, IN_PROGRESS, or FAILED
status_message
Human-readable status description
task_id
Unique identifier for the processing task
document_id
Unique identifier for the processed document
template_id
ID of the document template used for extraction
document_name
Original filename of the uploaded document
General_fields
Object containing extracted single-value fields with confidence scores
Line_fields
Object containing extracted multi-value/line item fields
CSV Format
When CSV format is selected, Koncile sends a multipart/form-data POST request with a CSV file attachment containing the extracted data.
Securing Webhooks with Signing Secrets
Signing secrets allow you to verify that webhook requests genuinely come from Koncile.
Generating a Signing Secret
In the webhook configuration dialog, the signing secret section shows your current secret (if any)
Click the create button to generate a new secret
The secret follows the format:
whsec_xxxxxxxxxxxxxxxxImportant: Copy and store your secret securely - you'll need it to verify requests
How Signature Verification Works
When a signing secret is configured, Koncile includes two additional headers with each request:
X-Koncile-Signature
HMAC-SHA256 signature of the payload
X-Koncile-Timestamp
Unix timestamp when the request was signed
The signature is computed as:
Where {payload} is the raw JSON body (with minimal whitespace).
Verifying Signatures
To verify a webhook request:
Extract the
X-Koncile-SignatureandX-Koncile-TimestampheadersCheck that the timestamp is recent (within 5 minutes) to prevent replay attacks
Compute the expected signature using your secret
Compare the computed signature with the received signature
Implementation Examples
Run with:
Run with:
Managing Multiple Webhooks
You can create multiple webhooks to handle different scenarios:
Development vs Production: Create separate webhooks for staging and production environments
Department-specific: Route invoices to your accounting system and contracts to your legal system
Backup endpoints: Configure multiple webhooks as redundancy
Each webhook operates independently - a document can trigger multiple webhooks if it matches their filter criteria.
Troubleshooting
Webhook not triggering
Verify the webhook is activated (toggle should be enabled)
Check that your filters match the documents you're processing
Ensure your endpoint returns a 2xx status code
Invalid signature errors
Confirm you're using the correct signing secret
Check that the timestamp hasn't expired (requests older than 5 minutes are rejected)
Ensure you're computing the signature with the raw JSON body (minimal whitespace)
Missing data in payload
Verify the document finished processing successfully (status should be
DONE)Check that your document template has the expected fields configured
Last updated
Was this helpful?

