POST /me/files/init-upload
Reservar row + emitir upload URL (personal)
- 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`.
Storage key user/{userID}/{fileID}/{name}. Quota via users.storage_quota_bytes (default 100MB signup Fase 130). 413 com personal_quota_exceeded quando estourar.
This operation's description comes from the handler comment in the code (in Portuguese).
Parameters
No parameters.
Request body
application/json · Required
| Name | Type | Required | Description |
|---|---|---|---|
folder_id | string<uuid> | no | |
name | string | yes | |
content_type | string | yes | MIME normalizado; validado contra allowlist. |
size_bytes | integer | yes | |
content_hash | string | no | SHA256 hex opcional (dedup); ignorado com contexto. |
context_type | string | no | Contexto privado. enum: |
context_id | string<uuid> | no | Id da tarefa ou do board (exige |
{
"folder_id": "00000000-0000-0000-0000-000000000000",
"name": "string",
"content_type": "string",
"size_bytes": 1,
"content_hash": "string",
"context_type": "task_deliverable",
"context_id": "00000000-0000-0000-0000-000000000000"
}Responses
201
Criado
| Name | Type | Required | Description |
|---|---|---|---|
file | FilesFile | yes | |
file.id | string<uuid> | yes | |
file.team_id | string<uuid> | null | no | NULL em drive pessoal. |
file.folder_id | string<uuid> | null | no | |
file.uploaded_by | string<uuid> | no | |
file.name | string | yes | |
file.content_type | string | yes | |
file.size_bytes | integer | yes | |
file.storage_key | string | yes | Chave opaca no storage provider (S3/R2/B2/Bunny/local). |
file.status | string | yes | enum: |
file.created_at | string<date-time> | yes | |
file.completed_at | string<date-time> | null | no | |
file.context_type | string | null | no | enum: |
file.context_id | string<uuid> | null | no | |
file.context_label | string | null | no | |
file.thumb_key | string | null | no | |
file.thumb_width | integer | null | no | |
file.thumb_height | integer | null | no | |
upload_url | string | yes | URL presigned PUT (S3/R2/B2) OU path relativo |
presigned_url | string | no | Alias legado; presente apenas na variante |
401
Sem credencial valida
| Name | Type | Required | Description |
|---|---|---|---|
error | string | yes |
413
Quota pessoal excedida
| Name | Type | Required | Description |
|---|---|---|---|
error | string | no | enum: |
quota | integer | no | |
used | integer | no | |
requested | 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/init-upload' \
-H "Authorization: Bearer $AXUZ_TOKEN" \
-H "Content-Type: application/json" \
-d '{"folder_id":"00000000-0000-0000-0000-000000000000","name":"string","content_type":"string","size_bytes":1,"content_hash":"string","context_type":"task_deliverable","context_id":"00000000-0000-0000-0000-000000000000"}'Node.js
const res = await fetch("https://files-api.axuz.net/me/files/init-upload", {
method: 'POST',
headers: {
Authorization: `Bearer ${process.env.AXUZ_TOKEN}`,
'Content-Type': 'application/json',
},
body: JSON.stringify({
"folder_id": "00000000-0000-0000-0000-000000000000",
"name": "string",
"content_type": "string",
"size_bytes": 1,
"content_hash": "string",
"context_type": "task_deliverable",
"context_id": "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/init-upload",
headers={
"Authorization": f"Bearer {os.environ['AXUZ_TOKEN']}",
},
json={
"folder_id": "00000000-0000-0000-0000-000000000000",
"name": "string",
"content_type": "string",
"size_bytes": 1,
"content_hash": "string",
"context_type": "task_deliverable",
"context_id": "00000000-0000-0000-0000-000000000000",
},
timeout=30,
)
res.raise_for_status()
print(res.json())