---
title: "Changes to Create a retention rule"
method: POST
path: "/ocs/v2.php/apps/files_retention/api/v1/retentions"
---

# Changes to Create a retention rule

`POST /ocs/v2.php/apps/files_retention/api/v1/retentions`

> Every recorded change to this endpoint, newest first.

## Timeline

Changed in 3 of 4 revisions.

- **2025-12-20** `db5a22e1e7d3` — 3 info
- **2025-03-26** `e4e3f2a5e08a` — 2 breaking, 6 warning, 6 info
- **2025-03-26** `ae08f25fe8aa` — 7 breaking, 4 warning, 8 info

## Changes

- **2025-12-20** `db5a22e1e7d3` — 3 info
  - the request property `timeafter` became optional
  - added the non-success response with the status `401`
  - added the non-success response with the status `403`
- **2025-03-26** `e4e3f2a5e08a` — 2 breaking, 6 warning, 6 info
  - request property `timeafter` was restricted to a list of enum values
  - request property `timeunit` was restricted to a list of enum values
  - added the new `0.00` enum value to the `ocs/data/timeafter` response property for the response status `201`
  - added the new `0.00` enum value to the `ocs/data/timeunit` response property for the response status `201`
  - added the new `1.00` enum value to the `ocs/data/timeafter` response property for the response status `201`
  - added the new `1.00` enum value to the `ocs/data/timeunit` response property for the response status `201`
  - added the new `2.00` enum value to the `ocs/data/timeunit` response property for the response status `201`
  - added the new `3.00` enum value to the `ocs/data/timeunit` response property for the response status `201`
  - added the new `0.00` enum value to the request property `timeafter`
  - added the new `0.00` enum value to the request property `timeunit`
  - added the new `1.00` enum value to the request property `timeafter`
  - added the new `1.00` enum value to the request property `timeunit`
  - added the new `2.00` enum value to the request property `timeunit`
  - added the new `3.00` enum value to the request property `timeunit`
- **2025-03-26** `ae08f25fe8aa` — 7 breaking, 4 warning, 8 info
  - the request property `timeafter` became required
  - removed the enum value `0.00` of the request property `timeafter`
  - removed the enum value `0.00` of the request property `timeunit`
  - removed the enum value `1.00` of the request property `timeafter`
  - removed the enum value `1.00` of the request property `timeunit`
  - removed the enum value `2.00` of the request property `timeunit`
  - removed the enum value `3.00` of the request property `timeunit`
  - the `timeafter` request property's max was set to `1.00`
  - the `timeunit` request property's max was set to `3.00`
  - the `timeafter` request property's min was set to `0.00`
  - the `timeunit` request property's min was set to `0.00`
  - removed the non-success response with the status `401`
  - removed the non-success response with the status `403`
  - removed the `0.00` enum value from the `ocs/data/timeafter` response property for the response status `201`
  - removed the `0.00` enum value from the `ocs/data/timeunit` response property for the response status `201`
  - removed the `1.00` enum value from the `ocs/data/timeafter` response property for the response status `201`
  - removed the `1.00` enum value from the `ocs/data/timeunit` response property for the response status `201`
  - removed the `2.00` enum value from the `ocs/data/timeunit` response property for the response status `201`
  - removed the `3.00` enum value from the `ocs/data/timeunit` response property for the response status `201`

---

[Operation](https://skmtc.dev/nextcloud/apis/files-retention/docs/ocs/v2.php/apps/files_retention/api/v1/retentions/post.md) · [API](https://skmtc.dev/nextcloud/apis/files-retention.md) · [Page](https://skmtc.dev/nextcloud/apis/files-retention/changes/ocs/v2.php/apps/files_retention/api/v1/retentions/post)
