# Different intervals of deleting messages and files

**URL:** <https://forums.rocket.chat/t/different-intervals-of-deleting-messages-and-files/13697>\
**Category:** Community Support\
**Created:** [March 28, 2022, 1:40pm UTC](https://forums.rocket.chat/t/different-intervals-of-deleting-messages-and-files/13697 "2022-03-28T13:40:33Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![mmittermayer](https://avatars.discourse-cdn.com/v4/letter/m/f4b2a3/32.png) [@mmittermayer](https://forums.rocket.chat/u/mmittermayer)\
**Post date:** [March 28, 2022, 1:40pm UTC](https://forums.rocket.chat/t/different-intervals-of-deleting-messages-and-files/13697/1 "2022-03-28T13:40:33Z")

</div>

Hello.

We are currently using Rocket.Chat ver. 3.18.3.

Right now it’s activated to only remove files in the global retention policy.  
We want to change it, to delete Files and messages at different intervals.  
But when we deactivate “only delete files” there is the same interval we set above for messages and files.

Is there any way to configure it, that all messages get deleted after 7years and all files just after 7days?

Thanks.

---

<div class="post-metadata">

**Author:** ![dudanogueira](https://sea1.discourse-cdn.com/flex021/user_avatar/forums.rocket.chat/dudanogueira/32/2529_2.png) [@dudanogueira](https://forums.rocket.chat/u/dudanogueira)\
**Post date:** [March 28, 2022, 5:15pm UTC](https://forums.rocket.chat/t/different-intervals-of-deleting-messages-and-files/13697/2 "2022-03-28T17:15:56Z")

</div>

Hi! Welcome to our forums.

This is not possible as of now.

Please, feel free to create a feature request:

> **[Issues · RocketChat/feature-requests](https://github.com/RocketChat/feature-requests/issues)**
>
> This repository is used to track Rocket.Chat feature requests and discussions. Click here to open a new feature request. - Issues · RocketChat/feature-requests

Thanks!

---

<div class="post-metadata">

**Author:** ![dudanogueira](https://sea1.discourse-cdn.com/flex021/user_avatar/forums.rocket.chat/dudanogueira/32/2529_2.png) [@dudanogueira](https://forums.rocket.chat/u/dudanogueira)\
**Post date:** [March 28, 2022, 5:16pm UTC](https://forums.rocket.chat/t/different-intervals-of-deleting-messages-and-files/13697/3 "2022-03-28T17:16:29Z")

</div>

Ps: you can probably accomplish this with some scripting.

---

<div class="post-metadata">

**Author:** ![mmittermayer](https://avatars.discourse-cdn.com/v4/letter/m/f4b2a3/32.png) [@mmittermayer](https://forums.rocket.chat/u/mmittermayer)\
**Post date:** [March 29, 2022, 7:16am UTC](https://forums.rocket.chat/t/different-intervals-of-deleting-messages-and-files/13697/4 "2022-03-29T07:16:15Z")

</div>

Thanks for your answer.  
I’ve never done something like this with rocket.chat.  
Where exactly can I change the important code to this? In the Web Admin Panel I can’t find anything related.

Thanks!

---

<div class="post-metadata">

**Author:** ![dudanogueira](https://sea1.discourse-cdn.com/flex021/user_avatar/forums.rocket.chat/dudanogueira/32/2529_2.png) [@dudanogueira](https://forums.rocket.chat/u/dudanogueira)\
**Post date:** [March 29, 2022, 12:03pm UTC](https://forums.rocket.chat/t/different-intervals-of-deleting-messages-and-files/13697/5 "2022-03-29T12:03:27Z")

</div>

Hi!

You should always avoid changing Rocket.Chat’s code directly.

It was built to allow customization via the Apps Engine, or remote management thru APIs.

this is **probably** something you can do with APIs. You can read thru docs here:

> **[REST API](https://developer.rocket.chat/reference/api/rest-api)**
