POST /messages/{messageId}/move
Move pra outra folder (id explícito OU kind sistêmico)
- 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`.
— POST /messages/:messageId/move. Move a mensagem pra outra folder da mesma account. Motivo: user arrasta mensagem pra label/arquivo. Comportamento: valida que a folder alvo pertence à account (400 se cross-account); atualiza folder_id + updated_at. Gate: ownsAccount.
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 |
|---|---|---|---|
folder_id | string<uuid> | null | não | |
kind | string | não | enum: |
{
"folder_id": "00000000-0000-0000-0000-000000000000",
"kind": "inbox"
}Respostas
200
Mensagem movida
| 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 |
400
folder_id/kind ausentes ou folder de outra account
401
Sem credencial valida
| Nome | Tipo | Obrigatório | Descrição |
|---|---|---|---|
error | string | sim |
403
Não é dono
404
Kind sistêmica 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 POST 'https://mail-api.axuz.net/messages/MESSAGE_ID/move' \
-H "Authorization: Bearer $AXUZ_TOKEN" \
-H "Content-Type: application/json" \
-d '{"folder_id":"00000000-0000-0000-0000-000000000000","kind":"inbox"}'Node.js
const res = await fetch("https://mail-api.axuz.net/messages/MESSAGE_ID/move", {
method: 'POST',
headers: {
Authorization: `Bearer ${process.env.AXUZ_TOKEN}`,
'Content-Type': 'application/json',
},
body: JSON.stringify({
"folder_id": "00000000-0000-0000-0000-000000000000",
"kind": "inbox"
}),
});
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(
"POST",
"https://mail-api.axuz.net/messages/MESSAGE_ID/move",
headers={
"Authorization": f"Bearer {os.environ['AXUZ_TOKEN']}",
},
json={
"folder_id": "00000000-0000-0000-0000-000000000000",
"kind": "inbox",
},
timeout=30,
)
res.raise_for_status()
print(res.json())