---
title: "Get a session"
method: GET
path: "/v1/sessions/{sessionId}"
tags: ["Sessions"]
---

# Get a session

`GET /v1/sessions/{sessionId}`

## Request

- Base URL: `https://api.ironfang.com/analytics`
- URL: `https://api.ironfang.com/analytics/v1/sessions/{sessionId}`
- Auth: one of:
  - HTTP bearer
  - HTTP bearer

One session with what its browser reported, its journey (every page in the order the visitor saw them, with how long they stayed) and its recordings, each page placed in the recording that saw it. Needs analytics.sessions.read.

## Response `200`

The session

- SessionDetail
  - `anonymised` boolean, required: Its IP address, user agent, visitor id, error messages and event properties were cleared at the recording retention.
  - `browser` string, nullable, required
  - `country` string, nullable, required
  - `counts` object, required
    - `console_errors` integer, required: console.error calls (SDK 0.7.0).
    - `custom` integer, required: Events the page tracked.
    - `dropped` integer, required: Pages and other events beyond the session's limits, counted and not kept.
    - `errors` integer, required: Uncaught errors and unhandled rejections.
    - `errors_not_kept` integer, required: Errors and console errors past the per-page or per-session limits, counted and not kept.
    - `events` integer, required: Every event, of every type.
    - `failed_requests` integer, required: Requests that failed: an error answer, no answer, a timeout or a resource that did not load.
    - `pages` integer, required
    - `replayable_pages` integer, required: Pages a recording that can still be played saw.
    - `request_sample_percent` integer, nullable, required: The smallest share of successful requests kept while the session was reported; null when none were sampled.
    - `requests` integer, required: Requests kept: every outcome before SDK 0.7.0 only failed or slow ones.
    - `requests_not_kept` integer, required: Requests past the per-page or per-session limits, counted and not kept.
    - `requests_sampled_out` integer, required: Successful requests sampling left out.
    - `tabs` integer, required
  - `device` 'desktop' | 'mobile' | 'tablet' | 'null', nullable, required
  - `duration_ms` integer, required: From the start to the last activity.
  - `end_reason` 'idle_timeout' | 'duration_cap' | 'null', nullable, required: idle_timeout, 30 minutes without the visitor doing anything; duration_cap, 12 hours from its start.
  - `ended_at` string, date-time, nullable, required
  - `entry_path` string, nullable, required
  - `exit_path` string, nullable, required
  - `expires_at` string, date-time, required
  - `id` string, uuid, required
  - `ip` string, nullable, required: Null once the session is anonymised.
  - `last_activity_at` string, date-time, required: The visitor's last activity in any tab.
  - `live` boolean, required: Active and heard from in the last 90 seconds.
  - `origin` string, required
  - `os` string, nullable, required
  - `recording` object, required
    - `available` integer, required: Recordings that can be played.
    - `live` boolean, required: The open recording was heard from in the last 90 seconds.
    - `open_recording_id` string, uuid, nullable, required: The recording still open, to watch live.
    - `status` 'none' | 'recording' | 'available' | 'partial' | 'expired' | 'deleted' | 'unavailable', required: none, no recording; recording, one is still open; available, every page can be replayed; partial, some can; expired, deleted or unavailable, recordings exist and none can be played.
    - `total` integer, required
  - `referrer` string, nullable, required: Origin and path only.
  - `site_id` string, uuid, required
  - `site_name` string, required
  - `source` 'sdk' | 'recording', required: sdk, reported page by page by the SDK (0.6.0 and later); recording, known only from its recordings (older SDKs, and visits recorded before sessions), so only recorded pages are in it.
  - `started_at` string, date-time, required
  - `state` 'active' | 'ended', required
  - `visitor_id` string, uuid, nullable, required: Null once the session is anonymised.
  - `clock_offset_ms` integer, required: The server's clock minus the browser's, measured when the session started; journey and timeline times include it.
  - `ip_source` 'cloudflare' | 'edge' | 'peer' | 'null', nullable, required
  - `language` string, nullable, required
  - `pages` JourneyPage[], required
    - `offset_ms` integer, nullable, required: Where in that recording's replay it happened, when it can be played.
    - `recording_id` string, uuid, nullable, required: The recording that saw this moment.
    - `replay` 'available' | 'recording' | 'expired' | 'deleted' | 'discarded' | 'unplayable' | 'not_recorded', required: Whether this moment can be watched: available; recording, in a recording still open; expired, deleted, discarded (too short or without interaction) or unplayable, a recording saw it and cannot be played; not_recorded, no recording covers it.
    - `at` string, date-time, required
    - `dwell` 'measured' | 'estimated' | 'open' | 'unknown', required: measured, the page reported its end; estimated, from the next page in the same tab; open, the visitor is still on it; unknown, neither.
    - `dwell_ms` integer, nullable, required
    - `ended_at` string, date-time, nullable, required
    - `id` string, uuid, required
    - `kind` 'load' | 'reload' | 'back_forward' | 'route' | 'resume' | 'recorded', required: How the page came to be: a document load, a reload, back or forward, an in-page navigation, a page reported again when the next session started, or a page known only from a recording.
    - `path` string, required
    - `query` string, nullable, required: The query parameters the site keeps.
    - `tab` integer, required: The tab, numbered from 1 in the order tabs first reported a page; 0 when unknown.
    - `visible_ms` integer, nullable, required: How long the tab was visible on the page, when known.
  - `pixel_ratio` number, nullable, required
  - `recordings` SessionRecording[], required
    - `created_at` string, date-time, required
    - `discarded` 'empty' | 'no_interaction' | 'too_short' | 'null', nullable, required: Why it was not kept.
    - `duration_ms` integer, required
    - `end_reason` 'finished' | 'idle_timeout' | 'duration_cap' | 'byte_cap' | 'site_disabled' | 'null', nullable, required
    - `ended_at` string, date-time, nullable, required
    - `entry_path` string, nullable, required
    - `expires_at` string, date-time, required
    - `from` string, date-time, nullable, required: When its first event happened.
    - `id` string, uuid, required
    - `live` boolean, required
    - `pages` integer, required: Pages of the journey it saw.
    - `playable` boolean, required
    - `state` 'pending' | 'recording' | 'ready' | 'partial' | 'unplayable', required
    - `status` 'available' | 'recording' | 'expired' | 'deleted' | 'discarded' | 'unplayable', required
    - `tab` integer, required: 0 when the recorder did not name its tab (before SDK 0.6.0).
    - `until` string, date-time, nullable, required: When its latest event happened.
  - `screen` Size, required
    - `height` integer, required
    - `width` integer, required
  - `sdk_version` string, nullable, required
  - `timezone` string, nullable, required
  - `user_agent` string, nullable, required
  - `viewport` Size, required
    - `height` integer, required
    - `width` integer, required

## Other responses

- `401`: No credential, an invalid one, an expired partner integration key, or a delegated token where none is accepted (`unauthorized`, `invalid_api_key`, `api_key_expired`, `delegated_not_allowed`).
- `403`: The credential lacks the permission or scope, names another organisation, or belongs to a partner integration that is not active (`forbidden`, `insufficient_scope`, `integration_inactive`).
- `404`: No such object in this organisation (`not_found`).

---

[API](https://skmtc.dev/ironfang/apis/ironfang-analytics-api.md) · [All operations](https://skmtc.dev/ironfang/apis/ironfang-analytics-api/llms.txt) · [OpenAPI document](https://skmtc.dev/ironfang/apis/ironfang-analytics-api/revisions/08197080c3d7?raw)
