PATCH /messages/{messageId}
Ajusta flags (read/starred/labels)
- Acesso: Login
- Serviço:
https://mail-api.axuz.net
Autenticação aceita
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.
Parâmetros
| Nome | Em | Tipo | Obrigatório | Descrição |
|---|---|---|---|---|
messageId | path | string | sim |
Corpo da requisição
application/json · Obrigatório
| Nome | Tipo | Obrigatório | Descrição |
|---|---|---|---|
read | boolean | não | |
starred | boolean | não | |
labels | array<string> | não |
{
"read": true,
"starred": true,
"labels": [
"string"
]
}Respostas
200
Mensagem atualizada
| Nome | Tipo | Obrigatório | Descrição |
|---|---|---|---|
id | string<uuid> | sim | |
account_id | string<uuid> | sim | |
folder_id | string<uuid> | sim | |
thread_id | string<uuid> | sim | |
in_reply_to | string<uuid> | null | não | |
from_email | string<email> | sim | |
from_name | string | não | |
to_emails | array<string<email>> | sim | |
cc_emails | array<string<email>> | não | |
bcc_emails | array<string<email>> | não | |
subject | string | sim | |
body_html | string | não | Corpo HTML sanitizado (allowlist bluemonday, |
body_text | string | não | |
read | boolean | sim | |
starred | boolean | sim | |
labels | array<string> | não | |
received_at | string<date-time> | sim | |
sent_at | string<date-time> | null | não | |
status | string | sim | enum: |
internal | boolean | sim | |
created_at | string<date-time> | sim | |
updated_at | string<date-time> | sim |
401
Sem credencial valida
| Nome | Tipo | Obrigatório | Descrição |
|---|---|---|---|
error | string | sim |
403
Não é dono
404
Não achada
429
Limite de requisições excedido.
| Nome | Tipo | Obrigatório | Descrição |
|---|---|---|---|
error | string | sim |
500
Erro interno. Tente de novo com backoff; reporte o X-Request-Id.
| Nome | Tipo | Obrigatório | Descrição |
|---|---|---|---|
error | string | sim |
Exemplos
O "Try it" está desligado nesta referência. Use os exemplos com a sua credencial de teste.
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())