GET
/
v2
/
accounts
/
{account_id}
/
messages
Get Messages
curl --request GET \
  --url https://api.ahasend.com/v2/accounts/{account_id}/messages \
  --header 'Authorization: Bearer <token>'
{
  "object": "list",
  "data": [
    {
      "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>",
      "api_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
      "ahasend_id": "<string>",
      "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"
    }
  ],
  "pagination": {
    "has_more": true,
    "next_cursor": "eyJpZCI6MTIzNH0="
  }
}

Authorizations

Authorization
string
header
required

API key for authentication

Path Parameters

account_id
string<uuid>
required

Account ID

Query Parameters

status
string

Filter by comma-separated list of message statuses

sender
string<email>

Sender email address (must be from domain in API key scopes)

recipient
string<email>

Recipient email address

subject
string

Filter by subject text

message_id_header
string

Filter by message ID header (same ID returned by CreateMessage API)

from_time
string<date-time>

Filter messages created after this time (RFC3339 format)

to_time
string<date-time>

Filter messages created before this time (RFC3339 format)

limit
integer
default:100

Maximum number of items to return (1-100)

Required range: 1 <= x <= 100
cursor
string

Pagination cursor for the next page

Response

200
application/json

List of messages

The response is of type object.