List RUM session segments

List the recorded segments of a RUM session's session replays in recording order, with their rrweb events, to export the recording. Needs a role with View sessions and replays under Applications. A session without a replay lists none.

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

URL parameters

application_id
required string
session_id
required string

Query parameters

from
datetime
to
datetime
page
integer
per_page
DEFAULT 10 integer
team_id
string

Headers

Authorization
required string

Results are paginated

Use pagination.next and pagination.prev to move through pages or jump to a specific one using page and per_page. See Pagination.

200

Response body

{
  "data": [
    {
      "id": "9bfc56e1c78844d1891123bf9051be7b:0",
      "type": "rum_session_segment",
      "attributes": {
        "replay_id": "9bfc56e1c78844d1891123bf9051be7b",
        "segment_id": 0,
        "at": "2026-11-23T17:00:14.957Z",
        "events": [
          {
            "type": 4,
            "timestamp": 1795483214957,
            "data": {
              "href": "https://shop.example.com/",
              "width": 1280,
              "height": 800
            }
          }
        ]
      }
    }
  ],
  "pagination": {
    "first": "https://errors.betterstack.com/api/v4/applications/123456/sessions/c682c012-26e6-40ce-bb45-5e6e7f5a8c0f/segments?page=1",
    "last": "https://errors.betterstack.com/api/v4/applications/123456/sessions/c682c012-26e6-40ce-bb45-5e6e7f5a8c0f/segments?page=1",
    "prev": null,
    "next": null,
    "total_count": 1
  }
}
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."
  }
}

Response attributes

id
string
type
string
replay_id
string
segment_id
integer
at
datetime or null
events
array of objects
pagination.first
string
pagination.last
string
pagination.prev
string or null
pagination.next
string or null
pagination.total_count
integer

Example cURL

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