Skip to content
Backup (and potentially delete) the content of a Slack channel (including files)
Branch: master
Clone or download

Latest commit

Fetching latest commit…
Cannot retrieve the latest commit at this time.


Type Name Latest commit message Commit time
Failed to load latest commit information.

slack-channel-backup Build Status

This tool allows you to backup (and potentially delete) the content of a Slack channel (including files).


You will need to provide your own SLACK_API_TOKEN token as a environment variable

$ ./ '#random' --where mybackup

You will end up with a folder named mybackup containing a conversation.txt file with all the history and a files folder with the uploaded files (which are properly tagged as such in the history).

The tool also allows to control a date range for the backup and to delete the backed up history:

$ ./ -h
usage: [-h] [--where WHERE] [--delete] [--from FROM] [--to TO] channel

Backup a slack channel (and potentially delete) the content of a Slack channel (including files)

positional arguments:
  channel        channel to backup (use # prefix for channels, @ prefix for DMs)

optional arguments:
  -h, --help     show this help message and exit
  --where WHERE  where to store the backup
  --delete       delete the backed up messages
  --from FROM    when to start backing/deleting up
  --to TO        when to stop backing/deleting up

Required permissions

You will need to create a Slack app with the following permissions:

  • Always: files:read, users:read
  • When using public channels: channels:history, channels:read
  • When using private channels: groups:history, groups:read
  • When using Direct Messages: im:history, im:read
  • When deleting messages: chat:write:user, files:write:user


This project is using the old Slack API for channels and direct messages instead of new conversations one (

You can’t perform that action at this time.