Skip to Content
API ReferenceSessions API

Sessions API

File: app/api/analytics/sessions/route.ts

GET /api/analytics/sessions

Returns recent PostHog session recordings.

Parameters

ParameterRequiredDescription
passwordYesMust match ANALYTICS_PASSWORD env var

Response

{ "sessions": [ { "id": "session-uuid", "startTime": "2026-02-20T10:30:00Z", "duration": 123, "clicks": 5, "keypresses": 10, "activeSeconds": 60, "replayUrl": "https://eu.posthog.com/project/130497/replay/session-uuid" } ] }

Returns the 20 most recent recordings, sorted by start time (newest first).

Error codes

StatusCondition
401Invalid or missing password
500PostHog not configured