Skip to content

Get a message for display

GET
/mail/mailboxes/{mailbox}/messages/{messageId}
curl --request GET \
--url https://mail.work.optidata.cloud/api/mail/mailboxes/78/messages/4186 \
--header 'Authorization: Bearer <token>'

One message prepared for a reader UI: the sanitised HTML body, the addresses grouped by role, the recipient set a reply all would use, a localised date string and the attachment list.

mailbox
required
integer

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

messageId
required
string

Id of the message.

The message, prepared for display.

Media typeapplication/json

A message prepared for a reader UI, with the recipient set a reply all would use already computed.

object
message
object
id
string | integer
subject
string | null
body

Sanitised HTML.

string
mentions_by_type

The addresses of the message, grouped by role.

object
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>

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>

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
reply_recipients

Who a reply and a reply-all should go to.

object
from

The address the reply would be sent from.

Array<string>
to
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_extra

Additional recipients a reply-all would add.

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
cc
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
bcc
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
sender

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
formatted_date

The message date, already localised for display.

string
attachments
Array<object>

A file carried by a message.

object
part

MIME part number, used to download it.

string | integer
filename
string | null
contentType
string | null
contentId

The cid an inline image is referenced by inside the body.

string | null
disposition

attachment or inline.

string | null
hasExplicitAttachmentDisposition
boolean
fallbackOrdinal

Position used to name a file that arrived without one.

integer | null
sizeBytes
integer | null
icon

Icon hint for a file-type badge.

string | null
url

Signed download link, populated by the reader operations. Use it as-is.

string | null
Examples
Examplemessage
{
"message": {
"id": 4186,
"subject": "Quarterly report",
"body": "<div>Hi Jane, here are the files you asked for.</div>"
},
"mentions_by_type": {
"from": [
{
"name": "John Roe",
"email": "john.roe@example.com",
"type": "f"
}
],
"to": [
{
"name": "Jane Doe",
"email": "jane.doe@acme.example",
"type": "t"
}
],
"cc": []
},
"reply_recipients": {
"from": [
"jane.doe@acme.example"
],
"to": [
{
"name": "John Roe",
"email": "john.roe@example.com",
"type": "f"
}
],
"to_extra": [],
"cc": [],
"bcc": []
},
"sender": {
"name": "John Roe",
"email": "john.roe@example.com",
"type": "f"
},
"formatted_date": "Wednesday, Aug 19, 2026 at 09:45",
"attachments": [
{
"part": "2",
"filename": "report.docx",
"contentType": "application/vnd.openxmlformats-officedocument.wordprocessingml.document",
"contentId": "<f_mt032taz0>",
"disposition": "attachment",
"hasExplicitAttachmentDisposition": true,
"fallbackOrdinal": null,
"sizeBytes": 8503,
"icon": "bi-file-earmark-word icon-file-doc",
"url": null
}
]
}

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."
}

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"
}