Analytics

Initialize session replay with metadata

post/_temps/session-replay/init

Request

  • Base URL: /api (relative, and the document was published on a file host, not at the API’s origin)
  • URL: /api/_temps/session-replay/init
  • Auth: none declared

Query parameters

temps_keystring

Query-string fallback for the analytics ingest key, for clients that cannot set custom headers (navigator.sendBeacon). Consulted only when the x-temps-analytics-key header is absent; identical precedence and error semantics.

Headers

x-temps-analytics-keystring nullable

Analytics ingest key (ADR-040), pa_ followed by 64 hex characters. An alternative to Host-based project resolution, for apps Temps does not deploy and which therefore have no route-table entry. When present it takes precedence and the Host header is not consulted for resolution; a key that does not resolve to an active row is a 401, never a fallback to Host. The value is public by design — it ships in client JS — and is write-only: it grants analytics ingest for one project (optionally one environment) and nothing else.

Request body

colorDepthinteger nullable
languagestring nullable
screenHeightinteger nullable
screenWidthinteger nullable
sessionIdstring required
timestampstring nullable
timezonestring nullable
urlstring nullable
userAgentstring nullable
viewportHeightinteger nullable
viewportWidthinteger nullable
visitorIdstring nullable

Client-generated visitor id, used only when the request carries no Temps-issued _temps_visitor_id cookie — i.e. Temps is used purely as an analytics backend for an app it doesn't deploy/proxy (gotempsh/temps#848). The SDK already sends this today via getSessionMetadata().

Response

Session initialized successfully

messagestring required
session_idstring required

Changes

No recorded changes to this operation across all 50 revisions of this API.