Events

Learn about the events in the API.

Overview

When an event happens, Scan Documents creates a new Event object. This event triggers a webhook notification if user has registered a webhook endpoint and subscribed to the event type.

This is an example of an event object for a file.deleted event:

{
    "data": {
      "id": "file_y9f6oitmeoncvcou",
      "name": "file-example",
      "type": "image/png"
    },
    "id": "event_wal69rzpapqrm7yj",
    "timestamp": "2025-04-12T15:55:19.000Z",
    "type": "file.deleted"
}

Properties

The event object contains the following fields:

id
string

A unique identifier for the event (e.g., event_euyrvozb9302uwhq). You can use this ID for reconciliation processes.

type
string

The type of event that occurred (e.g., file.deleted).

timestamp
string

The time when the event occurred, in ISO 8601 format (e.g., 2025-04-12T15:55:19.000Z).

data
object

The data associated with the event. The structure of this object depends on the event type.

Event Types

At the moment, there are two main resources that can trigger events: files and tasks. Each resource has its own set of events.

File Events

Events related to file operations. The following events are available:

Task Events

Events related to task operations. The following events are available:

Webhook Notifications

When an event occurs, Scan Documents sends a webhook notification to the registered endpoint. The notification contains the event object in the request body.

Learn more about webhooks and how to set them up.