API

Campaigns & segments

Read-only list endpoints for dashboards, internal tools, and sync jobs. Creating or sending campaigns still happens in the MailPirate app.

List campaigns

GET /campaigns?store_slug=main&limit=50

{
  "data": [
    {
      "public_id": "01H...",
      "name": "Spring sale",
      "subject": "20% off this week",
      "status": "sent",
      "sent_count": 1200,
      "open_count": 400,
      "click_count": 80,
      "updated_at": "2026-11-18T12:00:00.000000Z"
    }
  ]
}

limit is optional (1-100, default 50).

Use the app campaign report for recipient-level detail, revenue attribution, and bounce/unsub breakdowns. See Campaigns.

List segments

GET /segments?store_slug=main&limit=50

{
  "data": [
    {
      "public_id": "01H...",
      "name": "VIP",
      "description": "High RFM",
      "cached_count": 340,
      "recomputed_at": "2026-11-18T10:00:00.000000Z"
    }
  ]
}

cached_count and recomputed_at reflect the last membership refresh in the app. If counts look stale, recompute the segment in MailPirate before relying on them for a big send. See Segments.