---
title: "Delete a retention rule"
method: DELETE
path: "/ocs/v2.php/apps/files_retention/api/v1/retentions/{id}"
tags: ["api"]
---

# Delete a retention rule

`DELETE /ocs/v2.php/apps/files_retention/api/v1/retentions/{id}`

This endpoint requires admin access

## Path parameters

- `id` integer, required

## Headers

- `OCS-APIRequest` boolean, required

## Response `204`

Retention rule deleted

## Other responses

- `401` — Current user is not logged in
- `403` — Logged in account must be an admin
- `404` — Retention rule not found

## Changes

- **2025-12-20** `db5a22e1e7d3` — 2 info
  - added the non-success response with the status `401`
  - added the non-success response with the status `403`
- **2025-03-26** `ae08f25fe8aa` — 2 info
  - removed the non-success response with the status `401`
  - removed the non-success response with the status `403`

[Change history](https://skmtc.dev/nextcloud/apis/files-retention/changes/ocs/v2.php/apps/files_retention/api/v1/retentions/:id/delete.md)

---

[API](https://skmtc.dev/nextcloud/apis/files-retention.md) · [All operations](https://skmtc.dev/nextcloud/apis/files-retention/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/nextcloud/files-retention/revisions/cc97a071cea0/schema)
