Listing and finding files
List a folder
GET /v1/drive/folders/{folderId}/children?limit=500&cursor=…Use root as the folder ID for the top of My Drive. Items in the trash are left out. Results come in pages of up to limit items (default 100, at most 500); follow nextCursor until it is null.
curl -s "https://api.harbor0.com/v1/drive/folders/root/children?limit=500" \
-H "Authorization: Bearer $HARBOR0_TOKEN"To walk a whole tree, list a folder, then list each child whose type is FOLDER. Keep a few requests in flight at most, and stay within the rate limits.
Find an item by name
To check whether a folder holds something with a given name, look it up rather than listing the whole folder:
GET /v1/drive/folders/{folderId}/lookup?name=notes.txtThe name is compared the way harbor0 keeps names unique: without case on ordinary accounts, exactly on encrypted ones. The response is { "item": … }, or 404 ITEM_NOT_FOUND when nothing has that name. On an encrypted account, pass the encrypted name (see Decrypting file names).
This is the quickest way to resolve a path such as Taxes/2026/receipt.pdf: look up Taxes in root, then 2026 in that folder, then the file.
Read one item
GET /v1/drive/items/{id}Returns { "item": … } with the fields described in Requests and responses.
Search
GET /v1/search?q=invoice&type=FILE&limit=100Search works on the account's file metadata. All filters are optional and combine:
| Parameter | Matches |
|---|---|
q | Names that contain the text, ignoring case. |
type | FILE or FOLDER. |
extension | Names ending in .extension, such as pdf. |
mimeType | An exact MIME type, such as image/jpeg. |
parentId | Items directly inside one folder (root for the top). |
favorite | true for favorites only. |
trash | true to search the trash instead of live items. |
createdAfter, createdBefore, updatedAfter, updatedBefore | ISO 8601 times. |
Results are paged with limit and cursor like folder listings.
GET /v1/search?trash=true is how you list everything in the trash.
On end-to-end encrypted accounts the server cannot read names or types, so q, extension and mimeType don't find anything useful. List the folders and decrypt names on your side instead.
Folder sizes
GET /v1/drive/usage?ids=folderId1,folderId2Returns, for each folder, the bytes and number of files stored under it, every stored version included. complete is false while harbor0 is still counting a large folder; ask again a little later.
Versions of a file
GET /v1/drive/items/{id}/versionsEvery upload to an existing file keeps the earlier content as a version. The response lists them newest first, each with its own id, sizeBytes, contentHash and createdAt. Download one by passing its versionId to POST /v1/downloads, or make it current again with restore.