Skip to main content
POST
/
v2
/
accounts
/
{account_id}
/
messages
/
conversation
Create Conversational Message
curl --request POST \
  --url https://api.ahasend.com/v2/accounts/{account_id}/messages/conversation \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "from": {
    "email": "noreply@example.com",
    "name": "Example Corp"
  },
  "to": [
    {
      "email": "user@example.com",
      "name": "John Doe"
    },
    {
      "email": "someone@example.com",
      "name": "Jane Doe"
    }
  ],
  "cc": [
    {
      "email": "hr@example.com",
      "name": "Example Corp HR"
    }
  ],
  "bcc": [
    {
      "email": "bcc@example.com",
      "name": "BCC Recipient"
    }
  ],
  "subject": "Welcome to Example Corp",
  "html_content": "<h1>Dear John and Jane, welcome to Example Corp!</h1>",
  "text_content": "Dear John and Jane, welcome to Example Corp!"
}
'
{
  "object": "list",
  "data": [
    {
      "object": "message",
      "recipient": {
        "email": "user@example.com",
        "name": "John Doe",
        "substitutions": {
          "first_name": "John",
          "order_id": "12345"
        }
      },
      "status": "queued",
      "id": "<uuid@example.com>",
      "error": "<string>",
      "schedule": {
        "first_attempt": "2023-11-07T05:31:56Z",
        "expires": "2023-11-07T05:31:56Z"
      }
    }
  ]
}

Authorizations

Authorization
string
header
required

API key for authentication

Headers

Idempotency-Key
string

Optional idempotency key for safe request retries. Must be a unique string for each logical request. Requests with the same key will return the same response. Keys expire after 24 hours.

Maximum string length: 255

Path Parameters

account_id
string<uuid>
required

Account ID

Body

application/json
from
object
required
Example:
{
"email": "noreply@example.com",
"name": "Example Corp"
}
to
object[]
required

This parameter can set the To header to multiple addresses. The combined to, cc, and bcc recipient count must not exceed 50.

Required array length: 1 - 50 elements
subject
string
required

Email subject line

cc
object[]

This parameter can set the CC header to multiple addresses. Do not include cc in the headers array. The combined to, cc, and bcc recipient count must not exceed 50.

Required array length: 1 - 50 elements
bcc
object[]

This parameter can set the To header to multiple addresses. The combined to, cc, and bcc recipient count must not exceed 50.

Required array length: 1 - 50 elements
reply_to
object

If provided, the reply-to header in headers array must not be provided

Example:
{
"email": "noreply@example.com",
"name": "Example Corp"
}
text_content
string

Plain text content. Required if html_content is empty

html_content
string

HTML content. Required if text_content is empty

amp_content
string

AMP HTML content

attachments
object[]

File attachments

headers
object

Custom email headers. cc and reply-to headers cannot be provided if reply_to or cc parameters are provided, message-id will be ignored and automatically generated

tags
string[]

Tags for categorizing messages

sandbox
boolean
default:false

If true, the message will be sent to the sandbox environment

sandbox_result
enum<string>

The result of the sandbox send

Available options:
deliver,
bounce,
defer,
fail,
suppress
tracking
object

Tracking settings for the message, overrides default account settings

Example:
{ "open": true, "click": true }
retention
object

Retention settings for the message, overrides default account settings

Example:
{ "metadata": 1, "data": 0 }
schedule
object

Schedule for message delivery

Response

Message created successfully

object
enum<string>
required

Object type identifier

Available options:
list
data
object[]
required

List of messages and their statuses