mailpit unofficial
POST/api/v1/send

Send a message

Sends an email message through the HTTP API with sender, recipient, and message content details. Provide From with an Email address, and use Attachments for files encoded in base64. A 200 response includes the sent message's database ID.

  • IdempotentThe SDK sends Idempotency-Key, so a retried request is only applied once.

11 body fields

JSON message details. From is required; recipient lists, content, and other metadata are optional.

Attachmentsarray<object>optional
Attachments
Bccarray<string>optional
Bcc recipients email addresses only
Ccarray<object>optional
Cc recipients
Fromobjectrequired
"From" recipient
HTMLstringoptional
Message body (HTML)
Headersobjectoptional
Optional headers in {"key":"value"} format
ReplyToarray<object>optional
Optional Reply-To recipients
Subjectstringoptional
Subject
Tagsarray<string>optional
Mailpit tags
Textstringoptional
Message body (text)
Toarray<object>optional
"To" recipients

2 status codes
200Returns a JSON object containing the sent message's database ID in `ID`.
IDstringoptional
Database ID
400Returned when the request is invalid; the JSON response contains an `Error` message.
Errorstringoptional
Error message

Error handling

A 400 is returned when the request JSON cannot be parsed or the required From field is missing. Include Email in From and in each recipient object under To, Cc, or ReplyTo; each attachment requires Content and Filename.