Reference
Desktop Agent API
AxosilDesk ships a native desktop agent built with Tauri 2 for activity tracking, idle detection and screenshot capture. These are the endpoints it uses; a custom agent can use them too.
Architecture
The agent is a lightweight tray application. It talks to the AxosilDesk API over HTTPS with an agent token tied to one user and one machine.
| Component | Technology |
|---|---|
| Runtime | Tauri 2 (Rust backend + WebView frontend) |
| Active window | active-win-pos-rs |
| Idle detection | Windows GetLastInputInfo |
| Screenshots | xcap screen capture, compressed to WebP on the server |
| Communication | HTTPS REST calls with Authorization: Bearer <agent-token> |
Agent lifecycle
- Registration — the agent sends the user's credentials and machine details to
POST /api/v1/agent/registerand receives an agent ID, token and tracking configuration. - Activity sync — every
activitySyncIntervalSeconds(60 s) the agent sends the batched window activity toPOST /api/v1/agent/sync. - Heartbeat — every
heartbeatIntervalSeconds(30 s) it callsPOST /api/v1/agent/heartbeatto stay online. - Screenshots — when the workspace has the screenshots module, every
screenshotIntervalSeconds(default 5 minutes) it uploads a capture toPOST /api/v1/agent/screenshot. - Sign-out —
POST /api/v1/agent/logoutrevokes the token at once and marks the agent offline.
Endpoints
Every response uses the same envelope: { "success": true, "data": … } on success and { "success": false, "error": { "code", "message" } } on failure. A 401 on any authenticated call means the token was revoked or expired: register again.
Register agent
Public. The workspace is found from the credentials, so omit tenantSlug unless the user picked a workspace: when the same credentials are valid in several workspaces the server answers 409 WORKSPACE_CHOICE with the list to choose from. agentVersion is required.
POST /api/v1/agent/register
Content-Type: application/json
{
"email": "user@company.com",
"password": "••••••••",
"hostname": "WORK-PC-01", // optional; identifies the machine
"os": "windows", // optional
"agentVersion": "0.2.0",
"tenantSlug": "my-company" // optional
}{
"success": true,
"data": {
"agentId": "550e8400-e29b-41d4-a716-446655440000",
"userId": "…", "tenantId": "…", "tenantSlug": "my-company",
"userName": "Jane Doe", "userEmail": "user@company.com",
"token": "eyJhbGciOiJIUzI1NiIs…",
"config": {
"screenshotIntervalSeconds": 300,
"activitySyncIntervalSeconds": 60,
"heartbeatIntervalSeconds": 30,
"idleThresholdSeconds": 300,
"blurScreenshots": false,
"dataRetentionDays": 90,
"screenshotsEnabled": true
}
}
}| Status | Code | Meaning |
|---|---|---|
| 400 | INVALID_INPUT | Missing email, password or agentVersion |
| 401 | INVALID_CREDENTIALS | Wrong email or password |
| 401 | MFA_REQUIRED | Retry with the same machine fields plus mfaToken (returned) and mfaCode |
| 403 | MFA_SETUP_REQUIRED | The workspace requires two-factor; enrol on the web first |
| 409 | WORKSPACE_CHOICE | Pick one of the returned workspaces and retry with tenantSlug |
| 429 | RATE_LIMITED | Too many attempts from this IP (30 per 15 minutes) |
Sync activities
Sends up to 1,000 events per batch plus the agent status (body capped at 5 MB). The agent identity comes from the token; agentId is informational. Retries are safe: events are unique per agent, start time and type. Events older than 14 days or in the future are skipped and durations are capped at 24 hours.
POST /api/v1/agent/sync
Authorization: Bearer <agent-token>
Content-Type: application/json
{
"status": "online", // online | idle | break | offline (optional)
"events": [
{
"type": "app_usage", // app_usage | url_visit | idle | active | focus_session
"appName": "Google Chrome",
"windowTitle": "AxosilDesk Dashboard",
"url": "https://app.example.com", // optional
"durationSeconds": 300,
"startedAt": "2026-01-15T09:00:00Z",
"endedAt": "2026-01-15T09:05:00Z", // optional
"keyboardEvents": 120, // optional
"mouseEvents": 340 // optional
}
],
"batchTimestamp": "2026-01-15T09:05:01Z"
}{ "success": true, "data": { "received": 1, "stored": 1, "skipped": 0 } }Heartbeat
POST /api/v1/agent/heartbeat
Authorization: Bearer <agent-token>
Content-Type: application/json
{ "status": "online" } // online | offline | idle | away | break (optional){ "success": true, "data": { "ack": true } }Upload a screenshot
The image is sent base64-encoded (at most 5 MB decoded) and stored as WebP. capturedAt must be within the last day. Limited to 10 uploads a minute and 240 an hour per agent; answers 403 when the workspace does not have the screenshots module and 413 when the image is too large.
POST /api/v1/agent/screenshot
Authorization: Bearer <agent-token>
Content-Type: application/json
{
"imageBase64": "iVBORw0KGgoAAAANSUhEUgAA…",
"appName": "Google Chrome", // optional
"windowTitle": "AxosilDesk Dashboard", // optional
"capturedAt": "2026-01-15T09:05:00Z", // optional
"blurred": false // optional
}{ "success": true, "data": { "screenshotId": "…", "storageKey": "…" } }Other agent endpoints
| Endpoint | Purpose |
|---|---|
| GET /api/v1/agent/config | Latest tracking configuration (agent token or signed-in user); called on start-up and periodically |
| POST /api/v1/agent/location | Report the current location; the user and agent come from the credentials |
| POST /api/v1/agent/logout | Revoke the agent token and mark the agent offline |
| GET /api/v1/agent/update/:target/:arch/:current | Tauri updater manifest; 204 when there is no newer release |
Configuration
The configuration comes from workspace settings and the plan, and is returned by registration. Always use the returned values rather than hard-coded intervals.
| Setting | Default | Description |
|---|---|---|
| screenshotIntervalSeconds | 300 | Seconds between screenshots (workspace setting, else the plan default) |
| activitySyncIntervalSeconds | 60 | Seconds between activity sync batches |
| heartbeatIntervalSeconds | 30 | Seconds between heartbeats |
| idleThresholdSeconds | 300 | Seconds of inactivity before the user is marked idle |
| blurScreenshots | false | Blur screenshots before upload |
| dataRetentionDays | 90 | How long activity data is kept (plan) |
| screenshotsEnabled | — | Whether the workspace has the screenshots module; capture only when true |
Supported platforms
Windows
Windows installer (NSIS)
macOS
No macOS build is published
Linux
No Linux build is published