> ## Documentation Index
> Fetch the complete documentation index at: https://docs.molesignal.com/llms.txt
> Use this file to discover all available pages before exploring further.

# 编辑保留策略

> 设置流数据的保留时长。

```http theme={null}
PUT /api/v1/streams/{id}/settings
```

<RequestExample>
  ```bash cURL theme={null}
  curl -X PUT http://localhost:5080/api/v1/streams/$STREAM_ID/settings \
    -H "authorization: Bearer $MS_JWT" \
    -H 'content-type: application/json' \
    -d '{"retention_days": 30}'
  ```
</RequestExample>

把 `retention_days` 设为 `null` 可恢复继承部署默认值；显式值必须在 1 到 3650 天之间。该操作需要
`streams.configure`。
