# Webhooks

ComplyCube uses [webhooks](https://en.wikipedia.org/wiki/Webhook) to notify your application when an event happens in your account. Webhooks are particularly useful for asynchronous events like when a [check](https://docs.complycube.com/documentation/api-reference/core-resources/checks) has concluded.

You can configure webhook endpoints via the API or the Web Portal to be notified about events that happen in your ComplyCube account and related resources.

Upon receiving a webhook notification, you should acknowledge success by responding with an HTTP `20x` response within 15 seconds. Otherwise, we will attempt to resend the notification up to 10 times according to an exponential back-off schedule.

The first attempt will be made 60 seconds after the initial attempt; the second attempt will be made 120 seconds later; the third attempt will be made 480 seconds later, and so forth until all 10 attempts are exhausted. After which, the corresponding webhook will be disabled.

You can quickly inspect webhook events with temporary endpoint URLs using free hosted services such as *<https://webhook.site>*.

[Learn more about ComplyCube Webhooks](https://docs.complycube.com/documentation/guides/webhooks)

### The Webhook object

<table><thead><tr><th width="150">Attribute</th><th width="150">Type</th><th>Description</th></tr></thead><tbody><tr><td><code>id</code></td><td>string</td><td>The unique identifier for the webhook.</td></tr><tr><td><code>description</code></td><td>string</td><td>A description of what the webhook is used for.</td></tr><tr><td><code>url</code></td><td>string</td><td>The URL of the webhook endpoint - <strong>must be HTTPS</strong>.</td></tr><tr><td><code>enabled</code></td><td>boolean</td><td>Determines if the webhook should be active.</td></tr><tr><td><code>events</code></td><td>array[string]</td><td>The list of <a href="#event-types">event types</a> enabled for this webhook. <code>["*"]</code> indicates that all events will be published.</td></tr><tr><td><code>secret</code></td><td>string</td><td>The endpoint’s secret used to generate <a href="https://docs.complycube.com/documentation/guides/webhooks#verify-the-webhook-signatures-using-our-official-libraries">webhook</a> signatures. <strong>Only</strong> returned at creation.</td></tr><tr><td><code>createdAt</code></td><td>string</td><td>The date and time when the webhook was created.</td></tr><tr><td><code>updatedAt</code></td><td>string</td><td>The date and time when the webhook was updated.</td></tr></tbody></table>

### Event Types

<table><thead><tr><th width="374">Event</th><th>Description</th></tr></thead><tbody><tr><td><code>workflow.session.started</code></td><td>A workflow session has been started.</td></tr><tr><td><code>workflow.session.cancelled</code></td><td>A workflow session has been cancelled.</td></tr><tr><td><code>workflow.session.processing</code></td><td>The customer has finished all steps in the workflow session, and the verification checks are now in progress.</td></tr><tr><td><code>workflow.session.completed</code></td><td>A workflow session has been completed.</td></tr><tr><td><code>workflow.session.updated</code></td><td>A workflow session outcome has been updated.</td></tr><tr><td><code>check.pending</code></td><td>A check has been created and is in <code>pending</code> state.</td></tr><tr><td><code>check.completed</code></td><td>A check has completed with <strong>any</strong> outcome.</td></tr><tr><td><code>check.completed.clear</code></td><td>A check has completed with <code>clear</code> outcome.</td></tr><tr><td><code>check.completed.attention</code></td><td>A check has completed with <code>attention</code> outcome.</td></tr><tr><td><code>check.completed.rejected</code></td><td>A check has completed with <code>rejected</code> outcome.</td></tr><tr><td><code>check.completed.match_confirmed</code></td><td>A check has completed with <code>match_confirmed</code> outcome.</td></tr><tr><td><code>check.monitoring.attention</code></td><td>A monitoring check has completed with <code>attention</code> outcome.</td></tr><tr><td><code>check.failed</code></td><td>A check has failed.</td></tr><tr><td><code>check.updated</code></td><td>A check has been updated.</td></tr><tr><td><code>client.created</code></td><td>A client has been created.</td></tr><tr><td><code>client.updated</code></td><td>A client has been updated.</td></tr><tr><td><code>client.deleted</code></td><td>A client has been deleted.</td></tr><tr><td><code>document.created</code></td><td>A document has been created.</td></tr><tr><td><code>document.updated</code></td><td>A document has been updated.</td></tr><tr><td><code>document.updated.image_uploaded</code></td><td>A document has been updated with a new image.</td></tr><tr><td><code>document.updated.image_deleted</code></td><td>A document has been updated as an image has been deleted.</td></tr><tr><td><code>document.deleted</code></td><td>A document has been deleted.</td></tr><tr><td><code>address.created</code></td><td>An address has been created.</td></tr><tr><td><code>address.updated</code></td><td>An address has been updated.</td></tr><tr><td><code>address.deleted</code></td><td>An address has been deleted.</td></tr></tbody></table>

### The Event Object

{% tabs %}
{% tab title="Attributes" %}

<table><thead><tr><th width="195.04743630742556">Attribute</th><th width="89">Type</th><th>Description</th></tr></thead><tbody><tr><td><code>id</code></td><td>string</td><td>The unique identifier for the event, which a webhook listener can use to bypass notification processing on a webhook notification sent more than once.</td></tr><tr><td><code>type</code></td><td>string</td><td>The <a href="#event-types">event type</a> that initiated the event.</td></tr><tr><td><code>resourceType</code></td><td>string</td><td>The type of the object contained within the payload, e.g. <a href="../core-resources/checks">check</a> object.</td></tr><tr><td><code>payload</code></td><td>object</td><td>The key attributes of the object associated with this event. Also, see the <a href="#payload-by-resource-type">payload by resource type</a> table below.</td></tr><tr><td><code>createdAt</code></td><td>string</td><td>The date and time when the webhook was created.</td></tr></tbody></table>
{% endtab %}

{% tab title="Sample Object" %}

```javascript
{
  "id": "5ed170fe99c81a0007b9a3d3",
  "type": "check.completed.clear",
  "resourceType": "check",
  "payload": {
    "id": "5ed3918fbf06f30008e552c9",
    "outcome": "clear",
    "status": "complete",
    "createdAt": "2020-01-01T11:14:23.964Z",
    "updatedAt": "2020-01-01T11:14:23.964Z"
  },
  "createdAt": "2020-01-01T11:14:23.964Z"
}
```

{% endtab %}
{% endtabs %}

#### Payload by resource type

<table><thead><tr><th width="239">Type</th><th>Payload</th></tr></thead><tbody><tr><td><ul><li><a href="../core-resources/clients">clients</a></li><li><a href="../core-resources/documents">documents</a></li><li><a href="../core-resources/addresses">addresses</a></li><li><a href="../core-resources/live-photos">livePhotos</a></li></ul></td><td><ul><li>On create: the object of the corresponding resource.</li><li>On update: <code>id</code> of the object along with updated fields.</li><li>On delete: <code>id</code> of the deleted object.</li></ul></td></tr><tr><td><ul><li><a href="../core-resources/checks">checks</a></li></ul></td><td><ul><li>On create: the object of the corresponding resource.</li><li>On update: <code>id</code> of the object along with updated fields.</li><li><p>On other events:</p><ul><li><code>id</code>: The unique identifier for the check.</li><li><code>status</code>: The status of the check.</li><li><code>outcome</code>: The outcome of the check. Only returned when the status is <code>complete</code>.</li><li><code>createdAt</code>: The date and time when the check was created.</li><li><code>updatedAt</code>: The date and time when the check was updated.</li></ul></li></ul></td></tr></tbody></table>
