heyreach-master
HeyReach Master (Internal)
Internal resource library containing:
- API client (
heyreach_client.py) - Config checker (
check_heyreach_config.py) - All operation scripts
- Reference documentation
Architecture: DRY Principle
Problem solved: HeyReach skills would have duplicated content (setup instructions, API docs, auth flow, error handling).
Solution: Extract shared content into heyreach-master/references/ and heyreach-master/scripts/, then reference from each skill.
Result: Single source of truth, reduced context per skill.
Shared Resources
All HeyReach skills reference these resources (progressive disclosure).
references/
setup-guide.md - Complete setup wizard
- Getting API key from HeyReach
- Environment configuration
- Verifying connection
api-reference.md - HeyReach API patterns
- Base URL and authentication
- All endpoints documented
- Request/response examples
- Pagination patterns
error-handling.md - Troubleshooting
- Common errors and solutions
- HTTP error codes
- Rate limiting
- Debug tips
scripts/
Authentication & Configuration
check_heyreach_config.py - Pre-flight validation
python check_heyreach_config.py [--json]
| Argument | Required | Default | Description |
|---|---|---|---|
--json |
No | False | Output structured JSON for AI consumption |
Exit codes: 0=configured, 1=partial, 2=not configured
When to Use: Run this FIRST before any HeyReach operation. Use to validate API key is configured, diagnose authentication issues, or check if setup is needed.
heyreach_client.py - Shared API client
from heyreach_client import get_client, HeyReachError
client = get_client()
result = client.post("/v2/campaigns/All", {"offset": 0, "limit": 100})
Features:
- Automatic retry with exponential backoff
- Rate limit handling (300 req/min)
- Consistent error responses
- API key management from .env
Intelligent Error Detection Flow
When a HeyReach skill fails due to missing configuration, the AI should:
Step 1: Run Config Check with JSON Output
python 00-system/skills/heyreach/heyreach-master/scripts/check_heyreach_config.py --json
Step 2: Parse the ai_action Field
| ai_action | What to Do |
|---|---|
proceed_with_operation |
Config OK, continue with the original operation |
prompt_for_api_key |
Ask user: "I need your HeyReach API key from Settings → API" |
create_env_file |
Create .env file and ask user for credentials |
verify_api_key |
Key exists but connection failed - verify it's correct |
retry_later |
API timeout - try again |
check_network |
Connection error - verify network |
Step 3: Help User Fix Issues
If ai_action is prompt_for_api_key:
- Tell user: "HeyReach integration needs setup. I need your API key."
- Show them: "Get it from HeyReach: Settings → API"
- Ask: "Paste your HeyReach API key:"
- Once they provide it, write directly to
.env:HEYREACH_API_KEY=their-key-here - Re-run config check to verify
Environment Variables
Required in .env:
HEYREACH_API_KEY=your-api-key-here
API Base URL
All API requests go to: https://api.heyreach.io/api/public
Authentication header: X-API-KEY: {api_key}
Rate limit: 300 requests/minute
Script Usage Patterns
List Campaigns
from heyreach_client import get_client
client = get_client()
result = client.post("/v2/campaigns/All", {"offset": 0, "limit": 100})
campaigns = result.get("items", [])
Get Campaign Details
result = client.get(f"/v2/campaigns/{campaign_id}")
Add Leads
leads = [
{"linkedInUrl": "https://linkedin.com/in/user1"},
{"linkedInUrl": "https://linkedin.com/in/user2"}
]
result = client.post(f"/v2/campaigns/{campaign_id}/leads", {"leads": leads})
Error Handling
from heyreach_client import get_client, HeyReachError
try:
client = get_client()
result = client.get("/v2/campaigns/123")
except HeyReachError as e:
print(f"Error {e.status_code}: {e.message}")
except ValueError as e:
print(f"Config error: {e}")
Version: 1.0 Created: 2025-12-19 Status: Production Ready
More from abdullahbeam/nexus-design-abdullah
mental-models
Load when user says "mental model", "think through this", "structured thinking", "help me decide", "analyze this problem", "first principles", "pre-mortem", "stakeholder mapping", "what framework should I use", or any specific model name. Provides 59 thinking frameworks for decision-making, problem decomposition, and strategic analysis.
64notion-connect
Connect to any Notion database by name. Load when user mentions 'notion', 'connect notion', 'setup notion', 'query [database-name]', 'add to [database]', 'notion databases', or any database name from persistent context. Meta-skill that discovers workspace, caches schemas, and routes to appropriate operations.
24google-tasks
Manage Google Tasks and task lists. Load when user mentions 'google tasks', 'tasks', 'todo list', 'create task', 'complete task', or references task/todo management.
21google-sheets
Read and write Google Sheets data. Load when user mentions 'google sheets', 'spreadsheet', 'update sheet', 'read sheet', 'append to sheet', or references extracting data to update a tracking sheet.
20airtable-master
Shared resource library for Airtable integration skills. DO NOT load directly - provides common references (setup, API docs, error handling, field types) and scripts used by airtable-connect, airtable-query, and airtable-sync.
19google-integration
Complete Google Workspace integration (Gmail, Docs, Sheets, Calendar, Drive, Tasks, Slides). Load when user mentions 'google', 'gmail', 'email', 'google docs', 'google sheets', 'spreadsheet', 'google calendar', 'schedule meeting', 'calendar', 'google drive', 'upload file', 'download file', 'google tasks', 'todo', 'google slides', 'presentation', or any Google service operation.
18