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

const migma = new Migma('YOUR_API_KEY');

const { data, error } = await migma.sending.send({
  recipientType: 'email',
  recipientEmail: '[email protected]',
  from: '[email protected]',
  fromName: 'Your Brand',
  subject: 'Hello!',
  template: '<h1>Hi there!</h1>',
  providerType: 'migma',
  projectId: 'PROJECT_ID'
});
{
  "success": true,
  "data": {
    "id": "<string>",
    "provider": "<string>",
    "status": "<string>",
    "sentCount": 123,
    "message": "<string>"
  },
  "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.

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
template
string
required

React Email TSX template string with a default export. Example: import { Html, Body, Text } from '@react-email/components'; export default function Email() { return Hello; }

projectId
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
Available options:
ses,
resend,
sendgrid,
mailgun,
migma
conversationId
string

Response

Email sent or batch queued

success
boolean
required
data
object
error
string | null