---
title: "Estimate recoverable sessions"
method: POST
path: "/api/v2/rum/recover/count"
tags: ["RUM Recovery"]
---

# Estimate recoverable sessions

`POST /api/v2/rum/recover/count`

## Request

- Base URL: `https://api.datadoghq.com`
- URL: `https://api.datadoghq.com/api/v2/rum/recover/count`
- 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/count/post.ts> (a function with typed inputs; its response is checked against the schema)

Return the full estimated number of recoverable sessions and the configured maximum per batch. The estimate is not capped at that maximum. This endpoint does not create a recovery request. Narrow the query or time range if the estimate exceeds max_recoverable_sessions. Creation checks a fresh estimate and returns 400 if it exceeds the configured maximum.

## Request body

- RumRecoveryCountRequest: JSON:API document.
  - `data` RumRecoveryCountRequestData, required: JSON:API resource.
    - `attributes` RumRecoveryCountAttributes, required: Query for a recovery estimate. The range cannot exceed 180 days; from cannot be more than 4 years ago and to cannot be more than 1 hour in the future. Session availability depends on the configured archive retention.
      - `from` integer, required: Start of the range in Unix milliseconds. Must be positive and earlier than to.
      - `query` string, required: RUM search query. Not blank, at most 4096 bytes for batch creation and count.
      - `to` integer, required: End of the range in Unix milliseconds.
    - `id` string: Optional resource identifier.
    - `type` string: JSON:API resource type.

## Response `200`

OK

- RumRecoveryCountResponse: JSON:API document.
  - `data` RumRecoveryCountResponseData, required: JSON:API resource.
    - `attributes` RumRecoveryCountResponseAttributes, required: Approximate recoverable count.
      - `estimated_count` integer, required: Estimated distinct recoverable sessions not already retained in hot storage. The full estimate is returned without capping it at max_recoverable_sessions.
      - `max_recoverable_sessions` integer, required: Configured maximum estimated recoverable sessions per batch (100,000 by default). Estimates equal to this value are accepted at creation.
    - `id` string, required: Resource identifier.
    - `type` 'rum_recovery_count', required: JSON:API resource type.

## Other responses

- `400`: Bad Request
- `401`: Unauthorized
- `403`: Forbidden
- `404`: Not Found
- `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)
