ActivityWatch organizes all tracked data as events stored in buckets. Understanding this model is the foundation for working with the REST API, writing watchers, and building queries.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/ActivityWatch/activitywatch/llms.txt
Use this file to discover all available pages before exploring further.
Events
An event represents a discrete period of activity. Every event has three fields:| Field | Type | Description |
|---|---|---|
id | integer | Auto-assigned unique identifier |
timestamp | ISO 8601 string | When the event started (UTC) |
duration | float (seconds) | How long the event lasted |
data | object | Arbitrary key-value payload specific to the watcher type |
Example events
Window watcher event:Buckets
A bucket is a named container for events from a single watcher on a single host. Buckets group related events by their source.| Field | Type | Description |
|---|---|---|
id | string | Unique identifier, e.g. aw-watcher-window_hostname |
type | string | Event schema type, e.g. currentwindow |
client | string | Name of the watcher that created the bucket |
hostname | string | Machine the bucket’s data came from |
created | ISO 8601 string | When the bucket was created |
Naming convention
Bucket IDs follow the pattern{watcher-name}_{hostname}:
You can find all your bucket IDs on the Buckets page of the dashboard at
http://localhost:5600, or by calling GET /api/0/buckets/.Event types
Different watchers produce differentdata schemas:
currentwindow (aw-watcher-window)
currentwindow (aw-watcher-window)
app— application/process nametitle— window title
afkstatus (aw-watcher-afk)
afkstatus (aw-watcher-afk)
status—"not-afk"when the user is active,"afk"when idle
web.tab.current (aw-watcher-web)
web.tab.current (aw-watcher-web)
url— full URL of the active tabtitle— page titleaudible— whether the tab is playing audioincognito— whether the tab is in a private/incognito window
Heartbeat merging
Watchers send heartbeats at a regular interval. If a new heartbeat arrives withinpulsetime seconds and has identical data, the server extends the current event’s duration rather than creating a new one. This keeps storage efficient without losing resolution.
REST API Overview
Query and manipulate buckets and events via HTTP
Writing Watchers
Use aw-client to send events from your own watcher
