Axuz Developers

POST /teams/{teamId}/files/{fileId}/restore

Restaurar file da lixeira

  • Access: Signed in
  • 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`.

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).

Parameters

NameInTypeRequiredDescription
teamIdpathstringyes
fileIdpathstringyes

Request body

Corpo JSON. O schema detalhado deste endpoint ainda não está tipado na spec; veja a descrição da operação.

application/json

NameTypeRequiredDescription
(corpo)objectno
{}

Responses

200

Restaurado

NameTypeRequiredDescription
fileFilesFileno
file.idstring<uuid>yes
file.team_idstring<uuid> | nullno

NULL em drive pessoal.

file.folder_idstring<uuid> | nullno
file.uploaded_bystring<uuid>no
file.namestringyes
file.content_typestringyes
file.size_bytesintegeryes
file.storage_keystringyes

Chave opaca no storage provider (S3/R2/B2/Bunny/local).

file.statusstringyes

enum: "pending", "uploaded", "scanning", "ready", "infected"

file.created_atstring<date-time>yes
file.completed_atstring<date-time> | nullno
file.context_typestring | nullno

enum: "bill", "receivable", "payment", "receipt", "task", "timeline_post", "wiki", "drive", null

file.context_idstring<uuid> | nullno
file.context_labelstring | nullno
file.thumb_keystring | nullno
file.thumb_widthinteger | nullno
file.thumb_heightinteger | nullno

400

Payload/params inválidos

NameTypeRequiredDescription
errorstringyes

Chave/slug do erro

messagestringno

401

Sem credencial valida

NameTypeRequiredDescription
errorstringyes

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.

NameTypeRequiredDescription
errorstringyes

500

Erro interno. Tente de novo com backoff; reporte o X-Request-Id.

NameTypeRequiredDescription
errorstringyes

503

Storage não respondeu (blip); a row fica na lixeira, tente de novo

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/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())