Metrics

Record analytics event

post/_temps/event

Request

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

Query parameters

temps_keystring

Query-string fallback for the analytics ingest key, for clients that cannot set custom headers (navigator.sendBeacon, used for page-unload events). 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

clsnumber float nullable

Cumulative Layout Shift (score)

domainstring nullable

The tracked site's own domain, computed client-side by the SDK's resolveDomain() and sent as a sibling of event_data (not nested inside it). Used on the keyed ingest path (ADR-040 §3) to attribute self-referrals/channels correctly: there, Host names the Temps server rather than the customer's site, so it can't be used for that.

event_dataunknown required
event_namestring required
fcpnumber float nullable

First Contentful Paint (milliseconds)

fidnumber float nullable

First Input Delay (milliseconds)

inpnumber float nullable

Interaction to Next Paint (milliseconds)

languagestring nullable
lcpnumber float nullable

Largest Contentful Paint (milliseconds)

page_titlestring nullable
referrerstring nullable

Referrer URL (falls back to Referer header if not provided)

request_pathstring required
request_querystring required
screen_heightinteger nullable
screen_widthinteger nullable
session_idstring nullable

Client-generated session id fallback (see visitor_id).

ttfbnumber float nullable

Time to First Byte (milliseconds)

viewport_heightinteger nullable
viewport_widthinteger nullable
visitor_idstring 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). Accepts the SDK's visitorId key too, since the shared SDK helper that generates this value sends camelCase for every ingest endpoint.

Response

Event recorded successfully

Changes

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