Skip to main content
POST
/
v1
/
campaigns
/
{id}
/
cancel
Node.js SDK
import Migma from 'migma';

const migma = new Migma('YOUR_API_KEY');

const { data, error } = await migma.campaigns.cancel('CAMPAIGN_ID');
{
  "success": true,
  "data": {
    "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"
  },
  "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.

Path Parameters

id
string
required

Campaign ID

Response

Campaign cancelled

success
boolean
required
data
object
error
string | null