Files and Folders Reference
File and folder CRUD, versioning, copy, move.
Base paths: /api/v1/files/, /api/v1/folders/
File object#
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 | |
Folder object#
1 2 3 4 5 6 7 8 9 10 11 12 13 | |
Files#
GET /api/v1/files/{file_id}#
File metadata.
Required permission: READ.
GET /api/v1/files/{file_id}/content#
Stream file content.
Query: version — download a specific version.
Headers supported:
Range: bytes=start-end— partial content, returns 206.
Response headers:
Content-LengthContent-Disposition: attachment; filename="..."Accept-Ranges: bytes
Required permission: READ.
POST /api/v1/files#
Upload a new file (multipart). Returns 201.
Form fields:
| Field | Required | Notes |
|---|---|---|
share_id |
Yes | Destination share |
folder_id |
No | Destination folder; omit for root |
name |
No | Override filename |
file |
Yes | File content |
Required permission: CREATE on target folder / share root.
Errors:
| Code | When |
|---|---|
NAME_CONFLICT |
Sibling with same name exists |
PAYLOAD_TOO_LARGE |
Exceeds tenant max file size |
QUOTA_EXCEEDED |
Any applicable quota exceeded |
PATCH /api/v1/files/{file_id}#
Rename or update metadata.
Body: name.
Required permission: WRITE.
DELETE /api/v1/files/{file_id}#
Delete file.
Query: permanent (default false).
Required permission: DELETE.
POST /api/v1/files/{file_id}/copy#
Copy to another location. Returns 201.
Body:
1 2 3 4 5 | |
Exactly one of target_folder_id or target_share_id must be set.
Required permission: READ on source, CREATE on target.
POST /api/v1/files/{file_id}/move#
Move to another location.
Body: target_folder_id or target_share_id.
Required permission: DELETE on source, CREATE on target.
GET /api/v1/files/{file_id}/versions#
List version history.
Required permission: READ.
Response:
1 2 3 4 5 6 | |
POST /api/v1/files/{file_id}/versions/{version}/restore#
Restore a previous version (creates a new version with that content).
Required permission: WRITE.
Response: {id, restored_version, new_version_id}.
Folders#
GET /api/v1/folders/{folder_id}#
Folder metadata. Use the special ID root to address the share root.
Required permission: READ.
GET /api/v1/folders/{folder_id}/children#
List folder contents.
Query:
| Param | Notes |
|---|---|
share_id |
Required |
include_deleted |
Default false |
Response:
1 2 3 4 5 6 7 8 | |
Required permission: READ.
POST /api/v1/folders#
Create folder. Returns 201.
Body:
| Field | Required | Notes |
|---|---|---|
share_id |
Yes | |
name |
Yes | |
parent_id |
No | Omit for root |
Required permission: CREATE on parent (or share).
PATCH /api/v1/folders/{folder_id}#
Rename.
Body: name.
Required permission: WRITE.
DELETE /api/v1/folders/{folder_id}#
Delete recursively.
Query: permanent.
Required permission: DELETE on folder and all descendants.
POST /api/v1/folders/{folder_id}/move#
Move folder.
Body: target_parent_id or target_share_id.
Required permission: DELETE on source, CREATE on target.
Error codes common to both#
| Code | HTTP | When |
|---|---|---|
NOT_FOUND |
404 | Doesn't exist or not visible |
NAME_CONFLICT |
409 | Sibling name collision |
INVALID_PATH |
400 | Invalid name characters |
RESOURCE_DELETED |
410 | Soft-deleted |
AUTHZ_PERMISSION_DENIED |
403 | Missing permission |
PAYLOAD_TOO_LARGE |
413 | File size limit |
QUOTA_EXCEEDED |
507 | Any applicable quota |