Skip to main content
GET
/
v1
/
campaigns
Node.js SDK
import Migma from 'migma';

const migma = new Migma('YOUR_API_KEY');

const { data, error } = await migma.campaigns.list({ projectId: 'PROJECT_ID' });
{
  "success": true,
  "data": {
    "campaigns": [
      {
        "id": "<string>",
        "projectId": "<string>",
        "name": "<string>",
        "conversationId": "<string>",
        "subject": "<string>",
        "preheaderText": "<string>",
        "from": "jsmith@example.com",
        "fromName": "<string>",
        "replyTo": "<string>",
        "recipientType": "audience",
        "recipientId": "<string>",
        "topicId": "<string>",
        "estimatedRecipients": 123,
        "providerType": "ses",
        "variables": {},
        "status": "draft",
        "scheduledAt": "2023-11-07T05:31:56Z",
        "scheduledTimezone": "<string>",
        "batchId": "<string>",
        "sentAt": "2023-11-07T05:31:56Z",
        "completedAt": "2023-11-07T05:31:56Z",
        "error": "<string>",
        "triggeredBy": "manual",
        "createdAt": "2023-11-07T05:31:56Z",
        "updatedAt": "2023-11-07T05:31:56Z"
      }
    ],
    "total": 123
  },
  "error": "<string>"
}

Authorizations

Authorization
string
header
required

API key authentication. Use 'Authorization: Bearer YOUR_API_KEY' where YOUR_API_KEY is obtained from the Migma dashboard under Settings → API Integration.

Query Parameters

projectId
string
required

Project ID

status
enum<string>

Filter by campaign status

Available options:
draft,
scheduled,
sending,
throttled,
sent,
failed,
cancelled
page
integer
default:1

Page number for pagination

limit
integer
default:20

Number of results per page

Response

List of campaigns

success
boolean
required
data
object
error
string | null