Activities
Plugins and the Desktop Agent upload aggregated activity, not raw keystroke streams or file contents.
All write routes below require Bearer authentication.
IDE / plugin activity sync
Primary bulk upload used by VS Code, JetBrains, and compatible editors:
POST /main/api/v1/sync/activities
Authorization: Bearer <token>
Content-Type: application/json
Request body
{
"activities": [
{
"language": "go",
"lines": 10,
"time": 60,
"date": "2026-06-15",
"hour": 14,
"path": "/home/user/project/main.go",
"project_name": "my-app",
"ide_name": "VSCode",
"filename": "main.go"
}
]
}
| Field | Required | Notes |
|---|---|---|
language | yes | Language / grammar id |
time | yes | Seconds in this bucket |
lines | no | Non-negative line metric |
date | recommended | YYYY-MM-DD |
hour | recommended | 0–23 |
path | no | File or workspace path metadata |
project_name | no | Project / workspace label |
ide_name | no | e.g. VSCode, JetBrains, IntelliJ |
filename | no | Basename helper for charts |
Response (typical)
JSON acknowledging how many activities were accepted / grouped. Clients should retry on network failure and keep a local queue.
There is also a single-record create variant under the activities API for specialized clients. Prefer batch sync for normal plugin traffic.
For typed request models, see Python SDK activity uploads and Go SDK activity uploads.
Desktop Agent activity sync
Used by the Desktop Agent for focused-application time:
POST /main/api/v1/sync/activities/desktop
Authorization: Bearer <token>
Content-Type: application/json
Request body
{
"activities": [
{
"platform": "Linux",
"program_name": "firefox",
"path": "/usr/lib/firefox/firefox",
"filename": "firefox",
"time": 120,
"date": "2026-06-15",
"hour": 14
}
]
}
| Field | Required | Notes |
|---|---|---|
platform | yes | Linux, Windows, Darwin, … |
time | yes | Seconds focused |
date | yes | YYYY-MM-DD |
hour | yes | 0–23 |
path | yes* | Executable / app path when known |
filename | yes* | Basename |
program_name | yes* | App identity |
*Required by the desktop sync contract; send empty strings only when the OS cannot resolve a value (prefer omitting empty uploads).
A single-record desktop create endpoint exists for parity with IDE create, but the agent uses batch sync in production.
Guidance for plugin authors
- Bucket by language (and project) + date + hour before upload.
- Send compact batches on an interval (seconds to a minute), not per keystroke.
- Never upload file bodies, diffs, or clipboard data.
- Set
ide_nameso dashboards can split VS Code vs JetBrains time. - Back off on
5xx/ network errors; keep an offline queue.