GET
/
v2
/
accounts
/
{account_id}
/
messages
/
{message_id}
Get Message
curl --request GET \
  --url https://api.ahasend.com/v2/accounts/{account_id}/messages/{message_id} \
  --header 'Authorization: Bearer <token>'
{
  "object": "message",
  "created_at": "2023-11-07T05:31:56Z",
  "updated_at": "2023-11-07T05:31:56Z",
  "sent_at": "2023-11-07T05:31:56Z",
  "delivered_at": "2023-11-07T05:31:56Z",
  "retain_until": "2023-11-07T05:31:56Z",
  "direction": "incoming",
  "is_bounce_notification": true,
  "bounce_classification": "<string>",
  "delivery_attempts": [
    {
      "time": "2023-11-07T05:31:56Z",
      "log": "<string>",
      "status": "<string>"
    }
  ],
  "message_id": "<string>",
  "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "subject": "<string>",
  "tags": [
    "<string>"
  ],
  "sender": "[email protected]",
  "recipient": "[email protected]",
  "status": "<string>",
  "num_attempts": 123,
  "click_count": 123,
  "open_count": 123,
  "reference_message_id": 123,
  "domain_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "account_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "content": "<string>",
  "content_parsed": {
    "parts": [
      {
        "content_type": "text/html",
        "content": "<string>"
      }
    ],
    "attachments": [
      {
        "filename": "document.pdf",
        "content": "<string>",
        "content_type": "application/pdf",
        "content_id": "[email protected]"
      }
    ],
    "headers": {
      "Content-Type": [
        "text/html; charset=utf-8"
      ],
      "X-Custom-Header": [
        "value1",
        "value2"
      ]
    }
  }
}
Returns a message by its ID. The main difference between the response of this API and the response of the List Messages API is that this API returns a single message including the original, raw email content (if available), while the message objects returned in the List Messages API do not include the email content.

Authorizations

Authorization
string
header
required

API key for authentication

Path Parameters

account_id
string<uuid>
required

Account ID

message_id
string<uuid>
required

Message API ID (the same ID returned by Create Message API)

Response

Message details

object
enum<string>
required

Object type identifier

Available options:
message
created_at
string<date-time>
required

When the message was created

updated_at
string<date-time>
required

When the message was last updated

retain_until
string<date-time>
required

When the message data will be purged

direction
enum<string>
required

Message direction

Available options:
incoming,
outgoing
is_bounce_notification
boolean
required

Whether this is a bounce notification

delivery_attempts
object[]
required

List of delivery attempts for this message

message_id
string
required

Message-ID header value

id
string<uuid>
required

API-generated message ID

subject
string
required

Message subject

tags
string[]
required

Tags associated with the message

sender
string<email>
required

Sender email address

recipient
string<email>
required

Recipient email address

status
string
required

Current message status

num_attempts
integer
required

Number of delivery attempts

click_count
integer
required

Number of clicks tracked for this message

open_count
integer
required

Number of opens tracked for this message

domain_id
string<uuid>
required

Domain ID this message was sent from

account_id
string<uuid>
required

Account ID this message belongs to

sent_at
string<date-time> | null

When the message was sent

delivered_at
string<date-time> | null

When the message was delivered

bounce_classification
string

Classification of bounce if applicable

reference_message_id
integer

ID of the original message (for bounce messages)

content
string | null

Original, raw email content (RFC822 format) - may be null if the message content is not available.

content_parsed
object

Parsed and structured message content including parts, attachments, and headers - may be null if the message content is not available.