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:
A unique identifier for the event (e.g., event_euyrvozb9302uwhq). You can use this ID for reconciliation processes.
The type of event that occurred (e.g., file.deleted).
The time when the event occurred, in ISO 8601 format (e.g., 2025-04-12T15:55:19.000Z).
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:
file.created
Event triggered when a new file is created.
file.deleted
Event triggered when a file is deleted.
Task Events
Events related to task operations. The following events are available:
task.created
Event triggered when a new task is created.
task.deleted
Event triggered when a task is deleted.
task.failed
Event triggered when a task fails.
task.completed
Event triggered when a task is completed.
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.