API v2 Documentation: This document covers API v2, which provides advanced features and controls for comprehensive email management. For API v1, which is simpler and easier to get started with, you can select “API Key v1” when creating credentials.
What are API Keys?
API keys are advanced authentication tokens that allow your application to make authenticated HTTP requests to AhaSend’s latest REST API. API v2 keys provide enhanced capabilities beyond SMTP credentials and API v1:- Enterprise-grade features with comprehensive email management
- Advanced analytics and reporting for detailed insights
- Enhanced delivery controls and sophisticated routing options
- Comprehensive webhook management with detailed event tracking
- Advanced templating system with dynamic content capabilities
- Better error handling with detailed HTTP response codes and debugging information
- High-performance bulk operations optimized for large-scale sending
Creating API Keys
Access Credentials Dashboard
- Log in to your AhaSend Dashboard
- Navigate to the Credentials section from the main menu
- Click the “Create Credential” button
Configure Credential Settings
Select Credential Type:
- Choose “API Key v2” as the credential type for advanced features
- Alternatively, select “API Key v1” for simpler integration
- Use a name that helps you identify this API key later
- Examples: “Production API v2”, “example.com API v2”, “Marketing Platform v2”
Naming Tip: If you have multiple domains or applications, include descriptive information in your API key name (e.g., “example.com Production API v2”, “Newsletter Service v2”) to make management easier.
Set Credential Mode
Choose the appropriate mode for your use case:Production Mode:
- Sends emails to real recipients
- Use for live applications and real email delivery
- Emails are delivered normally
- Simulates email sending without actual delivery to recipients
- Perfect for testing and development environments
- Completely free - doesn’t count toward your email credits
- Still triggers webhooks for testing your integrations
Sandbox Benefits: Sandbox mode processes emails just like production (including webhook events) but stops short of actual delivery. This makes it perfect for testing your integration safely. Learn more about sandbox mode →
Configure Credential Scope
Global Scope:
- Works with all domains in your account
- Simplest option for most users
- Can be changed later if needed
- Restricts API key to specific domains
- Better security for multi-domain setups
- Requires separate API keys per domain
Generate and Save API Key
- Click “Create Credential” to generate your API key
- Copy and securely store the API key
- Save it in your password manager or secure storage
API Key Scoping
Global Scope
Global Scope
- Works with all domains in your account
- Simplest setup for single-domain users
- Good for getting started quickly
- Full access to all account features
Domain-Specific Scope
Domain-Specific Scope
- Restricts sending to specific domains
- Better security for multi-domain setups
- Prevents accidental cross-domain sending
- Ideal for client-specific applications
Integration Examples
Please see CreateMessage API Reference for code samples of sending emails using the API.