MaillyDocs

Send email (transactional or marketing)

POST
/send-email

Applies governance, then passes through to the queue service; supports single, batch, audience, campaign, scheduled, and template-variable sends. Billed per recipient.

Authorization

bearerAuth
headerAuthorizationBearer <token>

Mailly API key(Authorization: Bearer )

Request Body

application/json
  1. body
to?|array<string|>

Recipients: an email, an array of emails, or an array of {email, externalId} objects; use exactly one of this, audience, or campaignKey

audience?

Audience filter {include, exclude}

campaignKey?string

Campaign key that uses a frozen audience

campaignName?string
subject?string

Email subject

html?string

HTML body

text?string

Plain-text body

fromEmail?string

From address (must be on a verified sending domain)

fromName?string
replyTo?string
cc?string
bcc?string
topic?string

Unsubscribe and frequency-cap topic

emailType?string
Value in"transactional""lifecycle""marketing"
dryRun?boolean

Validate only, do not deliver

testSend?boolean
scheduledAt?number

Scheduled send time in Unix seconds

frequencyCapDays?number
frequencyCapMax?number
topicExclusionDays?number
recipientReason?string
templateKey?string
templateVersion?number
sourceApp?string
businessGoal?string
utm?
messageId?string
inReplyTo?string
references?array<string>
attachments?array<unknown>
variables?

Inline {{var}} template variables

[key: string]?unknown

Response Body

Send result (passed through from the Queue service, JSON)

curl -X POST 'https://api.mailly.site/send-email' \  -H 'Content-Type: application/json' \  -d '{  "property1": null,  "property2": null}'
Empty