API v1 is in maintenance mode. We recommend using API v2 for new integrations as it offers better features, error handling, and will receive ongoing updates.
API v1 provides a simple way to send emails through AhaSend. It’s designed for straightforward email sending without the advanced features available in v2.

Base URL

https://api.ahasend.com/v1

Authentication

All API requests must include your API key in the X-Api-Key header:
X-Api-Key: YOUR_API_KEY
Get your API key from your AhaSend dashboard under API Keys.

Send Email

POST /email/send

Send emails to up to 100 recipients at once.

Request

POST https://api.ahasend.com/v1/email/send
Content-Type: application/json
X-Api-Key: YOUR_API_KEY

Request Body

{
  "from": {
    "email": "[email protected]",
    "name": "Your App Name"
  },
  "recipients": [
    {
      "email": "[email protected]",
      "name": "John Doe"
    }
  ],
  "content": {
    "subject": "Welcome to our service!",
    "text_body": "Thanks for signing up!",
    "html_body": "<h1>Welcome!</h1><p>Thanks for signing up!</p>"
  }
}

Parameters

Response

201 Success

{
  "success_count": 2,
  "fail_count": 0,
  "failed_recipients": [],
  "errors": []
}
success_count
integer
Number of messages queued for sending
fail_count
integer
Number of messages that failed to be queued
failed_recipients
array
List of email addresses that failed
errors
array
Detailed error messages for failed recipients

400 Bad Request

{
  "status": "bad request"
}
Common causes:
  • Missing required fields
  • Invalid email addresses
  • Domain not verified
  • Malformed request body

403 Access Denied

{
  "status": "invalid credentials"
}
Common causes:
  • Invalid API key
  • Domain ownership issues
  • DNS configuration problems

Code Examples

curl -X POST https://api.ahasend.com/v1/email/send \
  -H "Content-Type: application/json" \
  -H "X-Api-Key: YOUR_API_KEY" \
  -d '{
    "from": {
      "email": "[email protected]",
      "name": "Your App"
    },
    "recipients": [
      {
        "email": "[email protected]",
        "name": "John Doe"
      }
    ],
    "content": {
      "subject": "Welcome!",
      "text_body": "Welcome to our service!",
      "html_body": "<h1>Welcome!</h1><p>Welcome to our service!</p>"
    }
  }'

Rate Limits

  • Requests: 100 requests per second
  • Recipients: Up to 100 recipients per request
  • Burst: 200 request burst allowed

Migration to API v2

Consider upgrading to API v2 for:
  • Better error handling with detailed error codes
  • Advanced features like scheduling, templates, and tracking
  • Improved authentication with Bearer tokens and scopes
  • Enhanced delivery options with retry policies
  • Real-time webhooks for delivery status
  • Ongoing feature development and support

Support

Need help? Email our team at [email protected] for API v1 questions.