Skip to main content
POST

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.

Headers

Idempotency-Key
string

Optional key (max 100 chars) for safe retries. Same key + same body within 24h replays the original response (same status and body); same key + a different body returns 409 IDEMPOTENCY_CONFLICT. Scoped per API key.

Maximum string length: 100

Body

application/json
recipientType
enum<string>
required

Type of recipient. 'email' for single send, 'audience' or 'segment' for segment-based batch sends, 'tag' for tag-based batch sends.

Available options:
email,
audience,
segment,
tag
from
string<email>
required

Sender email address (must be from a verified domain)

fromName
string
required

Sender display name

subject
string
required
recipientId
string

Required for audience/segment/tag sends. The segment or tag ID.

recipientEmail
string<email>

Required for single email sends.

replyTo
string<email>
variables
object

Template variables for personalization

providerType
enum<string>
default:migma

Email service provider to send through. Defaults to Migma's built-in sending. To use an external provider, connect it first in Settings → Integrations → Email Providers.

Available options:
ses,
resend,
sendgrid,
mailgun,
migma
projectId
string

Project ID. Optional when emailId or conversationId resolves the project automatically.

conversationId
string

Conversation ID from a generated email. Works for single-email conversations. For series, use emailId.

transactional
boolean

Controls whether the email is treated as transactional (order confirmations, password resets) or marketing. Defaults to true for single sends (recipientType 'email') and false for batch sends (recipientType 'audience', 'segment', 'tag'). Transactional emails bypass subscription status and topic preference filters, and omit List-Unsubscribe headers. Bounced and invalid addresses are always excluded. Set explicitly to override the default.

emailId
string

Generated email ID from result.emails[].emailId. Recommended for all generated emails and required for series slots.

Response

Email sent or batch queued

success
boolean
required
data
object
error
string | null