---
updatedAt: 2026-07-15T18:41:54.000Z
agentTools:
  siteIndex: https://documentation.bloomreach.com/llms.txt
  projectIndex: https://documentation.bloomreach.com/engagement/llms.txt
---

# List archived messages

The messages archive API gives you programmatic access to your archived emails and SMS. Use it to retrieve message content and metadata for customer support, compliance reporting, or bulk data exports.

<Callout icon="📘" theme="info">
  ### Note

  The request body determines the scope of the request. Include either `customer_ids` or `recipient` to list messages for specific customers, or omit both to list across the entire project.
</Callout>

## Authentication and access

The API uses Basic authentication. Include your API key ID and secret key in the [request header](https://documentation.bloomreach.com/engagement/reference/technical-information):

```text HTTP header
Authorization: Basic <api_key>
```

You also need the `messages archive` permission enabled in your project's API settings. See [Setting up API groups](https://documentation.bloomreach.com/engagement/reference/prerequisites#set-up-api-groups) for instructions.

<Callout icon="⚠️" theme="warn">
  ### Warning

  This endpoint applies a rate limit of 300 requests per minute. If this is reached, the endpoint returns `429 Too Many Requests` with the following headers:

  - `Retry-After: <seconds>` : how long until the window resets.
  - `X-RateLimit-Limit` : the limit value.
  - `X-RateLimit-Remaining` : remaining requests in the window.
  - `X-RateLimit-Reset` : UNIX timestamp when the window resets.
</Callout>

## Request body example

```json List messages by customer_ids
{
  "customer_ids": { "registered": "user@example.com" },
  "channel": "email",
  "limit": 50,
  "from_date": 1700000000.0,
  "to_date": 1710000000.0,
  "from_cursor": "a1b2c3d4-e5f6-7890-abcd-ef1234567890#9a8b7c6d...#email"
}
```
```json List messages by recipient
{
  "recipient": "user@test.com",
  "channel": "email",
  "limit": 50,
  "from_date": 1700000000.0,
  "to_date": 1710000000.0,
  "from_cursor": "a1b2c3d4-e5f6-7890-abcd-ef1234567890#9a8b7c6d...#email"
}
```

## Response examples

```json List messages for a customer (Email)
{
  "success": true,
  "data": [
    {
      "project_id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
      "customer_id": "60b8d295f1a2c3001f9e4a12",
      "message_id": "65a1b2c3d4e5f60011223344",
      "channel": "email",
      "sender": "noreply@company.com",
      "recipient": "user@example.com",
      "subject": "Welcome to our platform",
      "sent_timestamp": 1705000000.0,
      "campaign_name": "Onboarding",
      "campaign_id": "64f1a2b3c4d5e60011223344",
      "action_id": 1,
      "action_name": "Welcome email",
      "sender_name": "Company",
      "preheader": "Get started with your new account"
    }
  ],
  "next_cursor": "a1b2c3d4-e5f6-7890-abcd-ef1234567890#9a8b7c6d...#email"
}
```
```json List messages for a customer (SMS)
{
  "success": true,
  "data": [
    {
      "project_id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
      "customer_id": "60b8d295f1a2c3001f9e4a12",
      "message_id": "65a1b2c3d4e5f60011223355",
      "channel": "sms",
      "sender": "+1234567890",
      "recipient": "+0987654321",
      "subject": null,
      "sent_timestamp": 1705000000.0,
      "campaign_name": "SMS Promo",
      "campaign_id": "64f1a2b3c4d5e60011223355",
      "action_id": 2,
      "action_name": "Promo SMS"
    }
  ],
  "next_cursor": null
}
```
```json Get a single message (Email)
{
  "success": true,
  "data": {
    "project_id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
    "customer_id": "60b8d295f1a2c3001f9e4a12",
    "message_id": "65a1b2c3d4e5f60011223344",
    "channel": "email",
    "sender": "noreply@company.com",
    "recipient": "user@example.com",
    "subject": "Welcome to our platform",
    "sent_timestamp": 1705000000.0,
    "campaign_name": "Onboarding",
    "campaign_id": "64f1a2b3c4d5e60011223344",
    "action_id": 1,
    "action_name": "Welcome email",
    "sender_name": "Company",
    "preheader": "Get started with your new account",
    "email": "<html><body><h1>Welcome!</h1></body></html>",
    "attachments": [
      {
        "filename": "guide.pdf",
        "size": 102400,
        "content_type": "application/pdf"
      }
    ]
  }
}
```
```text Get a single message (SMS)
{
  "success": true,
  "data": {
    "project_id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
    "customer_id": "60b8d295f1a2c3001f9e4a12",
    "message_id": "65a1b2c3d4e5f60011223355",
    "channel": "sms",
    "sender": "+1234567890",
    "recipient": "+0987654321",
    "subject": null,
    "sent_timestamp": 1705000000.0,
    "campaign_name": "SMS Promo",
    "campaign_id": "64f1a2b3c4d5e60011223355",
    "action_id": 2,
    "action_name": "Promo SMS",
    "message": "Hi! Check out our latest offers."
  }
}
```

## Email metadata fields

Each email object in the response's `data` array contains the following fields:

| Field            | Type           | Description                     | Example                                             |
| ---------------- | -------------- | ------------------------------- | --------------------------------------------------- |
| `project_id`     | string         | Project UUID                    | a1b2c3d4-e5f6-7890-abcd-ef1234567890                |
| `customer_id`    | string         | Internal customer ID (ObjectId) | 60b8d295f1a2c3001f9e4a12                            |
| `message_id`     | string         | Message ID (ObjectId)           | 65a1b2c3d4e5f60011223344                            |
| `channel`        | string         | Always `email`                  | email                                               |
| `sender`         | string         | Sender email address            | [`noreply@company.com`](mailto:noreply@company.com) |
| `sender_name`    | string \| null | Sender display name             | Company                                             |
| `recipient`      | string         | Recipient email address         | [`user@example.com`](mailto:user@example.com)       |
| `subject`        | string \| null | Email subject line              | Welcome to our platform                             |
| `preheader`      | string \| null | Email preheader text            | Get started with your new account                   |
| `sent_timestamp` | float \| null  | Unix timestamp                  | 1705000000.0                                        |
| `campaign_id`    | string \| null | Campaign ID                     | 64f1a2b3c4d5e60011223344                            |
| `campaign_name`  | string \| null | Campaign or scenario name       | Onboarding                                          |
| `action_id`      | int \| null    | Action node ID                  | 1                                                   |
| `action_name`    | string \| null | Action node name.               | Welcome email                                       |

<Callout icon="📘" theme="info">
  ### Note

  The full HTML email isn't included in the list message response. [Get a single archived message](https://documentation.bloomreach.com/engagement/reference/get-a-single-archived-message) to retrieve the full HTML.
</Callout>

## SMS metadata fields

Each SMS object in the response's `data` array contains the following fields:

| Field            | Type           | Description                          | Example                              |
| ---------------- | -------------- | ------------------------------------ | ------------------------------------ |
| `project_id`     | string         | Project UUID.                        | a1b2c3d4-e5f6-7890-abcd-ef1234567890 |
| `customer_id`    | string         | Internal customer ID (ObjectId).     | 60b8d295f1a2c3001f9e4a12             |
| `message_id`     | string         | Message ID (ObjectId).               | 65a1b2c3d4e5f60011223355             |
| `channel`        | string         | Always "sms".                        | sms                                  |
| `sender`         | string         | Sender phone number or alpha sender. | +1234567890                          |
| `recipient`      | string         | Recipient phone number.              | +0987654321                          |
| `subject`        | null           | Always null for SMS.                 | null                                 |
| `sent_timestamp` | float \| null  | Unix timestamp.                      | 1705000000.0                         |
| `campaign_id`    | string \| null | Campaign ID.                         | 64f1a2b3c4d5e60011223355             |
| `campaign_name`  | string \| null | Campaign or scenario name.           | SMS Promo                            |
| `action_id`      | int \| null    | Action node ID.                      | 2                                    |
| `action_name`    | string \| null | Action node name.                    | Promo SMS                            |

<Callout icon="📘" theme="info">
  ### Note

  The SMS message's content isn't included in the list message response. [Get a single archived message](https://documentation.bloomreach.com/engagement/reference/get-a-single-archived-message) to retrieve the message.
</Callout>

## Limitations and behavior

* **Ordering:** Newest message on top.
* **Mid-scan messages:** Messages written during an active scan may be missed if their customer prefix was already scanned. They appear in the next export.
* **Project-wide scans:** Results are grouped by customer, not sorted chronologically across all customers.
* **Response times:** This API isn't designed for real-time use. Expect slower response times than other Data API endpoints.

<br />

# OpenAPI definition

```json
{
  "openapi": "3.1.0",
  "info": {
    "title": "email-api",
    "version": "2"
  },
  "servers": [
    {
      "url": "https://api.exponea.com"
    }
  ],
  "security": [
    {}
  ],
  "paths": {
    "/data/v2/projects/{project_id}/message-archive/list": {
      "post": {
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "description": "`true` if the request was successful, and `false` in case any error occurs."
                    },
                    "data": {
                      "type": "array",
                      "items": {
                        "properties": {},
                        "type": "object"
                      },
                      "description": "List of archived message summaries. See Email/SMS metadata fields above."
                    },
                    "next_cursor": {
                      "type": "string",
                      "description": "Pagination cursor for the next page. null means you're on the last page."
                    },
                    "email": {
                      "type": "string"
                    },
                    "attachments": {
                      "type": "array",
                      "items": {
                        "properties": {
                          "filename": {
                            "type": "string",
                            "description": "Original filename. For example, `guide.pdf`."
                          },
                          "size": {
                            "type": "integer",
                            "description": "Size in bytes.",
                            "default": ""
                          },
                          "content_type": {
                            "type": "string",
                            "description": "MIME type.",
                            "default": "application/pdf"
                          }
                        },
                        "type": "object"
                      }
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "data",
                    "next_cursor"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Validation errors (invalid channel, limit out of range, bad cursor, bad ObjectId, etc.)",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "name": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "name"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized. No/incorrect authentication credentials provided.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "name": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "name"
                  ]
                }
              }
            }
          },
          "403": {
            "description": "Forbidden. Missing `message_archive` permission or module not enabled.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "name": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "name"
                  ]
                }
              }
            }
          },
          "429": {
            "description": "Too Many Requests. Rate limited.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "name": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "name"
                  ]
                }
              }
            }
          }
        },
        "parameters": [
          {
            "in": "header",
            "name": "Authorization",
            "schema": {
              "type": "string",
              "default": "Basic <base64(api_key_id:secret_key)>"
            },
            "description": "",
            "required": true
          },
          {
            "in": "path",
            "name": "project_id",
            "schema": {
              "type": "string"
            },
            "required": true,
            "description": "Your project's ID."
          }
        ],
        "summary": "List archived messages",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "customer_ids": {
                    "type": "object",
                    "properties": {
                      "<name>": {
                        "type": "string",
                        "default": "user@test.com"
                      }
                    },
                    "description": "Dictionary of external IDs. For example, `{\"registered\": \"...\"}`. Omit this parameter for project-wide listing.\n\nRequired if `recipient` is not used."
                  },
                  "recipient": {
                    "type": "string",
                    "description": "Recipient email address or phone number. Omit for project-wide listing.\n\nRequired if `customer_ids` is not used."
                  },
                  "channel": {
                    "type": "string",
                    "description": "`email` or `sms`. Omit to return all channels.\n"
                  },
                  "from_date": {
                    "type": "number",
                    "format": "float",
                    "description": "Start of the date range (Unix timestamp, inclusive). "
                  },
                  "to_date": {
                    "type": "number",
                    "format": "float",
                    "description": "End of the date range (Unix timestamp, inclusive). "
                  },
                  "limit": {
                    "type": "integer",
                    "description": "Records to return per response. Minimum value can be 1, and maximum 200.",
                    "default": "50"
                  },
                  "from_cursor": {
                    "type": "string",
                    "description": "Pagination cursor. Pass the `next_cursor` value from the previous response."
                  }
                }
              }
            }
          }
        },
        "operationId": "post_data-v2-projects-project-id-message-archive-list"
      }
    }
  },
  "x-readme": {
    "headers": [
      {
        "key": "content-type",
        "value": "application/json"
      }
    ],
    "explorer-enabled": true,
    "proxy-enabled": true
  },
  "x-readme-fauxas": true
}
```