Skip to main content
POST
Node.js SDK

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 → Developers → API Keys.

Body

application/json
projectId
string
required

Project ID

name
string
required

Campaign name

conversationId
string
required

Conversation ID that owns the generated email

from
string<email>
required

Sender email address

fromName
string
required

Sender display name

recipientType
enum<string>
required

Send to a segment (audience) or tag

Available options:
audience,
tag
recipientId
string
required

Segment or tag ID

emailId
string

Generated email ID from result.emails[].emailId. Recommended for series slots.

subject
string

Email subject (auto-populated from conversation if omitted)

preheaderText
string

Preheader text

replyTo
string<email>

Reply-to address

topicId
string

Topic ID for preference filtering

providerType
enum<string>

Email provider (default: migma)

Available options:
ses,
resend,
sendgrid,
mailgun,
migma
variables
object

Template variables

Response

Campaign created

success
boolean
required
data
object
error
string | null