Your LinkedIn Outbound, Controlled by Agents.
Campaigns. Inbox. Leads. Lists. Network. 47 commands. Every one doubles as an MCP tool.
HeyReach automates LinkedIn outreach — but there’s no official CLI.
So we built heyreach-cli — the missing CLI for agents on HeyReach.


Why heyreach-cli Exists
Without heyreach-cli
- No official CLI — HeyReach only offers a REST API and dashboard UI
- Agents can’t manage LinkedIn campaigns or reply to inbox without custom wrappers
- Manual API auth per request — no token resolution strategy
- No MCP support — agents can’t call HeyReach as a native tool
- Campaign analytics and lead data locked in the dashboard
With heyreach-cli
- 47 commands covering the full HeyReach API surface
- Single API key, 3-tier resolution: flag → env var → config file
- Every command is also an MCP tool — plug into any AI agent
- JSON-first output — pipe to jq, save to files, feed to agents
- Unified inbox management — read, reply, and track across all LinkedIn accounts
When You Need This
Automated LinkedIn Outreach
Launch and manage multi-step LinkedIn campaigns — connection requests, messages, InMails, profile views — all from your agent.
Unified Inbox Management
Read and reply to LinkedIn conversations across all connected accounts without switching between dashboards or browsers.
Lead Enrichment & Tagging
Look up any lead by LinkedIn URL, tag them by status or segment, and track which campaigns and lists they belong to.
Campaign Analytics on Demand
Pull connection acceptance rates, reply rates, and message stats for any time period — data your agent can act on.
Real-Time Webhook Automation
Set up webhooks for 12 LinkedIn event types — replies, connection accepts, campaign completions — and trigger downstream workflows.
Multi-Account Sender Management
Rotate across multiple LinkedIn accounts within a single campaign. Check connection status and network intelligence before outreach.
Quick Start
1. Install
npm install -g heyreach-cli2. Get your API key
1. Log into your HeyReach workspace
2. Navigate to Settings → Integrations → Public API
3. Copy your API key
3. Authenticate
# Option A: environment variable (recommended for agents)
export HEYREACH_API_KEY="your-api-key"
# Option B: login command (saves to ~/.heyreach/config.json)
heyreach login
# Option C: per-command flag
heyreach campaigns list --api-key "your-api-key"4. Verify
heyreach status
# Validates your API key
heyreach campaigns list --pretty
# Returns your campaigns as formatted JSON
heyreach accounts list --pretty
# Lists your connected LinkedIn accountsWhat heyreach-cli Gives Your Agent
Campaigns
List, get, pause, resume campaigns. Add leads to active sequences, stop leads mid-campaign, and pull lead analytics with status breakdowns.
Unified Inbox
Browse conversations across all connected LinkedIn accounts. Read threads, send replies, mark as seen — one inbox for every sender.
Lists & Leads
Create lead and company lists, add/remove leads by URL or ID, search within lists, and manage the full lead lifecycle with tagging.
Webhooks & Events
Subscribe to 12 real-time LinkedIn event types — connection accepts, message replies, InMail replies, campaign completions, and more.
Network Intelligence
Query a sender’s LinkedIn network and check connection status with any lead. Know who’s connected before you reach out.
MCP Server
Every command is exposed as an MCP tool. Claude, Cursor, OpenClaw, and any MCP client can call all 47 commands natively.
Agent Workflows
Real prompts agents use to manage HeyReach LinkedIn outbound end-to-end.
Launch a LinkedIn Campaign with Leads
Agent Prompt
“Create a prospect list called "Q2 Enterprise", add these 3 LinkedIn profiles to it, then add them to campaign 12345 and resume it.”
Agent creates the list, imports leads by profile URL, adds them to the campaign, and kicks it live — full campaign launch in one autonomous flow.
heyreach lists create --name "Q2 Enterprise" --type USER_LISTCreate lead list
heyreach lists add-leads --list-id $LIST_ID --leads-json '[{"firstName":"Alex","lastName":"Chen","profileUrl":"https://linkedin.com/in/alexchen","companyName":"TechCo","position":"CTO"}]'Import leads with profile data
heyreach campaigns add-leads --campaign-id 12345 --leads-json '[{"lead":{"profileUrl":"https://linkedin.com/in/alexchen"}}]'Add leads to campaign
heyreach campaigns resume --campaign-id 12345Start the campaign
Morning Inbox Review
Agent Prompt
“Check for any unseen LinkedIn replies across all my accounts. Show me the new conversations and mark them as seen after I review.”
Agent pulls unseen conversations, reads full threads, and marks them seen — morning inbox zero without opening the dashboard.
heyreach inbox list --seen false --prettyGet all unseen conversations
heyreach inbox get --account-id $ACCT_ID --conversation-id $CONV_ID --prettyRead full conversation thread
heyreach inbox set-seen --conversation-id $CONV_ID --account-id $ACCT_ID --seen trueMark as seen
Reply to a Hot Lead
Agent Prompt
“A VP of Sales at Acme just replied to our connection request. Send them a follow-up message and tag them as "hot".”
Agent finds the conversation, sends a personalized reply, and tags the lead — follow-up plus CRM tagging in one shot.
heyreach inbox list --search "acme" --prettyFind the conversation
heyreach inbox send --conversation-id $CONV_ID --account-id $ACCT_ID --message "Thanks for connecting! Would love to explore how we can help Acme scale outbound."Send follow-up message
heyreach leads add-tags --profile-url "https://linkedin.com/in/vp-sales-acme" --tags "hot,enterprise" --create-if-missingTag lead as hot
Campaign Performance Review
Agent Prompt
“Pull analytics for all my active campaigns over the last 30 days. Show me connection acceptance rates and reply rates.”
Agent exports comprehensive stats with day-by-day breakdowns — profile views, messages sent, replies, acceptance rates — a full performance brief.
heyreach campaigns list --statuses IN_PROGRESS --prettyList active campaigns
heyreach stats overview --start-date "2026-02-11T00:00:00Z" --end-date "2026-03-11T23:59:59Z" --prettyPull 30-day analytics
heyreach campaigns get-leads --campaign-id $CAMPAIGN_ID --prettyCheck lead status breakdowns
Set Up Webhook Notifications
Agent Prompt
“Create webhooks for connection accepts and message replies so our n8n workflow gets notified in real-time when prospects engage.”
Agent creates webhook endpoints for key LinkedIn events — real-time automation infrastructure deployed in seconds.
heyreach webhooks create --name "Connection Accepts" --url "https://n8n.company.com/webhook/heyreach" --event-type CONNECTION_REQUEST_ACCEPTEDWebhook for connection accepts
heyreach webhooks create --name "Reply Notifications" --url "https://n8n.company.com/webhook/heyreach" --event-type MESSAGE_REPLY_RECEIVEDWebhook for message replies
heyreach webhooks list --prettyVerify webhooks are active
Check Connection Status Before Outreach
Agent Prompt
“Before I add these leads to a campaign, check which ones are already connected to our LinkedIn sender account.”
Agent checks network connection status for each lead — filtering out already-connected contacts before adding to an outreach sequence.
heyreach accounts list --prettyList sender accounts
heyreach network check --sender-account-id $SENDER_ID --lead-profile-url "https://linkedin.com/in/prospect1"Check connection status
heyreach network list --sender-id $SENDER_ID --prettyBrowse full sender network
Commands Reference
heyreach campaigns list [--keyword <text>] [--statuses <list>]List campaigns with optional filtersheyreach campaigns get --campaign-id <id>Get a single campaignheyreach campaigns resume --campaign-id <id>Resume a paused campaignheyreach campaigns pause --campaign-id <id>Pause an active campaignheyreach campaigns add-leads --campaign-id <id> --leads-json <json>Add leads to a campaignheyreach campaigns stop-lead --campaign-id <id> [--lead-url <url>]Stop a lead mid-sequenceheyreach campaigns get-leads --campaign-id <id> [--time-from <iso>]Pull lead analytics with status breakdownsheyreach campaigns get-for-lead [--profile-url <url>] [--email <e>]Find which campaigns a lead is inheyreach inbox list [--account-ids <list>] [--search <text>] [--seen <bool>]Browse conversations with filtersheyreach inbox get --account-id <id> --conversation-id <id>Read full conversation threadheyreach inbox send --conversation-id <id> --account-id <id> --message <text>Send a LinkedIn messageheyreach inbox set-seen --conversation-id <id> --account-id <id> --seen <bool>Mark conversation seen/unseenheyreach accounts list [--keyword <text>]List connected LinkedIn accountsheyreach accounts get --account-id <id>Get a single accountheyreach lists list [--keyword <text>] [--list-type <type>]List lead and company listsheyreach lists get --list-id <id>Get list detailsheyreach lists create --name <name> [--type USER_LIST|COMPANY_LIST]Create a new listheyreach lists get-leads --list-id <id> [--keyword <text>]Search leads within a listheyreach lists add-leads --list-id <id> --leads-json <json>Add leads to a listheyreach lists delete-leads --list-id <id> --member-ids <list>Remove leads by IDheyreach lists delete-leads-by-url --list-id <id> --urls <list>Remove leads by LinkedIn URLheyreach lists get-companies --list-id <id> [--keyword <text>]Query companies in a listheyreach lists get-for-lead [--profile-url <url>] [--email <e>]Find which lists a lead belongs toheyreach leads get --profile-url <url>Look up a lead by LinkedIn URLheyreach leads add-tags --tags <list> [--profile-url <url>]Add tags to a leadheyreach leads get-tags --profile-url <url>Get all tags on a leadheyreach leads replace-tags --tags <list> [--profile-url <url>]Replace all tags on a leadheyreach lead-tags create --tags-json <json>Create workspace-level tags with colorsheyreach stats overview --start-date <iso> --end-date <iso> [--campaign-ids <list>]Pull campaign analytics with day-by-day breakdownsheyreach webhooks listList all webhooksheyreach webhooks get --webhook-id <id>Get a single webhookheyreach webhooks create --name <name> --url <url> --event-type <type>Create webhook for LinkedIn eventsheyreach webhooks update --webhook-id <id> [--url] [--event-type] [--active]Update webhook configurationheyreach webhooks delete --webhook-id <id>Delete a webhookheyreach network list --sender-id <id> [--page <n>]Browse a sender's LinkedIn networkheyreach network check --sender-account-id <id> [--lead-profile-url <url>]Check connection status with a leadheyreach org workspaces [--offset <n>] [--limit <n>]List organization workspacesheyreach org create-workspace --name <name> [--seats-limit <n>]Create a new workspaceheyreach org update-workspace --workspace-id <id> [--name] [--seats-limit]Update workspace settingsheyreach org api-keys --workspace-id <id>List API keys for a workspaceheyreach org create-api-key --workspace-id <id> --type <type>Generate new API key (PUBLIC, N8N, MCP, etc.)heyreach org users [--role <role>]List organization usersheyreach org get-user --user-id <id>Get a single userheyreach org workspace-users --workspace-id <id>List users in a workspaceheyreach org invite-admins --inviter-email <e> --emails <list>Invite admin usersheyreach org invite-members --inviter-email <e> --emails <list> --workspace-ids <list>Invite members with permissionsheyreach org invite-managers --inviter-email <e> --emails <list> --workspace-ids <list>Invite manager usersMCP Server Setup
Every command is available as an MCP tool. Configure once and your agent has full HeyReach LinkedIn access.
{
"mcpServers": {
"heyreach": {
"command": "npx",
"args": ["heyreach-cli", "mcp"],
"env": {
"HEYREACH_API_KEY": "your-api-key"
}
}
}
}MCP tools registered (47 total):
OpenClaw Agent Setup
Give any OpenClaw agent full HeyReach LinkedIn access. Install once, set the API key, and the agent manages your outbound autonomously.
Architecture
Every API endpoint is a CommandDefinition — one source of truth powering both the CLI subcommand and the MCP tool.
src/ ├── core/ │ ├── types.ts # CommandDefinition, HeyReachClient interfaces │ ├── client.ts # HTTP client (X-API-KEY, retry, rate limit) │ ├── auth.ts # 3-tier API key resolution │ ├── config.ts # ~/.heyreach/config.json │ ├── errors.ts # Typed error classes │ ├── output.ts # JSON output + --fields filtering │ └── handler.ts # Request builder from CommandDefinition ├── commands/ │ ├── campaigns/ # 8 commands │ ├── inbox/ # 4 commands │ ├── accounts/ # 2 commands │ ├── lists/ # 9 commands │ ├── stats/ # 1 command │ ├── leads/ # 4 commands │ ├── lead-tags/ # 1 command │ ├── webhooks/ # 5 commands │ ├── network/ # 2 commands │ └── org/ # 11 commands ├── mcp-entry.ts # MCP server (auto-registers all commands) └── index.ts # CLI entry point
Same pattern as all TOFU CLIs
The CommandDefinition architecture is shared across instantly-cli, clay-gtm-cli, hubspot-cli, partnerstack-cli, and ms365-cli. One schema definition generates the Commander.js subcommand, the Zod schema, and the MCP tool — zero duplication.
HeyReach API Specifics
Uses X-API-KEY header auth (not Bearer). POST body pagination with offset/limit. 300 req/min rate limit with auto-retry. Separate Organization API for admin operations.
Ready to automate your LinkedIn outbound?
Install heyreach-cli, set your API key in 60 seconds, and your agent can manage campaigns, reply to conversations, and track leads across your entire LinkedIn operation.
Need agents running your LinkedIn outbound? We deploy and manage the full setup.