POST /me/files/migrate
Migrar files pessoais → workspace (Fase 133b)
- Access: Team member
- Service:
https://files-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`.
Batch (máx 200 por chamada). Lock em files_files FOR UPDATE por arquivo; CopyObject primary storage; commit UPDATE de team_id + storage_key; best-effort DeleteObject do old key (fica órfão se falhar — worker file_purge recolhe).
Parameters
No parameters.
Request body
application/json · Required
| Name | Type | Required | Description |
|---|---|---|---|
team_id | string<uuid> | yes | |
file_ids | array<string<uuid>> | yes |
{
"team_id": "00000000-0000-0000-0000-000000000000",
"file_ids": [
"00000000-0000-0000-0000-000000000000"
]
}Responses
200
OK — resultado batch (migrated + errors por arquivo)
| Name | Type | Required | Description |
|---|---|---|---|
migrated | array<FilesFile> | no | |
migrated[].id | string<uuid> | yes | |
migrated[].team_id | string<uuid> | null | no | NULL em drive pessoal. |
migrated[].folder_id | string<uuid> | null | no | |
migrated[].uploaded_by | string<uuid> | no | |
migrated[].name | string | yes | |
migrated[].content_type | string | yes | |
migrated[].size_bytes | integer | yes | |
migrated[].storage_key | string | yes | Chave opaca no storage provider (S3/R2/B2/Bunny/local). |
migrated[].status | string | yes | enum: |
migrated[].created_at | string<date-time> | yes | |
migrated[].completed_at | string<date-time> | null | no | |
migrated[].context_type | string | null | no | enum: |
migrated[].context_id | string<uuid> | null | no | |
migrated[].context_label | string | null | no | |
migrated[].thumb_key | string | null | no | |
migrated[].thumb_width | integer | null | no | |
migrated[].thumb_height | integer | null | no | |
errors | array<object> | no | |
errors[].file_id | string<uuid> | no | |
errors[].error | string | no |
401
Sem credencial valida
| Name | Type | Required | Description |
|---|---|---|---|
error | string | yes |
403
Caller não é membro do target team
413
Team quota excedida
| Name | Type | Required | Description |
|---|---|---|---|
error | string | no | enum: |
available_bytes | integer | no | |
needed_bytes | integer | no |
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://files-api.axuz.net/me/files/migrate' \
-H "Authorization: Bearer $AXUZ_TOKEN" \
-H "Content-Type: application/json" \
-d '{"team_id":"00000000-0000-0000-0000-000000000000","file_ids":["00000000-0000-0000-0000-000000000000"]}'Node.js
const res = await fetch("https://files-api.axuz.net/me/files/migrate", {
method: 'POST',
headers: {
Authorization: `Bearer ${process.env.AXUZ_TOKEN}`,
'Content-Type': 'application/json',
},
body: JSON.stringify({
"team_id": "00000000-0000-0000-0000-000000000000",
"file_ids": [
"00000000-0000-0000-0000-000000000000"
]
}),
});
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://files-api.axuz.net/me/files/migrate",
headers={
"Authorization": f"Bearer {os.environ['AXUZ_TOKEN']}",
},
json={
"team_id": "00000000-0000-0000-0000-000000000000",
"file_ids": [
"00000000-0000-0000-0000-000000000000",
],
},
timeout=30,
)
res.raise_for_status()
print(res.json())