POST
/
v1
/
email
/
send
Send emails
curl --request POST \
  --url https://api.ahasend.com/v1/email/send \
  --header 'Content-Type: application/json' \
  --header 'X-Api-Key: <api-key>' \
  --data '{
  "from": {
    "email": "[email protected]",
    "name": "John Smith"
  },
  "recipients": [
    {
      "email": "[email protected]",
      "name": "John Smith"
    }
  ],
  "content": {
    "subject": "Sample subject",
    "text_body": "Sample email body",
    "html_body": "<p>Sample email body</p>",
    "attachments": [
      {
        "data": "R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7",
        "base64": true,
        "content_type": "image/gif",
        "content_id": "my-image",
        "file_name": "my_image.gif"
      }
    ],
    "reply_to": {
      "email": "[email protected]",
      "name": "John Smith"
    },
    "headers": {
      "X-My-Mail-ID": "12345",
      "X-Comment-ID": "456789"
    }
  }
}'
{
  "success_count": 1,
  "fail_count": 1,
  "failed_recipients": [
    "[email protected]"
  ],
  "errors": [
    "[email protected]: The email account that you tried to reach does not exist."
  ]
}
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.
Get your API key from the Credentials page in your AhaSend dashboard.
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.

Authorizations

X-Api-Key
string
header
required

Headers

Content-Type
string

Only application/json is supported

Body

application/json

Email object.

from
object
required
recipients
object[]
required

Specifies the list of recipients to which message will be sent.

content
object
required

Response

Request was accepted. This doesn't necessarily mean immediate delivery or even queueing of the emails for delivery. It just means that the request was well-formed and accepted, but you need to check the response for success_count and fail_count to make sure about the status of your request.

success_count
integer

Number of messages that were queued for sending.

Example:

1

fail_count
integer

Number of messages that failed to be queued for sending.

Example:

1

failed_recipients
string[]

List of email addresses that the email was not sent to.

Example:
errors
string[]

The reason the email failed to be sent to a recipient.

Example:
[
"[email protected]: The email account that you tried to reach does not exist."
]