---
title: "Create or update an archive configuration"
method: PUT
path: "/api/v2/rum/config/archive/{app_id}"
tags: ["RUM Managed Archives"]
---

# Create or update an archive configuration

`PUT /api/v2/rum/config/archive/{app_id}`

## Request

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

Create or update the archive configuration for a RUM application. The application ID in the path must match `data.id`. Disabling archiving does not delete archived sessions.

## Path parameters

- `app_id` string, uuid, required: Application UUID.

## Request body

- RumArchiveConfigUpsertRequest: JSON:API document.
  - `data` RumArchiveConfigUpsertData, required: JSON:API resource.
    - `attributes` RumArchiveConfigUpsertAttributes, required: Archive configuration to save. When enabled is true, retention_days is required and must be 30, 90, or 180. When disabled, retention_days can be omitted.
      - `enabled` boolean, required: Whether archiving is enabled.
      - `retention_days` integer: Retention in days. When enabled is true, required and restricted to 30, 90, or 180. When enabled is false, this field can be omitted.
    - `id` string, required: Resource identifier.
    - `type` 'rum_archive_config', required: JSON:API resource type.

## Response `200`

OK

- RumArchiveConfigResponse: JSON:API document.
  - `data` RumArchiveConfig, required: JSON:API resource.
    - `attributes` RumArchiveConfigAttributes, required: Archive configuration.
      - `enabled` boolean, required: Whether archiving is enabled.
      - `org_id` integer, required: Organization ID.
      - `retention_days` integer: Configured retention in days; omitted when unset. When archiving is enabled, this is 30, 90, or 180.
      - `updated_at` string, date-time: Last update time.
      - `updated_by` string: Handle of the user who last updated the configuration.
    - `id` string, required: Resource identifier.
    - `type` 'rum_archive_config', 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)
