Skip to content

API Reference

Tracking Endpoints

All tracking endpoints accept POST with Content-Type: application/json. No authentication required. All responses include CORS headers.

MethodPathDescription
POST/track/session/startStart a new tracking session
POST/track/eventRecord a single event
POST/track/events/batchRecord multiple events (max 100)
POST/track/session/endEnd a session and calculate engagement
OPTIONS/track/*CORS preflight

Analytics Endpoints

All analytics endpoints require API key authentication and accept GET only. See Analytics API for full details.

MethodPathDescription
GET/analytics/overviewSummary stats (sessions, events, visitors)
GET/analytics/sessions/dailyDaily session counts
GET/analytics/pages/topMost viewed pages
GET/analytics/geoCountry-level distribution
GET/analytics/engagementEngagement score buckets
GET/analytics/sourcesTraffic referrer ranking
GET/analytics/realtimeActive sessions and live stats
GET/analytics/storageR2 storage stats
GET/analytics/leadsPaginated lead listing with filters
GET/analytics/leads/:idLead detail with replay-linked activity
GET/analytics/leads/projectsDistinct project names for filter dropdowns
GET/analytics/leads/sourcesDistinct sources for filter dropdowns
GET/analytics/anomaliesAnomaly detection (submission drops, traffic spikes, VPN ratio)
OPTIONS/analytics/*CORS preflight (no auth required)

Lead Capture

MethodPathDescription
POST/lead.capturePrimary lead capture endpoint
POST/lead.capture/crm-callbackCallback for Make.com to send CRM lead ID after CRM create (Phase 8)
POST/leadDeprecated — use /lead.capture (sunset 2026-06-01)
POST/Deprecated — use /lead.capture (sunset 2026-06-01)
OPTIONS/lead.captureCORS preflight

Other Endpoints

MethodPathDescription
GET/tracker.jsServes the frontend tracking script
GET/form.jsServes the dynamic form builder script
GET/pulse.jsCombined tracker + form script; PulseGate.init() defaults endpoint to script origin
GET/healthHealth check ({ status: "ok", timestamp })

Authentication

Analytics endpoints require an API key in one of two headers:

Authorization: Bearer <your-api-key>

or

X-API-Key: <your-api-key>

Requests without a valid key receive 401 Unauthorized with a WWW-Authenticate: Bearer header.

Common Response Format

Success (200):

json
{
  "session_id": "uuid",
  "visitor_id": "sha256-hash",
  "timestamp": 1740000000000
}

Error (400/401/404/405):

json
{
  "error": "Description of what went wrong"
}

Rate Limiting

Tracking endpoints (/track/*) are rate-limited per IP using a fixed-window strategy:

RouteLimit
/track/session/start10 requests/min
/track/session/end10 requests/min
/track/event120 requests/min
/track/events/batch30 requests/min

When rate-limited, the response includes:

  • 429 Too Many Requests status
  • Retry-After header (seconds until reset)
  • X-RateLimit-Remaining and X-RateLimit-Reset headers

CORS Headers

All responses include:

Access-Control-Allow-Origin: *
Access-Control-Allow-Methods: GET, POST, OPTIONS
Access-Control-Allow-Headers: Content-Type, X-Fingerprint-ID, X-Visitor-ID, Authorization, X-API-Key
Content-Type: application/json