Choosing workspaces
All five endpoints take the same filters:filters[workspaceId]: one or more workspace IDs, comma-separated (up to 100).filters[accountId]andfilters[templateId]: the same filters asGET /v1/workspaces.
filters[workspaceId] to report on every workspace. Archived workspaces and playbooks are never included. The four analytics endpoints order rows by workspace creation date, so paging with page and limit is stable. The assets endpoint pages by workspace instead of by row: each page holds every row of up to limit workspaces. The events feed pages differently, by cursor in order of change (see Syncing events).
Choosing fields
Rows have no ID of their own. Each row is numbers about things that already exist in Dock, and it always includes them as nested objects:workspace on every endpoint, plus user on people, workspacePage on pages, and asset or file on assets. Each has its object, id and url, except file, which has only object and id (request file.url for its link). Use those IDs as the row’s key, for example workspace ID + user ID for a People row. Everything else is opt-in with properties[]:
workspace.* on every endpoint, user.* on people, workspacePage.* and viewers.* on pages, and asset.*, file.* and creator.* on assets. Only the numbers you request are calculated, so asking for fewer fields makes requests faster.
What the numbers count
The numbers match the Activity tab, including who each tab counts:- Summary
- Views and time spent are totals across the workspace’s visible pages, the same sums the Summary tab shows.
- Visitors counts distinct people who viewed the workspace, internal users included and the workspace creator excluded.
- People lists every workspace member, internal and external.
viewsCountcounts workspace visits. - Pages
- Views count page views by people whose activity is tracked.
- Time spent counts external contacts.
- Hidden pages are left out unless you pass
filters[includeHidden]=true.
- Assets
- Asset counts include everyone who opened the asset in the workspace.
- Only files uploaded to the workspace itself (
file.source: Project) have counts.
These numbers can differ from Views and Actions on the Workspaces list
and from the legacy
totalViews and totalActions properties on GET /v1/workspaces. Those count workspace sessions by external contacts, not page
views.Syncing events
GET /v1/workspaces/events returns the Feed tab’s events, oldest change first, with the same type names as webhook events. Use it to backfill a warehouse and keep it current, alongside or instead of webhooks.
- First request: call it without
cursor. Addfilters[updatedAfter]to skip older history. - Keep paging: pass the response’s
nextCursorascursorwhilehasMoreistrue. Send the samefiltersevery time; a cursor only works with the filters it was issued for. - Stay current: store the last
nextCursorand call again later (for example every few minutes) to get what changed since. - Upsert by
id: an event can come back with the sameidwhen it changes, for example when more time is spent on a page view. Replace your stored copy. - Roll up time from page views: only page views carry
timeSpentSeconds. To get a visit’s time, add up the page views whoseparentEventIdis thatworkspace.viewedevent.
- Events appear about two minutes after they happen, so changes still being saved aren’t skipped. A save that takes longer than two minutes to finish, which is rare, can be missed.
- A page can hold fewer than
limitevents, even none, whilehasMoreistrue, because events with no public type and events outsidefilters[type]are skipped. FollowhasMore, not the count. - Like the Feed tab, events from contacts whose activity tracking is turned off are left out, except comments, messages, completed tasks, signed order forms and course events.
- Events carry IDs and names only. Fetch comment, message and form content from their own endpoints.
- Deleted events are not reported. When an account or workspace is deleted or archived, or a contact’s activity tracking is turned off, their earlier events stop appearing; the feed does not send a removal.