Send an email

POSThttps://api.mailfully.com/v1/emails

Validate and accept a transactional email, returning 202 Accepted with the message id once the message row is persisted and (unless every recipient is suppressed) a send job is enqueued. 202 means acceptance, not delivery — the outcome arrives later via the message's last_event and events timeline. In live mode the from address domain must be a verified sending domain. Requires the send scope. Honors the optional Idempotency-Key header.

Loading code example
Loading code example

Authorizations

Authorizationstringheaderrequired

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Header Parameters

Idempotency-Keystring

Opt-in idempotency key, 1–256 characters (no charset restriction). A repeated key with the same body within 24 hours replays the original `2xx` response verbatim; the same key with a different body returns `409`.

Length: >= 1, <= 256

Body

fromstringrequired

Sender address. In live mode the domain must be a verified sending domain owned by the organization.

toanyrequired

A single address or an array of addresses.

ccany

A single address or an array of addresses.

bccany

A single address or an array of addresses.

reply_toany

A single address or an array of addresses.

subjectstring
htmlstring

HTML body. At least one of `html`, `text`, or `template` is required.

textstring

Plain-text body.

headersobject

Arbitrary additional headers as a string map.

attachmentsarray<any>

Opaque attachment objects (passthrough; not validated).

tagsarray<object>

Up to 75 message tags.

Required array length: <= 75 elements
tags.namestringrequired

Tag name; must match `[A-Za-z0-9_-]+`.

tags.valuestringrequired

Tag value; must match `[A-Za-z0-9_-]+`.

scheduled_atstring<date-time>

ISO 8601 send time, up to 90 days ahead. A past or omitted value sends immediately.

templateobject
template.idstringrequired

The template id (`tmpl_…`) to render at accept time.

template.variablesobject

Flat key/value variables substituted into `{{name}}` placeholders.

Response

application/json

The email was accepted.

idstringrequired

The accepted message id (a bare ULID, no prefix).