GET /messages/{messageId}
Lê mensagem + thread completa + anexos
- Access: Signed in
- Service:
https://mail-api.axuz.net
Accepted authentication
sessionCookie— Sessão plena Axuz (cookie de sessão da casa). Sessão restrita é 403 enrollment_required.bearerSession— JWT de acesso da sessão em `Authorization: Bearer`.
— GET /messages/:messageId. Retorna a mensagem foco, toda a thread (mesmo thread_id na mesma account) e os anexos. Gate via ownsAccount. Motivo: painel de leitura do webmail precisa da thread inteira num único fetch.
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
messageId | path | string | yes |
Responses
200
Foco + thread + anexos
| Name | Type | Required | Description |
|---|---|---|---|
message | MailMessage | yes | |
message.id | string<uuid> | yes | |
message.account_id | string<uuid> | yes | |
message.folder_id | string<uuid> | yes | |
message.thread_id | string<uuid> | yes | |
message.in_reply_to | string<uuid> | null | no | |
message.from_email | string<email> | yes | |
message.from_name | string | no | |
message.to_emails | array<string<email>> | yes | |
message.cc_emails | array<string<email>> | no | |
message.bcc_emails | array<string<email>> | no | |
message.subject | string | yes | |
message.body_html | string | no | Corpo HTML sanitizado (allowlist bluemonday, |
message.body_text | string | no | |
message.read | boolean | yes | |
message.starred | boolean | yes | |
message.labels | array<string> | no | |
message.received_at | string<date-time> | yes | |
message.sent_at | string<date-time> | null | no | |
message.status | string | yes | enum: |
message.internal | boolean | yes | |
message.created_at | string<date-time> | yes | |
message.updated_at | string<date-time> | yes | |
thread | array<MailMessage> | yes | |
thread[].id | string<uuid> | yes | |
thread[].account_id | string<uuid> | yes | |
thread[].folder_id | string<uuid> | yes | |
thread[].thread_id | string<uuid> | yes | |
thread[].in_reply_to | string<uuid> | null | no | |
thread[].from_email | string<email> | yes | |
thread[].from_name | string | no | |
thread[].to_emails | array<string<email>> | yes | |
thread[].cc_emails | array<string<email>> | no | |
thread[].bcc_emails | array<string<email>> | no | |
thread[].subject | string | yes | |
thread[].body_html | string | no | Corpo HTML sanitizado (allowlist bluemonday, |
thread[].body_text | string | no | |
thread[].read | boolean | yes | |
thread[].starred | boolean | yes | |
thread[].labels | array<string> | no | |
thread[].received_at | string<date-time> | yes | |
thread[].sent_at | string<date-time> | null | no | |
thread[].status | string | yes | enum: |
thread[].internal | boolean | yes | |
thread[].created_at | string<date-time> | yes | |
thread[].updated_at | string<date-time> | yes | |
attachments | array<MailAttachment> | yes | |
attachments[].id | string<uuid> | yes | |
attachments[].message_id | string<uuid> | yes | |
attachments[].filename | string | yes | |
attachments[].content_type | string | no | |
attachments[].size_bytes | integer | yes | |
attachments[].file_id | string<uuid> | null | no |
400
ID inválido
401
Sem credencial valida
| Name | Type | Required | Description |
|---|---|---|---|
error | string | yes |
403
Não é dono
404
Não achada
429
Limite de requisições excedido.
| Name | Type | Required | Description |
|---|---|---|---|
error | string | yes |
500
Erro interno. Tente de novo com backoff; reporte o X-Request-Id.
| Name | Type | Required | Description |
|---|---|---|---|
error | string | yes |
Examples
"Try it" is turned off in this reference. Use the examples with your test credential.
curl
curl -sS -X GET 'https://mail-api.axuz.net/messages/MESSAGE_ID' \
-H "Authorization: Bearer $AXUZ_TOKEN"Node.js
const res = await fetch("https://mail-api.axuz.net/messages/MESSAGE_ID", {
method: 'GET',
headers: {
Authorization: `Bearer ${process.env.AXUZ_TOKEN}`,
},
});
if (!res.ok) throw new Error(`HTTP ${res.status}: ${await res.text()}`);
console.log(await res.json());Python
import os
import requests
res = requests.request(
"GET",
"https://mail-api.axuz.net/messages/MESSAGE_ID",
headers={
"Authorization": f"Bearer {os.environ['AXUZ_TOKEN']}",
},
timeout=30,
)
res.raise_for_status()
print(res.json())