We're Hiring!

Mattermost, Inc.

Archiving vs Delete

Hi team, I am confused on difference between archiving and delete (team and channel) as both looks very similar in effect. Can someone explain the difference? Forgive me if this has been talked already somewhere.

What I can see is,

  1. If I delete team/channel via API, I will still be able to search the team or channel, I will still get the team as exists, it is just when I get the team/channel the delete_at timestamp will be set.
  2. If I archive team via CLI, I will no longer see the team at all. I will not be able to query via API at all.
  3. If I archive channel via CLI, I still be able to get the channel via API, though I no longer see the channel in UI. However the channel in API still have “delete_at” field set as 0. I do not see any marker indicating the particular channel is archived if directly querying the channel itself

Both looks like soft delete with slightly different behavior, correct me if I am wrong. I also do not know where the archived team stored/marked. Is it in database somewhere? How can you see this via API or we can only export via CLI?

Hello! Deleting a channel will remove it, and all messages, from your database and therefore from your system, in an irrecoverable form. Archiving, however, hides a channel from the UI and keeps the messages and content within it, it is just unviewable to most non-administrator members, unless you change the settings of your instance to allow so.

Does this help answer your question?

1 Like

That is where my confusion, when I delete team/channel via API I still get the team via API (with delete_at field set) and I can still restore (via API) as admin.

However when I archive team via CLI, I can not get the team via API as admin.
When I archive channel via CLI, I can get the channel via API as admin, however delete_at is not set.

On delete team via CLI, yes it will delete into irrecoverable form. But my question is related to soft delete via API and archive command, both are recoverable, but the ability to query it in API are different

I have a feeling that this has something to do with the API not querying the database which stores the contents of the channels, the records of the channels themselves, etc, as a form of risk prevention. My thought process is along the lines of the CLI tool being allowed to query the database, as it is implied that you are supposed to be accessing the system if you are able to access the machine running the instance to use the CLI. However, for security’s sake, I would not be surprised if the API didn’t delete the information (channels, messages, etc) entirely to prevent abuse if that makes any sense. I’ll look into it and see if I can find any documentation on it.