Send API

One URL. One key. Mail from your domain.

The MailerZ send API is POST https://mail.mailerz.net/api/v1/send with Authorization: Bearer mz_live_YOUR_KEY. Need subject plus text or html. From must be an enabled alias you own. Bcc is not written into MIME. Header From is never rewritten. Agents that speak MCP should use /mcp instead of inventing a second key.

Key takeaways

Examples

Plain send
curl -X POST https://mail.mailerz.net/api/v1/send \
  -H "Authorization: Bearer mz_live_YOUR_KEY" \
  -H "Content-Type: application/json; charset=utf-8" \
  -d '{"from":"hello@your-domain.com","to":"user@gmail.com","subject":"Hello","text":"Plain body"}'
Same body with Idempotency-Key
curl -X POST https://mail.mailerz.net/api/v1/send \
  -H "Authorization: Bearer mz_live_YOUR_KEY" \
  -H "Content-Type: application/json; charset=utf-8" \
  -H "Idempotency-Key: invoice-1042" \
  -d '{"from":"hello@your-domain.com","to":"user@gmail.com","subject":"Invoice 1042","text":"Plain body"}'

The same key within 24 hours returns the first result with idempotent: true and HTTP 200.

Fields

FieldMeaning
statusAlways present. true = sent. false = not sent.
messageAlways present. Plain-language result.
errorOnly when status is false. Machine code.
fromOwned address. String, {email,name}, or list. Omit = first eligible alias.
to / cc / bccSame shapes. Need at least one. Bcc stays off MIME headers.
replyToOptional. Max 5. reply_to also accepted.
subjectRequired. UTF-8, max 900.
text / htmlNeed one. Combined max ~10 MB.
attachmentsfilename, content (base64 or data URL), contentType, optional cid.
headersX-* only, max 20.
inReplyTo / referencesThreading.
Idempotency-KeyHeader or idempotencyKey. 24 hours.

Errors

HTTPCodeCause
401API_KEY_REQUIREDNo Bearer and no X-Api-Key
401API_KEY_INVALIDNot a stored mz_live_ / mz_root_ key
403API_KEY_REVOKEDRevoked on the desk
400SUBJECT_REQUIREDEmpty subject
400NO_BODYNeed text or html
400BODY_TOO_LARGEtext+html over ~10 MB
400RECIPIENT_REQUIREDto, cc, bcc all empty
400TOO_MANY_RECIPIENTSOver 20 envelope or 5 Reply-To
400INVALID_RECIPIENT:toBad address (suffix can be to/cc/bcc/replyTo)
400INVALID_FROMFrom is not a usable enabled alias
400PLATFORM_FROM_REQUIREDmz_root_ must be @mailerz.net or @mail.mailerz.net
404NOT_FOUNDFrom not on this workspace, or catch-all *
400ATTACHMENT_INVALID / _LIMIT / _TOO_LARGEBad or oversized files
400INVALID_HEADERSNot X-* or more than 20
403SEND_AS_LOCKEDFree plan / send-as off
403SEND_AS_DKIM_REQUIREDDKIM not live
403SEND_AS_SPF_REQUIREDSPF not live
403DOMAIN_OUTBOUND_PAUSEDOutbound paused
403PLAN_OUTGOING_LIMIT / PLAN_OUTGOING_HOURLYCap hit
403MAIL_VIRUS / MAIL_SPAMScan rejected
429RATE_LIMITED80 calls / hour

Limits

Mint the key on the desk.

Start free with one domain. After the account exists, open Developer and copy mz_live_.