Webhooks
Webhooks notify your system when something happens, so you don’t have to poll. They are included with Control and Enterprise.
Events
Section titled “Events”| Event | Sent when |
|---|---|
invoice.analysis.completed |
An invoice has a decision: API submissions, document uploads, invoices synced from a connected ERP, and re-analysis. |
invoice.analysis.failed |
Analysis of a document failed. |
scan.completed |
A historical AP audit finished. One summary event per API scan record. |
finding.created |
A new review item was raised, one event per API finding record. Not sent for historical-audit rows; scan.completed summarizes those. |
finding.reviewed |
Someone recorded a disposition on a review item. |
Create an endpoint
Section titled “Create an endpoint”In Integrations → Webhooks, enter your endpoint URL (HTTPS only) and pick the events, or use the API:
curl https://api.invogi.com/v1/webhooks \ -H "Authorization: Bearer $INVOGI_API_KEY" \ -H "Content-Type: application/json" \ -d '{"url": "https://example.com/invogi/webhooks", "events": ["invoice.analysis.completed"]}'The response includes the endpoint’s signing secret. It is shown once, so
store it straight away; you need it to verify deliveries.
Payload
Section titled “Payload”{ "id": "evt_…", "type": "invoice.analysis.completed", "data": { "invoice_id": "3f2c…", "decision": "PASS", "risk_score": 4, "export_ready": true, "canonical_export_path": "/v1/invoices/3f2c…/export?format=json" }}export_ready is true only for PASS
decisions; use canonical_export_path to fetch the invoice for your payment
system.
Every event’s fields are listed in the API reference.
finding.created
Section titled “finding.created”{ "id": "evt_…", "type": "finding.created", "data": { "finding_id": "8a1d…", "invoice_id": "3f2c…", "invoice_number": "INV-1001", "external_id": "xero:5b0e…:a1f4…", "erp": { "provider": "XERO", "connection_id": "5b0e…", "record_id": "a1f4…" }, "type": "EXACT_DUPLICATE", "severity": "CRITICAL", "summary": "Exact duplicate of invoice INV-1001 (same supplier, invoice number, currency, and amount).", "recommended_action": "Confirm this is not a resubmission of an already-paid invoice before payment.", "related_invoice_ids": ["77b0…"], "created_at": "2026-10-08T09:12:44.120Z" }}finding.reviewed
Section titled “finding.reviewed”{ "id": "evt_…", "type": "finding.reviewed", "data": { "finding_id": "8a1d…", "invoice_id": "3f2c…", "invoice_number": "INV-1001", "external_id": "xero:5b0e…:a1f4…", "erp": { "provider": "XERO", "connection_id": "5b0e…", "record_id": "a1f4…" }, "type": "EXACT_DUPLICATE", "severity": "CRITICAL", "disposition": "FALSE_POSITIVE", "previous_disposition": "OPEN", "note": "Credit note re-entry, not paid twice", "reviewed_by_user_id": "c41e…", "reviewed_at": "2026-10-08T10:03:10.512Z", "invoice_open_findings": 0 }}invoice_open_findings counts the invoice’s findings that are still open after
this review; 0 means every concern on the invoice has been reviewed.
scan.completed
Section titled “scan.completed”{ "id": "evt_…", "type": "scan.completed", "data": { "scan_id": "e2d9…", "company_id": "1c7a…", "invoices_analyzed": 4812, "rows_skipped": 12, "decision_counts": { "PASS": 4630, "REVIEW": 151, "BLOCK": 31 }, "finding_counts": { "EXACT_DUPLICATE": 31, "FUZZY_DUPLICATE": 88 }, "findings_path": "/v1/scans/e2d9…/findings" }}Act on bills in your ERP
Section titled “Act on bills in your ERP”Invogi reads from connected ERPs but does not write to them. For invoices
synced from Business Central, Odoo, Xero or QuickBooks Online, the erp
object identifies the bill (record_id is its ID in the ERP), so your own
integration can act on it, for example:
- On
invoice.analysis.completedwithdecisionBLOCKorREVIEW, put the bill on hold in the ERP and record that your integration placed it. - On
finding.reviewedwithinvoice_open_findings0, release that hold if no finding on the invoice wasCONFIRMED.
A connection’s first sync imports its history, mostly bills paid long ago.
Those events carry initial_sync: true; skip holds for them unless you want to
act on old bills.
Only release holds your integration recorded. Your AP team may hold a bill for
reasons Invogi knows nothing about, and you can receive finding.reviewed for
invoices you never held. That includes findings from a historical audit, which
are never announced with finding.created.
erp is null for invoices from other sources.
When an invoice is corrected
Section titled “When an invoice is corrected”If someone corrects an invoice’s data in Invogi, the invoice is analysed again
and invoice.analysis.completed is sent with the new decision, plus
revision and superseded_finding_ids. The earlier findings are replaced, so
they get no finding.reviewed event: if you hold bills on BLOCK or REVIEW,
treat this event as the signal to release your hold when the new decision
allows it, or keep it when the invoice is still flagged.
finding.created is sent for findings that are open after the correction. A
finding that carries over with its earlier review is not announced again.
Every bill a sync brings in sends exactly one invoice.analysis.completed. If
the bill is an invoice you had already uploaded in a historical audit, it is
still analysed in full, but not flagged as a duplicate of that copy; the event
then also carries linked_scan_id.
Verify signatures
Section titled “Verify signatures”Every delivery carries two headers:
invogi-event-id: the event ID.invogi-signature:t=<unix seconds>,v1=<hex>.
The signature is HMAC-SHA256, keyed with your endpoint secret, over
<event id>.<t>.<raw request body>. Reject the request if no v1 value
matches or if t is more than a few minutes old.
import { createHmac, timingSafeEqual } from "node:crypto";
export function verifyInvogiWebhook(rawBody: string, headers: Headers, secret: string): boolean { const eventId = headers.get("invogi-event-id") ?? ""; const header = headers.get("invogi-signature") ?? ""; const match = header.match(/^t=(\d+)((?:,v1=[a-f0-9]+)+)$/); if (!match) return false;
const timestamp = Number(match[1]); if (Math.abs(Date.now() / 1000 - timestamp) > 300) return false;
const expected = createHmac("sha256", secret).update(`${eventId}.${timestamp}.${rawBody}`).digest(); return (match[2] ?? "") .split(",") .slice(1) .map((entry) => Buffer.from(entry.slice(3), "hex")) .some((candidate) => candidate.length === expected.length && timingSafeEqual(candidate, expected));}Always verify against the raw body, before parsing JSON.
Rotate a secret
Section titled “Rotate a secret”Rotate secret in the app (or POST /v1/webhooks/{id}/rotate-secret) returns a new
secret once. For 24 hours deliveries are signed with both secrets, so the
header carries two v1= values and the code above accepts either. Rotating
again within that window drops the older secret immediately.
Retries and replays
Section titled “Retries and replays”Respond with any 2xx status within 15 seconds. Failed deliveries are retried
with exponential backoff and stop after five failed attempts.
Integrations → Webhooks → Recent deliveries lists the latest 100 deliveries with status,
response code and attempt count, and a Replay button for failed ones. Use
invogi-event-id to ignore duplicates, since a replay re-sends the same event.
Event IDs are stable: one finding, review, analysis or scan always has the same
event ID, even if Invogi sends it again after an interruption.