The AhaSend CLI is available on GitHub and supports Linux, macOS, and Windows.
Key Features
Email Sending
Send single or batch emails with substitutions, stored templates, attachments, and scheduling
Domain Management
Add, check, and manage sending domains and their DNS records
Templates and Campaigns
Store transactional templates, and draft, test, and send campaigns to contact lists and segments
Contacts, Lists and Segments
Manage contacts, import them in batches, organize them in lists, and find them by rules with segments
Webhooks and Routes
Configure event notifications and inbound routes, and test them locally
Analytics
Email counts of any period, and deliverability, bounce, and delivery time statistics
Why Use the CLI?
- Scripting: Exit codes tell the kind of failure, and
--output jsonprints the API response unchanged - Batch Sending: Concurrent sends with a progress bar, and a file of failed recipients to send again
- Output Formats: Plain text, table, JSON, and CSV
- Profiles: Switch between accounts, such as production and staging
- Local Testing: Webhook and route listeners that forward events to a server on your machine
- Logging:
--verboseand--debuglogs on stderr, with credentials redacted
Quick Example
Log in, check a sending domain you added and configured, and send a sandbox email. Replaceexample.com below with that domain:
Core Capabilities
Email Operations
- Send to recipients given with
--to, or to a JSON or CSV recipients file with per-recipient substitutions - HTML, plain text, and AMP content, inline or from files
- Stored transactional templates with
--template-id - Attachments up to 10 MiB per file
- Scheduled delivery up to 7 days ahead
- Sandbox mode for testing without delivering email
- Message search, details, and cancellation of scheduled messages
Domain Management
- Add sending domains and print the DNS records they need, also in BIND, Cloudflare, and Terraform formats
- Check DNS records and track verification status
- Set the sending type, DKIM, and custom subdomains
Templates and Campaigns
- Store transactional templates, edit drafts, publish them, and restore earlier versions
- Read and write Simple Editor designs as AhaML
- Draft, test, send, or schedule campaigns to contact lists and segments, and leave out the contacts of other lists and segments
- Campaign statistics, recipients, and campaign templates
Contacts, Lists and Segments
- Create, update, and delete contacts, or import them in batches
- Create contact lists, and add, set, or remove their members
- Create segments that find contacts by rules, preview the rules, and list the members
Webhook & Route Management
- Configure webhooks for message, suppression, domain and contact events
- Stream webhook and route events to your terminal, and forward them to a local server
- Trigger test webhook and route events
- Inbound email route configuration
Analytics & Reporting
- Email counts of any period, for the whole account or per domain
- Deliverability statistics
- Bounce statistics
- Delivery time metrics
- CSV output for spreadsheets
Supported Platforms
The CLI is distributed as a single binary with no external dependencies:- macOS: Intel and Apple Silicon
- Linux: x86_64 and ARM64
- Windows: x64 and ARM64
Integration with AhaSend Services
The CLI covers these AhaSend services:- API: Commands call AhaSend API v2
- SMTP: Create SMTP credentials and send test messages over SMTP
- Webhooks: Configure webhooks and test event processing
- Routes: Configure inbound email handling
- Suppressions: List, add, check, and delete suppressed addresses
- API Keys and Sub-accounts: Manage API keys and their scopes, and sub-accounts with their own API keys
Command Groups
- Messages: send, list, get, and cancel messages.
- Domains: create, check, verify, update, and delete sending domains.
- Templates: store transactional templates, with drafts, versions and AhaML designs.
- Campaigns: draft, test, send, and report on campaigns, and manage campaign templates.
- Contacts: create, update, list, get, delete, and batch-import account contacts.
- Lists: manage contact lists and their members.
- Segments: create, preview, update, and delete segments, and list their members.
- Webhooks: configure, listen to, and trigger webhooks.
- Routes: configure, listen to, and trigger inbound routes.
- Suppressions: list, create, check, delete, and wipe suppressions.
- SMTP: manage SMTP credentials and send test messages.
- API Keys: manage API keys, their scopes, and IP allow lists.
- Statistics: email counts, and deliverability, bounce, and delivery time statistics.
- Sub-accounts: manage child accounts, usage, pauses, and their API keys.
- Authentication: log in, switch, check, and log out profiles.
- Ping: test the connection to the API.
Next Steps
Installation
Install the CLI on your system
Quick Start
Send your first email in minutes
Authentication
Set up API credentials
Command Reference
Explore available commands
Support
- GitHub Issues: Report bugs or request features
- Email Support: support@ahasend.com

