API Reference

List campaigns

GET /campaigns — list your campaigns, newest first.

GET/campaigns

Returns your campaigns ordered by creation time (newest first), wrapped in a list object. The limit parameter is optional — if you omit it, all campaigns are returned in a single response.

Query parameters
limitnumberoptional

Number of campaigns to retrieve. Minimum 1, maximum 100.

afterstringoptional

The ID after which to retrieve more campaigns (pagination). The ID itself is excluded. Cannot be combined with before.

beforestringoptional

The ID before which to retrieve more campaigns (pagination). The ID itself is excluded. Cannot be combined with after.

import { MailBlastr } from 'mailblastr';

const mb = new MailBlastr('mb_xxxxxxxxx');

const { data, error } = await mb.campaigns.list();
console.log({ data, error });

Response

Returns a list object. has_more indicates whether further pages exist beyond the returned set.

{
  "object": "list",
  "has_more": false,
  "data": [
    {
      "id": "8f5c2a1e-7b3d-4f9a-9c12-2e6d4a7b8c90",
      "name": "June newsletter",
      "audience_id": "aud_3b1c...",
      "segment_id": null,
      "status": "sent",
      "ab_test": { "enabled": false },
      "scheduled_at": null,
      "sent_at": "2026-06-23T10:20:00.000Z",
      "created_at": "2026-06-23T10:00:00.000Z"
    }
  ]
}