# Retention profile (/api-v2/retention-profile)



A retention profile controls how much of a request Zumik keeps. The default across the platform is metadata-only: raw inputs are not retained. Opt into richer fidelity when you need input items for replay or compaction. Profile ids are prefixed `rtp_`. See [retention and purge](/concepts/retention-and-purge).

All requests require a bearer API key. See [authentication](/api-reference/authentication).

## Set the profile [#set-the-profile]

`POST /v2/retention-profile`

Installs (or replaces) the project's retention profile.

<ParamField body="trace_mode" type="string">
  How much of each request to retain: `metadata` (default behavior, no raw text), `tokenized`, or `encrypted_full_fidelity`.
</ParamField>

<ParamField body="default_retention_days" type="integer" default="30">
  How long retained data is kept, in days.
</ParamField>

<ParamField body="cache_retention" type="string" default="provider_default">
  The cache-retention policy.
</ParamField>

```bash
curl https://api.zumik.ai/v2/retention-profile \
  -H "Authorization: Bearer $ZUMIK_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "trace_mode": "encrypted_full_fidelity",
    "default_retention_days": 30,
    "cache_retention": "provider_default"
  }'
```

```json
{
  "id": "rtp_01jy7nqr90t2u3v4w5x6y7z8a1",
  "object": "retention_profile",
  "project_id": "prj_01jy7n0a4c8m2t6v9q3wrxk7bd",
  "trace_mode": "encrypted_full_fidelity",
  "default_retention_days": 30,
  "cache_retention": "provider_default",
  "updated_at": "2026-06-15T16:38:55Z"
}
```

<ResponseField name="id" type="string">
  Opaque profile id, prefixed `rtp_`.
</ResponseField>

<ResponseField name="object" type="string">
  Always `retention_profile`.
</ResponseField>

<ResponseField name="project_id" type="string">
  The owning project.
</ResponseField>

<ResponseField name="trace_mode" type="string">
  The retention fidelity.
</ResponseField>

<ResponseField name="default_retention_days" type="integer">
  Retention period in days.
</ResponseField>

<ResponseField name="cache_retention" type="string">
  The cache-retention policy.
</ResponseField>

<ResponseField name="updated_at" type="string">
  RFC 3339 update timestamp.
</ResponseField>

## Read the profile [#read-the-profile]

`GET /v2/retention-profile`

```bash
curl https://api.zumik.ai/v2/retention-profile \
  -H "Authorization: Bearer $ZUMIK_API_KEY"
```

Returns the profile object, or `404` when none is configured (the metadata-only default still applies).

## Errors [#errors]

| Status | Code                    | When                                                 |
| ------ | ----------------------- | ---------------------------------------------------- |
| 401    | `invalid_api_key`       | Missing or invalid API key.                          |
| 404    | `invalid_request_error` | No retention profile is configured for this project. |

See the full table on [errors](/api-reference/errors).
