Get a RUM session

Get one RUM session with its session replays and a timeline of its page views, clicks, errors and traces.

GET https://errors.betterstack.com/api/v4/applications/{application_id}/sessions/{id}

URL parameters

application_id
required string
id
required string

Query parameters

from
datetime
to
datetime
team_id
string

Headers

Authorization
required string
200

Response body

{
  "data": {
    "id": "c682c012-26e6-40ce-bb45-5e6e7f5a8c0f",
    "type": "rum_session",
    "attributes": {
      "application_id": "123456",
      "user_identifier": "user_123",
      "user_name": "jane@example.com",
      "group_id": "456",
      "group_name": "Acme Inc.",
      "country": "Czechia",
      "city": "Prague",
      "browser": "Chrome",
      "os": "macOS",
      "user_agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36",
      "first_url": "https://shop.example.com/",
      "last_url": "https://shop.example.com/checkout",
      "page_count": 4,
      "click_count": 12,
      "error_count": 1,
      "replay_count": 1,
      "first_seen_at": "2026-11-23T17:00:12.000Z",
      "last_seen_at": "2026-11-23T17:05:40.000Z",
      "duration_seconds": 328.0,
      "state": "unresolved",
      "url": "https://rum.betterstack.com/team/t12345/sessions/c682c012-26e6-40ce-bb45-5e6e7f5a8c0f?rf=1795483200000000&rt=1795483528000000&s=123456",
      "replays": [
        {
          "id": "9bfc56e1c78844d1891123bf9051be7b",
          "first_seen_at": "2026-11-23T17:00:14.000Z",
          "last_seen_at": "2026-11-23T17:05:38.000Z"
        }
      ],
      "timeline": [
        {
          "at": "2026-11-23T17:00:12.000Z",
          "type": "page_view",
          "name": "page-load",
          "url": "https://shop.example.com/"
        },
        {
          "at": "2026-11-23T17:00:20.000Z",
          "type": "click",
          "name": "click",
          "url": "https://shop.example.com/",
          "target": "button#buy"
        },
        {
          "at": "2026-11-23T17:00:21.000Z",
          "type": "error",
          "name": "TypeError",
          "message": "Cannot read properties of undefined",
          "error_id": "6f1c2b9a8e4d7f3012ab45cd"
        }
      ],
      "timeline_truncated": false
    }
  }
}
401

Response body

{
  "errors": "Invalid Team API token. How to find your Team API token: https://betterstack.com/docs/logs/api/getting-started/#obtaining-a-logtail-api-token"
}
403
404

Response body

{
  "errors": "Resource with the provided ID was not found"
}
422

Response body

{
  "errors": "Sorry, some values are incorrect",
  "invalid_values": {
    "to": "to must be after from."
  }
}
422

Response body

{
  "errors": "The query couldn't finish: Query failed: no answer within the 50 seconds the query had, so the request stopped waiting for it"
}

Response attributes

id
string
type
string
application_id
string
user_identifier
string or null
user_name
string or null
group_id
string or null
group_name
string or null
country
string or null
city
string or null
browser
string or null
os
string or null
user_agent
string or null
first_url
string or null
last_url
string or null
page_count
integer
click_count
integer
error_count
integer
replay_count
integer
first_seen_at
datetime or null
last_seen_at
datetime or null
duration_seconds
number or null
state
string
url
string
replays
array of objects
replays[].id
string
replays[].first_seen_at
datetime
replays[].last_seen_at
datetime
timeline
array of objects
timeline[].at
datetime
timeline[].type
string
timeline[].name
string
timeline[].url
string
timeline[].target
string
timeline[].error_id
string
timeline[].message
string
timeline[].trace_id
string
timeline[].span_count
integer
timeline[].duration_ms
number
timeline_truncated
boolean

Example cURL

Get a session
curl --request GET \
  --url https://errors.betterstack.com/api/v4/applications/123456/sessions/c682c012-26e6-40ce-bb45-5e6e7f5a8c0f \
  --header "Authorization: Bearer $TOKEN"