For the complete documentation index, see llms.txt. This page is also available as Markdown.

Get a list of email campaigns

Returns a paginated list of the account's email campaigns, newest first.

Pagination is page-token based. Use the token query parameter together with the token, next_token, and prev_token values returned in the pagination object to navigate between pages.

get
Authorizations
Api-TokenstringRequired

Pass the API token in the Api-Token header

Query parameters
tokeninteger · min: 1Optional

Page number to retrieve (page-token pagination). Defaults to 1.

Default: 1Example: 1
per_pageinteger · min: 1 · max: 100Optional

Number of campaigns per page. Defaults to 50, maximum 100.

Default: 50Example: 50
searchstringOptional

Filter campaigns by name (case-insensitive partial match).

Example: spring
Responses
200

A paginated list of email campaigns.

application/json
get/api/email_campaigns
curl -X GET "https://mailtrap.io/api/email_campaigns?per_page=50&token=1" \
  -H 'Api-Token: YOUR_API_KEY'
{
  "data": [
    {
      "id": 4567,
      "domain_id": 4321,
      "domain_name": "acme.com",
      "name": "Spring Sale",
      "from_local_part": "news",
      "from_display_name": "Acme Marketing",
      "reply_to": {
        "display_name": "Acme Support",
        "local_part": "support",
        "domain": "acme.com"
      },
      "current_state": "draft",
      "current_state_metadata": {
        "reason": "text",
        "error": "text",
        "errors": [
          {
            "message": "Invalid recipient address",
            "rcpt_index": 0
          }
        ],
        "scheduled_at": "2026-06-01T09:00:00.000Z"
      },
      "created_at": "2026-05-01T10:15:00.000Z",
      "updated_at": "2026-05-02T09:00:00.000Z",
      "last_started_at": "2026-05-03T12:00:00.000Z",
      "last_started_at_date": "2026-05-03",
      "recipient_total_count": 1500,
      "contact_list_ids": [
        55,
        56
      ],
      "contact_segment_ids": [
        12
      ],
      "delivery_mode": "rapid",
      "delivery_options": {
        "emails_per_hour": 1000
      },
      "template": {
        "id": 789,
        "subject": "Spring is here — 30% off",
        "merge_tags": [
          "first_name"
        ],
        "body_html": "<html><body><h1>Hi {{first_name}}!</h1><p><a href=\"__unsubscribe_url__\">Unsubscribe</a></p></body></html>",
        "body_text": null
      }
    }
  ],
  "pagination": {
    "token": 1,
    "prev_token": null,
    "next_token": 2,
    "first_url": "https://mailtrap.io/api/email_campaigns?per_page=50&token=1",
    "prev_url": null,
    "current_url": "https://mailtrap.io/api/email_campaigns?per_page=50&token=1",
    "next_url": "https://mailtrap.io/api/email_campaigns?per_page=50&token=2"
  }
}

Last updated

Was this helpful?