Skip to main content

Documentation Index

Fetch the complete documentation index at: https://developer.trackpilots.com/llms.txt

Use this file to discover all available pages before exploring further.

πŸ§ͺ Beta FeatureReseller Webhook Simulations is currently in beta. The core functionality is stable, but additional event types and options will be added in future releases.

πŸ“Œ Overview

The Simulations page lets you send a realistic, cryptographically signed test payload to your reseller webhook endpoint β€” without waiting for a real employee desktop event to fire. Use simulations to:
  • Verify your endpoint URL is reachable
  • Confirm your HMAC signature verification logic is correct
  • Inspect the exact payload structure for each event type
  • Debug response errors before going live
πŸ‘‰ Direct link: https://app.trackpilots.com/resellers/simulations
πŸ” Real SignaturesSimulation payloads are signed with the same HMAC SHA256 algorithm as live events. Your server’s signature verification code will work identically for both.

πŸš€ How to Run a Simulation

  1. Go to Resellers β†’ Simulations
  2. Select a Webhook from the dropdown β€” lists all configured reseller webhooks with their URLs
  3. Select an Event Type β€” only events subscribed to on the selected webhook are shown:
    • desktop.app_tracking.captured
    • desktop.screenshot_tracking.captured
    • desktop.activity_tracking.captured
  4. Review the Request Payload Preview (right panel) to see the exact JSON that will be sent
  5. Click Send Test Event
  6. View the Simulation Result panel for the full response details

πŸ“¦ Request Payload Preview

Before sending, the right panel shows a formatted preview of the payload that will be delivered to your endpoint. The preview updates automatically when you change the webhook or event selection. All simulation payloads include "simulation": true so you can distinguish them from live events in your server logs.

πŸ“¨ Payload Structures

App Tracking Event β€” desktop.app_tracking.captured

{
  "event": "desktop.app_tracking.captured",
  "version": "v1",
  "agent": "desktop-agent",
  "simulation": true,
  "timestamp": 1716000000000,
  "data": [
    {
      "organisation": { "organisationId": "<uuid>" },
      "team": { "teamId": "<uuid>" },
      "user": { "userId": "<uuid>" },
      "tracking": {
        "trackingId": "<uuid>",
        "app": {
          "name": "Google Chrome",
          "type": "website",
          "category": "Unknown Category",
          "iconUrl": "https://www.google.com/favicon.ico",
          "domain": "google.com",
          "fullUrl": "https://www.google.com",
          "productivityStatus": "neutral"
        },
        "time": {
          "startDate": "2024-01-15T09:00:00.000Z",
          "endDate": "2024-01-15T09:00:20.000Z",
          "durationInSeconds": 20
        },
        "trackingMode": "online",
        "operatingSystem": "macos"
      }
    }
  ]
}

Screenshot Tracking Event β€” desktop.screenshot_tracking.captured

{
  "event": "desktop.screenshot_tracking.captured",
  "version": "v1",
  "agent": "desktop-agent",
  "simulation": true,
  "timestamp": 1716000000000,
  "data": [
    {
      "organisation": { "organisationId": "<uuid>" },
      "team": { "teamId": "<uuid>" },
      "user": { "userId": "<uuid>" },
      "screenshot": {
        "screenshotId": "<uuid>",
        "imageBuffer": "[simulation-placeholder: binary image buffer not included]",
        "app": {
          "name": "Google Chrome",
          "type": "website",
          "category": "Unknown Category",
          "iconUrl": "https://www.google.com/favicon.ico",
          "domain": "google.com",
          "fullUrl": "https://www.google.com",
          "productivityStatus": "productive"
        },
        "time": { "capturedAt": "2024-01-15T09:00:00.000Z" },
        "operatingSystem": "macos",
        "workType": "remote",
        "isIdle": false
      }
    }
  ]
}
πŸ–ΌοΈ imageBuffer in SimulationsIn simulation payloads, imageBuffer contains a placeholder string instead of a real binary image. In live events, this field carries the actual screenshot binary. Make sure your server handles both gracefully.

Activity Tracking Event β€” desktop.activity_tracking.captured

Fired when an employee switches between Work Mode and Privacy Mode on their desktop app.
{
  "event": "desktop.activity_tracking.captured",
  "version": "v1",
  "agent": "desktop-agent",
  "simulation": true,
  "timestamp": 1716000000000,
  "data": {
    "organisation": { "organisationId": "<uuid>" },
    "team": { "teamId": "<uuid>" },
    "user": { "userId": "<uuid>" },
    "activity": { "workMode": true }
  }
}
  • workMode: true β€” Employee switched to Work Mode (tracking active)
  • workMode: false β€” Employee switched to Privacy Mode (tracking paused)

πŸ“Š Simulation Result Panel

After sending, the result panel shows:
FieldDescription
HTTP StatusResponse code from your server (2xx = success, 4xx/5xx = error)
LatencyRound-trip time in milliseconds
Resultβœ… Delivered or ❌ Failed
Delivery HeadersThe x-webhook-signature and x-webhook-timestamp headers sent with the request
Sent PayloadThe full JSON body that was POSTed to your endpoint
Endpoint ResponseThe raw response body your server returned
All three code blocks have a πŸ“‹ copy button for easy inspection.

πŸ” Signature Verification

The simulation sends the same headers as a live webhook:
HeaderDescription
x-webhook-signatureHMAC SHA256 of timestamp.body signed with your webhook secret
x-webhook-timestampUnix timestamp in milliseconds when the request was sent
Your server should verify the signature using:
HMAC_SHA256(timestamp + "." + rawBody, WEBHOOK_SECRET) === x-webhook-signature
See the Webhooks guide for a complete Node.js implementation with timing-safe comparison.

❌ Error Reference

HTTP StatusError ShownMeaning
404Webhook not foundThe webhook was deleted after selection
400Event type not registeredThe selected event is not in this webhook’s subscribed events
503Service unavailableSimulation service is temporarily down β€” retry in a moment
Network errorNetwork errorYour endpoint is unreachable from Trackpilots servers
OtherSimulation failedUnexpected error β€” check your endpoint logs

πŸ§ͺ Test Locally with ngrok

To test simulations against a local server:
  1. Start your local webhook server (e.g. on port 3000)
  2. Run ngrok to expose it:
    ngrok http 3000
    
  3. Copy the generated HTTPS URL (e.g. https://abc123.ngrok.io)
  4. Create or edit a reseller webhook with this URL
  5. Run a simulation β€” your local server will receive the signed payload
⚠️ ngrok URLs are Temporaryngrok URLs change each session (on the free plan). Update your webhook URL each time you restart ngrok.

βœ… Summary

StepAction
1Select a configured reseller webhook
2Choose an event type to simulate
3Preview the request payload
4Click Send Test Event
5Inspect status, latency, headers, payload, and response

πŸ”— No webhooks yet?You need at least one reseller webhook configured before running simulations. πŸ‘‰ Create a Reseller Webhook