curl --request POST \
--url https://app.sendmux.ai/api/v1/mailbox/messages:batch-get \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"ids": [
"<string>"
]
}
'import requests
url = "https://app.sendmux.ai/api/v1/mailbox/messages:batch-get"
payload = { "ids": ["<string>"] }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({ids: ['<string>']})
};
fetch('https://app.sendmux.ai/api/v1/mailbox/messages:batch-get', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://app.sendmux.ai/api/v1/mailbox/messages:batch-get"
payload := strings.NewReader("{\n \"ids\": [\n \"<string>\"\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}{
"meta": {
"request_id": "req_clxxxxxxxxxxxxxxxxxxxxxxxxx"
},
"ok": true,
"data": {
"messages": [
{
"content": {
"attachments": [
{
"content_id": "<string>",
"content_type": "application/pdf",
"disposition": "attachment",
"filename": "invoice.pdf",
"id": "<string>",
"size_bytes": 12345,
"download_url": "https://app.sendmux.ai/api/v1/mailbox/messages/msg_123/attachment-downloads/attref_abc123?download_token=..."
}
],
"body": {
"extracted_links": [
"<string>"
],
"html": "<string>",
"is_truncated": true,
"quotes_stripped": true,
"signature_stripped": true,
"text": "<string>",
"truncated_at_chars": 123
},
"dates": {
"received_at": "<string>",
"sent_at": "<string>"
},
"headers": {
"full": [
{
"name": "<string>",
"value": "<string>"
}
],
"selected": {
"in_reply_to": "<string>",
"message_id": [
"<string>"
],
"references": [
"<string>"
],
"reply_to": [
{
"email": "agent@example.com",
"name": "Support"
}
]
}
},
"id": "<string>",
"participants": {
"bcc": [
{
"email": "agent@example.com",
"name": "Support"
}
],
"cc": [
{
"email": "agent@example.com",
"name": "Support"
}
],
"from": {
"email": "agent@example.com",
"name": "Support"
},
"reply_to": [
{
"email": "agent@example.com",
"name": "Support"
}
],
"to": [
{
"email": "agent@example.com",
"name": "Support"
}
]
},
"states": {
"email_state": "<string>",
"option_hash": "<string>"
},
"subject": "<string>",
"thread_id": "<string>"
},
"message": {
"bcc": [
{
"email": "agent@example.com",
"name": "Support"
}
],
"cc": [
{
"email": "agent@example.com",
"name": "Support"
}
],
"flags": {
"answered": true,
"draft": true,
"flagged": true,
"seen": true
},
"folder_ids": [
"<string>"
],
"from": {
"email": "agent@example.com",
"name": "Support"
},
"has_attachments": true,
"id": "<string>",
"keywords": [
"$seen",
"$flagged",
"agent_triaged"
],
"preview": "<string>",
"received_at": "<string>",
"sent_at": "<string>",
"size_bytes": 123,
"subject": "<string>",
"thread_id": "<string>",
"to": [
{
"email": "agent@example.com",
"name": "Support"
}
],
"attachments": [
{
"content_id": "<string>",
"content_type": "application/pdf",
"disposition": "attachment",
"filename": "invoice.pdf",
"id": "<string>",
"size_bytes": 12345,
"download_url": "https://app.sendmux.ai/api/v1/mailbox/messages/msg_123/attachment-downloads/attref_abc123?download_token=..."
}
]
},
"raw_body": {
"body": {
"html": "<string>",
"is_truncated": true,
"text": "<string>",
"truncated_at_chars": 123
},
"id": "<string>",
"states": {
"email_state": "<string>"
},
"thread_id": "<string>"
}
}
],
"not_found": [
"<string>"
],
"states": {
"email_state": "<string>"
}
}
}{
"error": {
"code": "invalid_parameter",
"message": "<string>",
"retryable": false,
"doc_url": "<string>",
"errors": [
{
"code": "invalid_string",
"field": "recipient.email",
"message": "<string>"
}
],
"param": "<string>"
},
"meta": {
"request_id": "req_clxxxxxxxxxxxxxxxxxxxxxxxxx"
},
"ok": false
}{
"error": {
"code": "invalid_parameter",
"message": "<string>",
"retryable": false,
"doc_url": "<string>",
"errors": [
{
"code": "invalid_string",
"field": "recipient.email",
"message": "<string>"
}
],
"param": "<string>"
},
"meta": {
"request_id": "req_clxxxxxxxxxxxxxxxxxxxxxxxxx"
},
"ok": false
}{
"error": {
"code": "invalid_parameter",
"message": "<string>",
"retryable": false,
"doc_url": "<string>",
"errors": [
{
"code": "invalid_string",
"field": "recipient.email",
"message": "<string>"
}
],
"param": "<string>"
},
"meta": {
"request_id": "req_clxxxxxxxxxxxxxxxxxxxxxxxxx"
},
"ok": false
}Batch get mailbox messages
Returns exact messages by ID. Use body_mode to choose summary-only output, raw body output, or clean JSON content. Attachment output remains metadata only; attachment contents are not parsed.
curl --request POST \
--url https://app.sendmux.ai/api/v1/mailbox/messages:batch-get \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"ids": [
"<string>"
]
}
'import requests
url = "https://app.sendmux.ai/api/v1/mailbox/messages:batch-get"
payload = { "ids": ["<string>"] }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({ids: ['<string>']})
};
fetch('https://app.sendmux.ai/api/v1/mailbox/messages:batch-get', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://app.sendmux.ai/api/v1/mailbox/messages:batch-get"
payload := strings.NewReader("{\n \"ids\": [\n \"<string>\"\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}{
"meta": {
"request_id": "req_clxxxxxxxxxxxxxxxxxxxxxxxxx"
},
"ok": true,
"data": {
"messages": [
{
"content": {
"attachments": [
{
"content_id": "<string>",
"content_type": "application/pdf",
"disposition": "attachment",
"filename": "invoice.pdf",
"id": "<string>",
"size_bytes": 12345,
"download_url": "https://app.sendmux.ai/api/v1/mailbox/messages/msg_123/attachment-downloads/attref_abc123?download_token=..."
}
],
"body": {
"extracted_links": [
"<string>"
],
"html": "<string>",
"is_truncated": true,
"quotes_stripped": true,
"signature_stripped": true,
"text": "<string>",
"truncated_at_chars": 123
},
"dates": {
"received_at": "<string>",
"sent_at": "<string>"
},
"headers": {
"full": [
{
"name": "<string>",
"value": "<string>"
}
],
"selected": {
"in_reply_to": "<string>",
"message_id": [
"<string>"
],
"references": [
"<string>"
],
"reply_to": [
{
"email": "agent@example.com",
"name": "Support"
}
]
}
},
"id": "<string>",
"participants": {
"bcc": [
{
"email": "agent@example.com",
"name": "Support"
}
],
"cc": [
{
"email": "agent@example.com",
"name": "Support"
}
],
"from": {
"email": "agent@example.com",
"name": "Support"
},
"reply_to": [
{
"email": "agent@example.com",
"name": "Support"
}
],
"to": [
{
"email": "agent@example.com",
"name": "Support"
}
]
},
"states": {
"email_state": "<string>",
"option_hash": "<string>"
},
"subject": "<string>",
"thread_id": "<string>"
},
"message": {
"bcc": [
{
"email": "agent@example.com",
"name": "Support"
}
],
"cc": [
{
"email": "agent@example.com",
"name": "Support"
}
],
"flags": {
"answered": true,
"draft": true,
"flagged": true,
"seen": true
},
"folder_ids": [
"<string>"
],
"from": {
"email": "agent@example.com",
"name": "Support"
},
"has_attachments": true,
"id": "<string>",
"keywords": [
"$seen",
"$flagged",
"agent_triaged"
],
"preview": "<string>",
"received_at": "<string>",
"sent_at": "<string>",
"size_bytes": 123,
"subject": "<string>",
"thread_id": "<string>",
"to": [
{
"email": "agent@example.com",
"name": "Support"
}
],
"attachments": [
{
"content_id": "<string>",
"content_type": "application/pdf",
"disposition": "attachment",
"filename": "invoice.pdf",
"id": "<string>",
"size_bytes": 12345,
"download_url": "https://app.sendmux.ai/api/v1/mailbox/messages/msg_123/attachment-downloads/attref_abc123?download_token=..."
}
]
},
"raw_body": {
"body": {
"html": "<string>",
"is_truncated": true,
"text": "<string>",
"truncated_at_chars": 123
},
"id": "<string>",
"states": {
"email_state": "<string>"
},
"thread_id": "<string>"
}
}
],
"not_found": [
"<string>"
],
"states": {
"email_state": "<string>"
}
}
}{
"error": {
"code": "invalid_parameter",
"message": "<string>",
"retryable": false,
"doc_url": "<string>",
"errors": [
{
"code": "invalid_string",
"field": "recipient.email",
"message": "<string>"
}
],
"param": "<string>"
},
"meta": {
"request_id": "req_clxxxxxxxxxxxxxxxxxxxxxxxxx"
},
"ok": false
}{
"error": {
"code": "invalid_parameter",
"message": "<string>",
"retryable": false,
"doc_url": "<string>",
"errors": [
{
"code": "invalid_string",
"field": "recipient.email",
"message": "<string>"
}
],
"param": "<string>"
},
"meta": {
"request_id": "req_clxxxxxxxxxxxxxxxxxxxxxxxxx"
},
"ok": false
}{
"error": {
"code": "invalid_parameter",
"message": "<string>",
"retryable": false,
"doc_url": "<string>",
"errors": [
{
"code": "invalid_string",
"field": "recipient.email",
"message": "<string>"
}
],
"param": "<string>"
},
"meta": {
"request_id": "req_clxxxxxxxxxxxxxxxxxxxxxxxxx"
},
"ok": false
}Authorizations
Sendmux API key. Use a root API key for Management API routes, or a mailbox credential for Mailbox API routes. Obtain keys from the dashboard under API Keys.
Query Parameters
Mailbox public ID to target when the credential grants access to more than one mailbox. Omit when the credential is scoped to exactly one mailbox.
Body
Message IDs to fetch, maximum 100.
1 - 100 elementsBody shape to include for each message.
none, raw, clean_json Attachment detail to include. Contents are not returned.
none, metadata Header detail to include in each message.
none, selected, full When true, include HTML content when available.
When true, include links extracted from the body.
Maximum body characters per message before truncation.
1 <= x <= 1000000Body part to return when body_mode is not none.
auto, text, html, both When true, remove quoted reply text.
When true, remove detected email signatures.
Response
Batch message result
true Hide child attributes
Hide child attributes
Hide child attributes
Hide child attributes
Hide child attributes
Hide child attributes
Attachment metadata only. Attachment contents are not parsed by this endpoint.
Hide child attributes
Hide child attributes
Content ID for inline attachments, when present.
"application/pdf"
"attachment"
"invoice.pdf"
Attachment blob ID.
12345
Short-lived URL for this exact attachment. Fetch it promptly; if it expires, call the message or attachment metadata endpoint again to receive a fresh URL.
"https://app.sendmux.ai/api/v1/mailbox/messages/msg_123/attachment-downloads/attref_abc123?download_token=..."
Hide child attributes
Hide child attributes
text, html HTML body when requested. Returned as a JSON string and not as rendered content.
Hide child attributes
Hide child attributes
none, selected, full Hide child attributes
Hide child attributes
Message ID
Hide child attributes
Hide child attributes
Hide child attributes
Hide child attributes
Message ID
Active message keywords, including system flags and custom labels.
["$seen", "$flagged", "agent_triaged"]
Attachment metadata for this message. Each item includes a short-lived download_url; if it expires, fetch message metadata again.
Hide child attributes
Hide child attributes
Content ID for inline attachments, when present.
"application/pdf"
"attachment"
"invoice.pdf"
Attachment blob ID.
12345
Short-lived URL for this exact attachment. Fetch it promptly; if it expires, call the message or attachment metadata endpoint again to receive a fresh URL.
"https://app.sendmux.ai/api/v1/mailbox/messages/msg_123/attachment-downloads/attref_abc123?download_token=..."
Hide child attributes
Hide child attributes
Message ID
text, html, both Was this page helpful?