---
title: "Search archived sessions"
method: POST
path: "/api/v2/rum/recover/sessions"
tags: ["RUM Recovery"]
---

# Search archived sessions

`POST /api/v2/rum/recover/sessions`

## Request

- Base URL: `https://api.datadoghq.com`
- URL: `https://api.datadoghq.com/api/v2/rum/recover/sessions`
- Auth: API key in header `DD-API-KEY` and API key in header `DD-APPLICATION-KEY`
- TypeScript: <https://skmtc.dev/datadog/apis/datadog-api-v2-collection/docs/api/v2/rum/recover/sessions/post.ts> (a function with typed inputs; its response is checked against the schema)

Search archived RUM sessions. Use `meta.page.next_cursor` to retrieve the next page.

## Request body

- RumArchiveSessionsSearchRequest: JSON:API document.
  - `data` RumArchiveSessionsSearchData, required: JSON:API resource.
    - `attributes` RumArchiveSessionsSearchAttributes, required: Archived-session query. A window wider than configured archive retention is narrowed before searching.
      - `cursor` string: Opaque next-page cursor. Keep the query, time range, and hide_retained value unchanged.
      - `from` integer, required: Start of the range in Unix milliseconds. Must be positive and earlier than to.
      - `hide_retained` boolean: When true, exclude sessions already present in hot RUM storage. When false, those sessions can appear in the results. Keep this value unchanged when continuing with a cursor.
      - `limit` integer: Page size, at most 1000 (default 50). Values at or below zero use 50.
      - `query` string, required: RUM search query. Must not be empty.
      - `to` integer, required: End of the range in Unix milliseconds.
    - `id` string: Optional resource identifier.
    - `type` string: JSON:API resource type.

## Response `200`

OK

- RumArchiveSessionsResponse: JSON:API document.
  - `data` RumArchiveSession[], required: Archived sessions.
    - `attributes` RumArchiveSessionAttributes, required: Archived session metadata.
      - `account_id` string, nullable, required: Session account id, or null when unavailable.
      - `anonymous_id` string, nullable, required: Session anonymous id, or null when unavailable.
      - `application_id` string, uuid, required: Application UUID.
      - `country` string, nullable, required: Session country, or null when unavailable.
      - `recovery_status` RumArchiveSessionRecoveryStatus, nullable, required: Session recovery state. A missing recovery record can be represented as null. Optional request_id and recovered_at are omitted when unavailable.
        - `recovered_at` string, date-time: Recovery timestamp, when available.
        - `request_id` string: Associated recovery request ID.
        - `status` 'AVAILABLE' | 'PENDING' | 'PROCESSING' | 'RECOVERED' | 'FAILED' | 'RETAINED' | 'EXPIRED' | 'CANCELLED', required: Session availability or recovery state. `RECOVERED` indicates that the session is ready to query.
      - `service` string, required: Service name.
      - `session_id` string, required: Session identifier.
      - `timestamp` integer, required: Session timestamp in Unix milliseconds.
      - `user_id` string, nullable, required: Session user id, or null when unavailable.
      - `version` string, nullable, required: Session version, or null when unavailable.
    - `id` string, required: Resource identifier.
    - `type` 'rum_archive_session', required: JSON:API resource type.
  - `meta` RumArchiveSessionsMeta, required: Search metadata.
    - `page` RumArchiveSessionsPage, required: Search pagination.
      - `next_cursor` string: Opaque continuation cursor. Omitted when no further page is available.
      - `total_count` integer, required: Search result count. Can be zero on continuation pages even when sessions are returned. Use `next_cursor` to determine whether more pages are available.

## Other responses

- `400`: Bad Request
- `401`: Unauthorized
- `403`: Forbidden
- `429`: Too Many Requests

---

[API](https://skmtc.dev/datadog/apis/datadog-api-v2-collection.md) - [All operations](https://skmtc.dev/datadog/apis/datadog-api-v2-collection/llms.txt) - [OpenAPI document](https://skmtc.dev/datadog/apis/datadog-api-v2-collection/revisions/3f70db624329?raw)
