POST /teams/{teamId}/files/{fileId}/restore
Restaurar file da lixeira
- Acesso: Login
- Serviço:
https://files-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`.
F-077. Tira a marca de soft-delete, DEPOIS de confirmar via HeadObject que os bytes ainda estão no storage.
Desde o O-015 o DELETE não apaga mais os bytes no request: o arquivo fica restaurável durante o grace period (DRIVE_TRASH_GRACE, default 7d) e só então a varredura purga. O HeadObject continua como guarda de última instância — 409 significa que o grace period venceu ou que alguém purgou de propósito.
Autorização: uploader OU team admin/owner (espelha o DELETE).
Parâmetros
| Nome | Em | Tipo | Obrigatório | Descrição |
|---|---|---|---|---|
teamId | path | string | sim | |
fileId | path | string | sim |
Corpo da requisição
Corpo JSON. O schema detalhado deste endpoint ainda não está tipado na spec; veja a descrição da operação.
application/json
| Nome | Tipo | Obrigatório | Descrição |
|---|---|---|---|
(corpo) | object | não |
{}Respostas
200
Restaurado
| Nome | Tipo | Obrigatório | Descrição |
|---|---|---|---|
file | FilesFile | não | |
file.id | string<uuid> | sim | |
file.team_id | string<uuid> | null | não | NULL em drive pessoal. |
file.folder_id | string<uuid> | null | não | |
file.uploaded_by | string<uuid> | não | |
file.name | string | sim | |
file.content_type | string | sim | |
file.size_bytes | integer | sim | |
file.storage_key | string | sim | Chave opaca no storage provider (S3/R2/B2/Bunny/local). |
file.status | string | sim | enum: |
file.created_at | string<date-time> | sim | |
file.completed_at | string<date-time> | null | não | |
file.context_type | string | null | não | enum: |
file.context_id | string<uuid> | null | não | |
file.context_label | string | null | não | |
file.thumb_key | string | null | não | |
file.thumb_width | integer | null | não | |
file.thumb_height | integer | null | não |
400
Payload/params inválidos
| Nome | Tipo | Obrigatório | Descrição |
|---|---|---|---|
error | string | sim | Chave/slug do erro |
message | string | não |
401
Sem credencial valida
| Nome | Tipo | Obrigatório | Descrição |
|---|---|---|---|
error | string | sim |
404
Não está na lixeira (ou é de outro team)
409
Objeto já purgado do storage — não há o que restaurar
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 |
503
Storage não respondeu (blip); a row fica na lixeira, tente de novo
Exemplos
O "Try it" está desligado nesta referência. Use os exemplos com a sua credencial de teste.
curl
curl -sS -X POST 'https://files-api.axuz.net/teams/TEAM_ID/files/FILE_ID/restore' \
-H "Authorization: Bearer $AXUZ_TOKEN" \
-H "Content-Type: application/json" \
-d '{}'Node.js
const res = await fetch("https://files-api.axuz.net/teams/TEAM_ID/files/FILE_ID/restore", {
method: 'POST',
headers: {
Authorization: `Bearer ${process.env.AXUZ_TOKEN}`,
'Content-Type': 'application/json',
},
body: JSON.stringify({}),
});
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/teams/TEAM_ID/files/FILE_ID/restore",
headers={
"Authorization": f"Bearer {os.environ['AXUZ_TOKEN']}",
},
json={},
timeout=30,
)
res.raise_for_status()
print(res.json())