Skip to main content
Use the Sessions API to retrieve stored result summaries after the browser handoff completes.
Sessions endpoints require a secret key and never return collect-time sealed handoff tokens. Each endpoint also requires a scope on the key: sessions:list, sessions:read, or sessions:update. See Authentication.

Endpoint summary

GET /v1/sessions

Returns one row per session with the latest decision summary. Requires a secret key with the sessions:list scope. The default scopes for a secret key don’t include sessions:list, so add it to keys that list sessions. Supported query parameters: Rows are ordered by the time of each session’s latest decision, newest first. A limit, verdict, or cursor value that isn’t valid returns 422 with request.validation_failed, and the offset parameter isn’t supported. See Pagination for how to page through results. search matches in one of two ways:
  • A value that starts with sid_, evt_, or vid_ matches a session ID, event ID, or visitor ID exactly, ignoring case. A 32-character hexadecimal value matches a legacy session ID or event ID exactly.
  • Any other value is a case-insensitive substring match against the session ID, event ID, visitor ID, client_user_id, page URL, user agent, and IP address.
Example response:
In each row, latest_decision carries these fields:

GET /v1/sessions/:sessionId

Requires a secret key with the sessions:read scope. A session that doesn’t exist, or that belongs to the other environment, returns 404 with request.not_found. Returns the full public investigation view for one session. The response is intentionally ordered so the most actionable fraud analysis appears first, followed by continuity context, then structured evidence and lower-level telemetry. Unlike GET /v1/sessions, which stays a compact summary surface with latest_decision, session detail uses the richer decision, highlights, signals_fired, and client_telemetry model shown below. Example response:
Response fields are grouped by purpose:
  • decision is the current session outcome in public, action-oriented terms. automation_status maps to automated, human, or uncertain, while decision_status tells you whether the current result is preliminary or final.
  • highlights is a curated explanation layer capped at five items, including both concerning and reassuring findings.
  • attribution, web_bot_auth, network, and runtime_integrity summarize the strongest fraud and classification context.
  • attribution.labels identifies what is behind the session. Each label has a kind (actor, provider, tool, product, organization, purpose, environment, trust, or evasion), a flat string value such as automation, ai-agent, or playwright, a display label, and a confidence from 0 to 100. attribution.behaviors describes how input reached the page, by channel. attribution is null when Foil has nothing to attribute.
  • Each runtime_integrity field is one of clean, notice, elevated, or high_risk.
  • visitor_fingerprint and connection_fingerprint provide continuity and transport identity context. visitor_fingerprint.resolution tells you how the session was linked to the visitor ID.
  • native_runtime_integrity, native_app, native_carrier, native_motion_print, device_identity, and install_id are null for browser sessions. Sessions from the iOS and Android SDKs can populate them, but each field is still null when Foil doesn’t have its data for the session, so check each one before you read it.
  • behavior is null unless behavior data is enabled for your organization and available for the session.
  • signals_fired is the structured machine-usable signal summary; highlights is the editorial explanation layer.
  • client_telemetry is curated lower-level client telemetry for investigations. It is not a verbatim raw probe dump.
signals_fired.signal and highlights.evidence.signal are friendly string slugs. They are response values, not an exhaustive documented enum registry.

PATCH /v1/sessions/:sessionId

Sets or clears client_user_id, the ID of the end user in your own database. This is customer-supplied linkage only: it does not affect scoring, visitor fingerprints, sealed tokens, or browser/native SDK behavior. Requires a secret key with the sessions:update scope.
Send null to clear it:
The body must include client_user_id. Foil applies these rules to its value: Errors are request.validation_failed responses with details.parameter_set set to session_update. A session that doesn’t exist, or that belongs to the other environment, returns 404. The response is the same session detail resource returned by GET /v1/sessions/:sessionId, with the updated client_user_id. The list endpoint returns client_user_id on each row, and its search parameter matches it.