Skip to content

Send a new message

POST
/mail/mailboxes/{mailbox}/messages
curl --request POST \
--url https://mail.work.optidata.cloud/api/mail/mailboxes/78/messages \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{ "draft_id": 918, "to": [ "john.roe@example.com" ], "cc": [], "bcc": [], "subject": "Quarterly report", "body": "<p>Hi John, the report is attached.</p>", "is_read_receipt_enabled": false }'

Send a message that has already been saved as a draft. Save the body and attachments with the draft endpoint first, then send the resulting draft_id here together with the envelope.

Delivery is queued, so a 200 means “accepted for sending”, not “delivered”. The draft moves to a queued state and disappears from the Drafts folder. Per-user sending limits apply; exceeding one answers 422.

mailbox
required
integer

Id of the mailbox. Every mailbox the caller may use is listed in their account.

Media typeapplication/json

The envelope of a message to send. The body and its files come from the draft named by draft_id.

object
draft_id
required

Id of the saved draft carrying the body and the attachments.

string | integer
to
required

Recipient addresses. At least one is required.

Array<string>
>= 1 items
cc
Array<string> | null
bcc
Array<string> | null
subject
string | null
body

HTML body.

string | null
date

Send date. Defaults to now.

string | null
is_read_receipt_enabled
boolean | null
Examples
Examplesimple
{
"draft_id": 918,
"to": [
"john.roe@example.com"
],
"cc": [],
"bcc": [],
"subject": "Quarterly report",
"body": "<p>Hi John, the report is attached.</p>",
"is_read_receipt_enabled": false
}

The message was accepted for sending. The record returned is the queued message, not a delivery confirmation.

Media typeapplication/json

A message accepted for sending.

object
id
integer
mailbox_id
integer
type

How an outgoing message came to be.

string
Allowed values: new reply forward
subject
string | null
body

The HTML body the message was sent with.

string | null
date
string
is_read_receipt_enabled
boolean
reply_server_message_id
string | null
from
Array<object>

One participant of a message.

object
name

Display name, when one is known.

string | null
email
string format: email
type

The role the address plays: f sender, t recipient, c carbon copy, b blind copy, r reply-to.

string | null
to
Array<object> | null

One participant of a message.

object
name

Display name, when one is known.

string | null
email
string format: email
type

The role the address plays: f sender, t recipient, c carbon copy, b blind copy, r reply-to.

string | null
cc
Array<object> | null

One participant of a message.

object
name

Display name, when one is known.

string | null
email
string format: email
type

The role the address plays: f sender, t recipient, c carbon copy, b blind copy, r reply-to.

string | null
bcc
Array<object> | null

One participant of a message.

object
name

Display name, when one is known.

string | null
email
string format: email
type

The role the address plays: f sender, t recipient, c carbon copy, b blind copy, r reply-to.

string | null
created_at
string
updated_at
string
Examples
Examplequeued
{
"id": 5120,
"mailbox_id": 78,
"type": "new",
"subject": "Quarterly report",
"body": "<p>Hi John, the report is attached.</p>",
"date": "2026-08-19T13:02:11.000000Z",
"is_read_receipt_enabled": false,
"reply_server_message_id": null,
"from": [
{
"name": "Jane Doe",
"email": "jane.doe@acme.example"
}
],
"to": [
{
"name": "John Roe",
"email": "john.roe@example.com"
}
],
"cc": null,
"bcc": null,
"created_at": "2026-08-19T13:02:11.000000Z",
"updated_at": "2026-08-19T13:02:11.000000Z"
}

Missing, malformed or expired authentication key.

Media typeapplication/json

Authentication failures use an error key rather than message.

object
error
required
string
Examples
Examplemissing

No bearer token sent

{
"error": "JWT passport exception: Missing bearer token in request"
}

The caller may not act on this mailbox, user or resource.

Media typeapplication/json

Generic error envelope used by policy, binding and framework failures.

object
message
required

Human-readable description of the failure.

string
Examples
Exampledenied
{
"message": "This action is unauthorized."
}

The request body or query string failed validation.

Media typeapplication/json
object
message
required

The first validation message.

string
errors
required

Validation messages keyed by field name.

object
key
additional properties
Array<string>
Examples
Exampleinvalid
{
"message": "The conversations field is required.",
"errors": {
"conversation_ids": [
"The conversations field is required."
]
}
}

Rate limit exceeded. Retry after the window resets.

Media typeapplication/json

Generic error envelope used by policy, binding and framework failures.

object
message
required

Human-readable description of the failure.

string
Examples
Examplethrottled
{
"message": "Too Many Attempts."
}

The mail platform did not answer as expected — a folder or message that does not exist, or a transient failure. reference is the code to quote to support and fault_code names the underlying condition. A 503 with the same envelope means the platform is in maintenance; retry shortly.

Media typeapplication/json

Failure raised by the mail platform behind the API rather than by the request itself.

object
error
required

What went wrong, phrased for the end user.

string
status
required

Repeats the HTTP status code.

integer
help
required

Suggested next step.

string
reference
required

Support reference, e.g. MZ-502.

string
fault_code

Names the underlying condition, e.g. mail.NO_SUCH_FOLDER.

string | null
Examples

Unknown folder

{
"error": "The mail server did not answer as expected, so this action could not be completed.",
"status": 502,
"help": "If the problem persists, contact support and inform the error code above.",
"reference": "MZ-502",
"fault_code": "mail.NO_SUCH_FOLDER"
}