POST /messages/{messageId}/move
Move pra outra folder (id explícito OU kind sistêmico)
- 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`.
— 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.
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
messageId | path | string | yes |
Request body
application/json · Required
| Name | Type | Required | Description |
|---|---|---|---|
folder_id | string<uuid> | null | no | |
kind | string | no | enum: |
{
"folder_id": "00000000-0000-0000-0000-000000000000",
"kind": "inbox"
}Responses
200
Mensagem movida
| 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 |
400
folder_id/kind ausentes ou folder de outra account
401
Sem credencial valida
| Name | Type | Required | Description |
|---|---|---|---|
error | string | yes |
403
Não é dono
404
Kind sistêmica 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 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())