---
title: "Update data retention policy"
url: https://hexelstudio.com/docs/api/ciam-iam/retention/update
---

# Update data retention policy

**PATCH** `/audit/retention/{policy_id}`

## Path parameters

- `policy_id: string`

  Policy ID

## Headers

- `Authorization: string`

  `Bearer <token>`.

## Body parameters

- `archive_enabled: optional boolean`

- `archive_target: optional string`

- `is_enabled: optional boolean`

- `retention_days: optional integer`

## Returns

`200` OK (`map[string]`)

## Errors

- `404` Not Found

## Example

```bash
curl --request PATCH \
  --url 'https://api.hexelstudio.com/v1/audit/retention/{policy_id}' \
  --header "Authorization: Bearer $ACCESS_TOKEN" \
  --header 'Content-Type: application/json' \
  --data '{
  "archive_enabled": true,
  "archive_target": "string",
  "is_enabled": true,
  "retention_days": 0
}'
```

### Response (200)

```json
{
  "key": "string"
}
```

### Response (404)

```json
{
  "key": "string"
}
```
