Slack Archiver is a lightweight command-line tool that downloads the full conversation history for one or more workspace users. It handles public channels, private channels, direct messages, and group DMs — including thread replies and file attachments — and saves everything as organized JSON files you can search, back up, or process offline.
- Complete archives — messages, threads, and file attachments — not just channel lists
- Multi-user support — archive data for multiple users in a single run
- Rate-limit aware — built-in delays and automatic retries keep things smooth
- Zero config UI — just provide tokens and run
- Structured JSON output — easy to query, index, or feed into other tools
- Node.js v18 or later
- A Slack User OAuth Token with the required scopes (see Setup)
git clone https://github.com/dinosaurchi/slack-archiver.git
cd slack-archiver
npm install-
Go to api.slack.com/apps and create a new app.
-
Navigate to OAuth & Permissions and add the following User Token Scopes:
Scope Purpose conversations:readList channels and read message history conversations.membersCheck channel membership files:readRead and download file attachments -
Install the app in your workspace and copy the User OAuth Token (starts with
xoxp-).
Create .secrets/user-tokens.json in the project root:
[
{
"name": "Jane Doe",
"token": "xoxp-..."
},
{
"name": "John Smith",
"token": "xoxp-..."
}
]token— required. A Slack User OAuth Token.name— optional. Used for display and output directory naming.
Note:
.secrets/is already included in.gitignoreso tokens are never committed.
npm startOr with Make:
make archive-historyThe tool authenticates with each token, discovers all conversations the user belongs to, and downloads the full message history for each one.
Archived data is written to data/, organized by workspace and user:
data/
└── acme_corp-T12345678/
└── jane_doe-U87654321/
├── _summary.json
├── general-C10000001.json
├── engineering-private-C10000002.json
├── dm-D10000003.json
└── group-mpim-C10000004.json
File attachments are downloaded and stored alongside the conversation JSON:
data/
└── acme_corp-T12345678/
└── jane_doe-U87654321/
├── attachments/
│ ├── general-C10000001/
│ │ ├── F12345_screenshot.png
│ │ └── F12346_report.pdf
│ └── engineering-private-C10000002/
│ └── F12347_architecture.svg
├── _summary.json
└── general-C10000001.json
Each file is named <file_id>_<sanitized_filename> and stored in a folder per conversation. Downloaded attachment paths are recorded in the local_path field of each message's attachment metadata.
Each user directory contains a _summary.json:
{
"workspace_id": "T12345678",
"workspace_name": "Acme Corp",
"user_id": "U87654321",
"user_name": "Jane Doe",
"download_date": "2026-05-05T12:00:00.000Z",
"total_conversations": 42
}Each conversation is saved as a separate JSON file with the following structure:
| Field | Type | Description |
|---|---|---|
id |
string |
Channel or conversation ID |
name |
string | null |
Channel name (empty for DMs) |
type |
string |
public_channel, private_channel, dm, or mpim |
created |
number |
Unix timestamp of channel creation |
topic |
string | null |
Channel topic |
message_count |
number |
Total number of messages downloaded |
messages |
array |
Full message history with enriched threads, file metadata, and downloaded attachments |
Slack Archiver respects Slack's API rate limits:
- 1.5-second delay between consecutive API calls
- Automatic retry (up to 3 attempts) with exponential backoff on failure
retry_aftercompliance — pauses when Slack signals a rate limit- 0.5-second delay between consecutive file downloads
Contributions are welcome! To get started:
- Fork the repository
- Create a feature branch:
git checkout -b my-feature - Commit your changes:
git commit -m "Add my feature" - Push to the branch:
git push origin my-feature - Open a Pull Request
Please make sure your changes are consistent with the existing code style.
This project is licensed under the MIT License.