PATCH /messages/{messageId}
Ajusta flags (read/starred/labels)
- 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`.
— PATCH /messages/:messageId. Ajusta flags visuais (read/starred/labels). Motivo: user marca lido/estrela/label sem mover de folder. Gate: ownsAccount da mensagem. COALESCE mantém campos que o cliente omitiu.
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
messageId | path | string | yes |
Request body
application/json · Required
| Name | Type | Required | Description |
|---|---|---|---|
read | boolean | no | |
starred | boolean | no | |
labels | array<string> | no |
{
"read": true,
"starred": true,
"labels": [
"string"
]
}Responses
200
Mensagem atualizada
| Name | Type | Required | Description |
|---|---|---|---|
id | string<uuid> | yes | |
account_id | string<uuid> | yes | |
folder_id | string<uuid> | yes | |
thread_id | string<uuid> | yes | |
in_reply_to | string<uuid> | null | no | |
from_email | string<email> | yes | |
from_name | string | no | |
to_emails | array<string<email>> | yes | |
cc_emails | array<string<email>> | no | |
bcc_emails | array<string<email>> | no | |
subject | string | yes | |
body_html | string | no | Corpo HTML sanitizado (allowlist bluemonday, |
body_text | string | no | |
read | boolean | yes | |
starred | boolean | yes | |
labels | array<string> | no | |
received_at | string<date-time> | yes | |
sent_at | string<date-time> | null | no | |
status | string | yes | enum: |
internal | boolean | yes | |
created_at | string<date-time> | yes | |
updated_at | string<date-time> | yes |
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 PATCH 'https://mail-api.axuz.net/messages/MESSAGE_ID' \
-H "Authorization: Bearer $AXUZ_TOKEN" \
-H "Content-Type: application/json" \
-d '{"read":true,"starred":true,"labels":["string"]}'Node.js
const res = await fetch("https://mail-api.axuz.net/messages/MESSAGE_ID", {
method: 'PATCH',
headers: {
Authorization: `Bearer ${process.env.AXUZ_TOKEN}`,
'Content-Type': 'application/json',
},
body: JSON.stringify({
"read": true,
"starred": true,
"labels": [
"string"
]
}),
});
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(
"PATCH",
"https://mail-api.axuz.net/messages/MESSAGE_ID",
headers={
"Authorization": f"Bearer {os.environ['AXUZ_TOKEN']}",
},
json={
"read": True,
"starred": True,
"labels": [
"string",
],
},
timeout=30,
)
res.raise_for_status()
print(res.json())