Mailboxes

Send email

Sends an email from the mailbox. Supports two modes: template mode (provide template + variables) or raw HTML mode (provide subject + html). The from_name field optionally sets a display name on the From header. Same-domain sends are normal accounted outbound sends through the provider path; Run402 does not short-circuit loopback delivery. Raw mode accepts subject plus text without html; when text is supplied, it is the first text/plain body part and footer policy appends only. Attachments are decoded once from content_base64 before transport MIME encoding.

post/mailboxes/v1/{mailbox_id}/messages

Request

  • Base URL: https://api.run402.com
  • URL: https://api.run402.com/mailboxes/v1/{mailbox_id}/messages
  • Auth: HTTP bearer

Path parameters

mailbox_idstring uuid required

Mailbox ID

Request body

tostring email required

Recipient email address

template'project_invite' | 'magic_link' | 'notification'

Email template to use (template mode)

variablesobject

Template variables (template mode)

subjectstring

Email subject line (raw mode)

htmlstring

HTML email body, max 1MB (raw mode)

textstring

Optional plaintext fallback; auto-generated from html if omitted (raw mode)

from_namestring

Display name for the From header, e.g. 'My App' renders as '"My App" slug@project-host.mail.run402.com' or the ready custom-domain address.

Response

Message sent

message_idstring
mailbox_idstring

Mailbox that actually sent the message.

from_addressstring email

Sender address actually used.

tostring email
template'project_invite' | 'magic_link' | 'notification'
statusstring
sent_atstring date-time

Example response

{
  "message_id": "msg_1780076428285_dlnfqq",
  "status": "sent"
}

Changes

No recorded changes to this operation across all 1 revision of this API.