harbor0APIBeta

Beta. The harbor0 API is still in beta, so routes and responses may change before it is final. What beta means

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

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

GET /v1/search?q=invoice&type=FILE&limit=100

Search works on the account's file metadata. All filters are optional and combine:

ParameterMatches
qNames that contain the text, ignoring case.
typeFILE or FOLDER.
extensionNames ending in .extension, such as pdf.
mimeTypeAn exact MIME type, such as image/jpeg.
parentIdItems directly inside one folder (root for the top).
favoritetrue for favorites only.
trashtrue to search the trash instead of live items.
createdAfter, createdBefore, updatedAfter, updatedBeforeISO 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,folderId2

Returns, 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}/versions

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