---
title: "Set the data retention policy"
method: PUT
path: "/experimental/flow/folder/data_retention_policy"
tags: ["Data Retention"]
---

# Set the data retention policy

`PUT /experimental/flow/folder/data_retention_policy`

## Request

- Base URL: `https://scrive.com`
- URL: `https://scrive.com/experimental/flow/folder/data_retention_policy`
- Auth: one of:
  - HTTP oauth1
  - OAuth 2
    - Authorization code: `/oauth2/auth`
    - Token URL: `/oauth2/token` scopes: `full`
  - API key in cookie `sessionId` and API key in header `X-Scrive-XToken`
- TypeScript: <https://skmtc.dev/scrive/apis/scrive-flow-api/docs/experimental/flow/folder/data_retention_policy/put.ts> (a function with typed inputs; its response is checked against the schema)

Sets the data retention policy of the caller's home folder. Subfolders inherit retention policies except if they have one already set.

## Request body

- FlowDataRetentionPolicy
  - `delete_trashed` integer: Number of days before deleting a trashed Flow instance.
  - `trash_completed` integer: Number of days before trashing a completed Flow instance.
  - `trash_failed` integer: Number of days before trashing a failed, rejected, or canceled Flow instance.
  - `trash_timed_out` integer: Number of days before trashing a timed out Flow instance.

## Response `204`

## Other responses

- `400`: Invalid `body`

---

[API](https://skmtc.dev/scrive/apis/scrive-flow-api.md) - [All operations](https://skmtc.dev/scrive/apis/scrive-flow-api/llms.txt) - [OpenAPI document](https://skmtc.dev/scrive/apis/scrive-flow-api/revisions/f9b2836863f2?raw)
