---
title: "Alter retention policy for a database"
method: PATCH
path: "/sources/{id}/dbs/{db}/rps/{rp}"
tags: ["retention policies"]
---

# Alter retention policy for a database

`PATCH /sources/{id}/dbs/{db}/rps/{rp}`

## Path parameters

- `id` string, required
- `db` string, required
- `rp` string, required

## Request body

- RetentionPolicy
  - `name` string, required — The identifying name of the retention policy
  - `duration` string, required — the duration of the retention policy
  - `replication` integer, required — how many copies of the data are stored in the cluster
  - `shardDuration` string — the interval spanned by each shard group
  - `default` boolean — Indicates whether this retention policy should be the default
  - `links` object
    - `self` string, url — Self link mapping to this resource

## Response `200`

Retention Policy was altered

- RetentionPolicy
  - `name` string, required — The identifying name of the retention policy
  - `duration` string, required — the duration of the retention policy
  - `replication` integer, required — how many copies of the data are stored in the cluster
  - `shardDuration` string — the interval spanned by each shard group
  - `default` boolean — Indicates whether this retention policy should be the default
  - `links` object
    - `self` string, url — Self link mapping to this resource

## Other responses

- `404` — Database or source does not exist.
- `default` — A processing or an unexpected error.

---

[API](https://skmtc.net/influxdata/apis/chronograf.md) · [All operations](https://skmtc.net/influxdata/apis/chronograf/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/influxdata/chronograf/revisions/ce55d963b4ac/schema)
