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.
API v2 keys allow you to authenticate with AhaSend’s advanced HTTP REST API to send emails using standard HTTP requests with enhanced features and controls. This guide will walk you through creating, configuring, and managing your API v2 keys for optimal email delivery performance.

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

  1. Log in to your AhaSend Dashboard
  2. Navigate to the Credentials section from the main menu
  3. 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
Choose a Descriptive Name:
  • 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
Sandbox Mode:
  • 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
Domain-Specific Scope:
  • Restricts API key to specific domains
  • Better security for multi-domain setups
  • Requires separate API keys per domain

Generate and Save API Key

  1. Click “Create Credential” to generate your API key
  2. Copy and securely store the API key
  3. Save it in your password manager or secure storage

API Key Scoping

Integration Examples

Please see CreateMessage API Reference for code samples of sending emails using the API.