https://github.com/rollecode/pipedrive-email-archiver
Pipedrive doesn't offer batch archiving of emails through the UI, but you can archive them using the API with this tool.
https://github.com/rollecode/pipedrive-email-archiver
archiver email pipedrive pipedrive-api
Last synced: 27 days ago
JSON representation
Pipedrive doesn't offer batch archiving of emails through the UI, but you can archive them using the API with this tool.
- Host: GitHub
- URL: https://github.com/rollecode/pipedrive-email-archiver
- Owner: rollecode
- Created: 2025-08-25T14:14:10.000Z (9 months ago)
- Default Branch: master
- Last Pushed: 2025-08-28T11:38:50.000Z (9 months ago)
- Last Synced: 2026-05-02T13:33:31.527Z (28 days ago)
- Topics: archiver, email, pipedrive, pipedrive-api
- Language: JavaScript
- Homepage:
- Size: 11.7 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# ✉️ Pipedrive email archiver
A Node.js tool to bulk archive emails in Pipedrive via their API, since the UI doesn't provide a batch archive feature.

## Features
- Fetches all email threads from your Pipedrive inbox or sent folder
- Bulk archives unarchived emails
- Support for archiving both inbox and sent emails
- Dry-run mode to preview what will be archived
- Interactive confirmation before archiving
- Progress tracking and statistics
- Colorful CLI output with clear status indicators
## Prerequisites
- Node.js 18+ installed
- Pipedrive account with API access
- API token from Pipedrive
## Installation
1. Clone or download this repository
2. Install dependencies:
```bash
npm install
```
3. Copy `.env.example` to `.env`:
```bash
cp .env.example .env
```
4. Edit `.env` and add your Pipedrive API token:
```ini
PIPEDRIVE_API_TOKEN=your_api_token_here
PIPEDRIVE_DOMAIN=yourcompany.pipedrive.com
```
To get your API token:
- Log in to Pipedrive
- Go to Settings → Personal preferences → API
- Copy your personal API token
## Usage
### Interactive mode (Default)
```bash
npm start
```
This will:
1. Fetch all email threads from your inbox
2. Show you a summary of archived/unarchived emails
3. Ask for confirmation before archiving
4. Archive all unarchived emails
### Archive sent emails
```bash
npm start -- --sent
```
Archives sent emails instead of inbox emails.
### Dry run mode
Preview what will be archived without making changes:
```bash
npm run dry-run
# or
npm start -- --dry-run
```
### Skip confirmation
Archive without the confirmation prompt:
```bash
npm start -- --yes
# or
npm start -- -y
```
### Combine options
You can combine different options:
```bash
# Dry run for sent emails
npm start -- --sent --dry-run
# Archive sent emails without confirmation
npm start -- --sent --yes
```
### Help
```bash
npm start -- --help
```
## How it works
The tool uses Pipedrive's Mail Threads API to:
1. Fetch all email threads from your inbox using pagination
2. Filter out already archived threads
3. Archive each unarchived thread individually
4. Provide real-time progress updates
## API endpoints used
- `GET /mailbox/mailThreads` - Fetch email threads
- `PUT /mailbox/mailThreads/{id}` - Archive individual threads
## Rate limiting
The tool includes a 100ms delay between archive operations to avoid hitting API rate limits.
## Troubleshooting
### "PIPEDRIVE_API_TOKEN not found"
Make sure you've created a `.env` file with your API token.
### "Failed to fetch email threads"
- Verify your API token is correct
- Check if your Pipedrive domain is set correctly in `.env`
- Ensure you have the necessary permissions in Pipedrive