curl --request GET \
--url https://app.sendmux.ai/api/v1/mailbox/events \
--header 'Authorization: Bearer <token>'import requests
url = "https://app.sendmux.ai/api/v1/mailbox/events"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://app.sendmux.ai/api/v1/mailbox/events', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://app.sendmux.ai/api/v1/mailbox/events"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}{
"is_spam": true,
"mailbox_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"
}
],
"body": {
"html": "<string>",
"is_truncated": true,
"max_bytes": 123,
"text": "<string>"
},
"rfc5322_message_id": "<string>",
"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=..."
}
]
},
"message_id": "<string>",
"occurred_at": "<string>",
"recipients": [
"<string>"
],
"sender": "<string>",
"team_public_id": "<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
}{
"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
}Stream mailbox events
Streams bounded rich mailbox events for connected clients. Each received-message event includes subject, participants, preview, attachment metadata, and a capped body snapshot; use the message endpoints for full content or attachment bytes.
curl --request GET \
--url https://app.sendmux.ai/api/v1/mailbox/events \
--header 'Authorization: Bearer <token>'import requests
url = "https://app.sendmux.ai/api/v1/mailbox/events"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://app.sendmux.ai/api/v1/mailbox/events', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://app.sendmux.ai/api/v1/mailbox/events"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}{
"is_spam": true,
"mailbox_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"
}
],
"body": {
"html": "<string>",
"is_truncated": true,
"max_bytes": 123,
"text": "<string>"
},
"rfc5322_message_id": "<string>",
"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=..."
}
]
},
"message_id": "<string>",
"occurred_at": "<string>",
"recipients": [
"<string>"
],
"sender": "<string>",
"team_public_id": "<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
}{
"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.
Headers
Query Parameters
Comma-separated list: message.received, message.received.spam.
10 <= x <= 30030 <= x <= 3600Mailbox public ID to target when the credential grants access to more than one mailbox. Omit when the credential is scoped to exactly one mailbox.
Response
Server-sent event stream. Event data uses the MailboxRealtimeEvent shape.
message.received, message.received.spam, sync_required 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=..."
provider, rfc5322 Was this page helpful?