Working with Webhooks
This guide explains how to register webhooks, handle incoming webhook events, and understand the custom headers and payloads provided by the Diligent AI API.1. Registering Webhooks
To receive webhook notifications, register your webhook endpoint via the API. You can subscribe to specific event types. Endpoint:POST /webhooks
Request Example:
cdd_state_changed: Triggered when the state of a CDD changes to inconclusive or complete.monitoring_alert_fired: Triggered when a monitoring alert is fired on failure.cdd_document_fetched: Triggered when a new document is successfully added to a CDD case.name_screening_search_completed: Triggered when a name screening search completes and results are available.
2. Receiving Webhooks
When an event occurs, Diligent AI sends an HTTPS POST request to your registered endpoint.Custom Headers
Each webhook request includes custom headers to help you identify and verify the event:| Header | Description |
|---|---|
| Content-Type | Always application/json |
| User-Agent | Sender identifier (e.g., DiligentAI/1.0) |
| X-Webhook-Id | Unique ID of your webhook |
| X-Event-Id | Unique ID of this delivery event |
| X-Customer-Id | Your customer ID |
| X-Target-type | Entity type (CDD, MONITORING_ALERT, or NAME_SCREENING) |
| X-Event-Name | Name of the triggered event (CDD_STATE_CHANGED, MONITORING_ALERT_FIRED, NAME_SCREENING_SEARCH_COMPLETED, CDD_DOCUMENT_FETCHED) |
| X-Signature | HMAC signature for authenticity |
Example Payloads
cdd_state_changed
payload: Full CDD object (see CDD Object).
monitoring_alert_fired
payload: Alert object with details about the triggered alert.
cdd_document_fetched
payload: Full CDD object snapshot including all documents (see CDD Object).
search_completed
payload: Search object with alert and hits details from the name screening provider.
3. Webhook Flow Diagram
Below is a simple flow of how a webhook is triggered and received:- Diligent AI triggers the webhook when an event occurs.
- Your server receives a POST request with custom headers and event payload.
- Your server should process the event and return a 200 OK status to acknowledge receipt.