Folders, moves and trash
Every change on this page takes an operationId (a new UUID per change) and, for existing items, the baseRevision you last saw. Both are explained in Requests and responses. Each successful change returns the item as it is now, with its new revision.
Create a folder
curl -s https://api.harbor0.com/v1/drive/folders \
-H "Authorization: Bearer $HARBOR0_TOKEN" -H 'Content-Type: application/json' \
-d '{"operationId":"'"$(uuidgen)"'","parentId":null,"name":"Invoices"}'parentId is the folder to create it in, or null for the top of My Drive. If the name is taken you get 409 NAME_CONFLICT; use lookup to find the existing folder.
Rename
PATCH /v1/drive/items/{id}
{ "operationId": "…", "baseRevision": 3, "name": "Invoices 2026" }Move
POST /v1/drive/items/{id}/move
{ "operationId": "…", "baseRevision": 3, "parentId": "9b7d…", "name": "optional new name" }Set parentId to null to move an item to the top of My Drive. Add name to rename it in the same step, which avoids a clash when the destination already has something with the old name. A folder cannot be moved inside itself.
Set a file's modified time
PATCH /v1/drive/items/{id}/modified
{ "baseRevision": 3, "modifiedAt": "2026-11-30T09:12:44.000Z" }This changes only modifiedAt, which is the time the apps show and sync by. The content and revision stay the same. Uploads can set it directly too (see Uploading files).
Favorites
PUT /v1/drive/items/{id}/favorite { "operationId": "…", "baseRevision": 3 }
DELETE /v1/drive/items/{id}/favorite { "operationId": "…", "baseRevision": 3 }Move to trash
DELETE /v1/drive/items/{id}
{ "operationId": "…", "baseRevision": 3 }The item and everything inside it go to the trash. Trashed items keep using storage until you delete them for good or empty the trash.
Restore from trash
POST /v1/drive/items/{id}/restore
{ "operationId": "…", "baseRevision": 4 }The item goes back to the folder it came from. If that folder has since gained an item with the same name, the restore fails with 409 NAME_CONFLICT.
Delete for good
DELETE /v1/drive/items/{id}/permanent
{ "operationId": "…", "baseRevision": 4 }Only items already in the trash can be deleted for good. The response is { "deleted": true }; a large folder's content is removed in the background, and a jobId is returned for it. This cannot be undone.
Empty the trash
POST /v1/drive/trash/empty
{ "operationId": "…" }Everything in the trash is deleted for good, at once. The response gives the number of items, and the stored content is removed in the background. This cannot be undone.
Restore an earlier version
POST /v1/drive/items/{id}/versions/{versionId}/restore
{ "operationId": "…", "baseRevision": 5 }A copy of the chosen version is added as the newest version, so every version in between is kept and restoring never loses anything. The restored version counts against your storage like an upload. List versions with GET /v1/drive/items/{id}/versions.