Apps — REST API (beta)

The harbor0 REST API lets your own scripts and apps use the files in My Drive.

Create an API key in the web app, then call https://api.harbor0.com over HTTPS with JSON. The API is in beta. The full reference and guides are at docs.harbor0.com.

05 — What the API covers

Routes for My Drive

The API reference lists every route an API key can call, with request and response shapes, and the same routes are available as an OpenAPI file for code generators.

Account
Your account, storage use, and whether end-to-end encryption is on.
Browsing
List folders, look items up by name, read details, search and measure folder sizes.
Managing
Create folders, rename, move, favorite, move to the Trash, restore and delete.
Uploads
Upload files of any size in parts, resume uploads and add new versions.
Downloads
Download any file or earlier version, or a whole folder as a ZIP.
Encryption
Read the wrapped keys of an end-to-end encrypted account, so your code can decrypt it.

06 — How it behaves

01
In beta
Routes and limits may still change while the API is in beta. The API documentation at docs.harbor0.com always describes the current version.
02
My Drive only
An API key can use the files in My Drive. Signing in, account settings, sharing, devices and creating keys need the harbor0 apps, so a leaked key can’t take over your account.
03
Read-only or read and write
A read-only key can list, search and download. Anything that changes files needs a read and write key.
04
Keys are shown once
harbor0 stores only a hash of each key. If you lose one, revoke it and create another. You can have up to 20 keys.
05
Each key is a device
Keys are listed under Devices as well as in Settings, with the app name your requests send in User-Agent. Signing out the device or revoking the key stops it at once.
06
Rate limits
600 requests a minute for each account, 300 for each key within that, and 1,800 a minute for upload routes, counted separately.
07
Safe retries
Every write carries an operation ID. Retrying with the same ID never repeats a change that already went through.
08
Signed links for file contents
Uploads and downloads go straight to storage through short-lived signed URLs. Send your key to api.harbor0.com only, never to those URLs.

07 — Troubleshooting

There is no harbor0 API card in Settings.

API keys are created in the web app at app.harbor0.com, under Settings. If the card isn’t there, reload the page to load the latest version of the web app.

401 AUTH_REQUIRED or AUTH_INVALID

AUTH_REQUIRED means the request had no Authorization header. AUTH_INVALID means the key is wrong, expired or revoked. Check the header reads Authorization: Bearer h0_pat_…, and create a new key if this one has expired.

403 TOKEN_NOT_ALLOWED

API keys can’t call this route. Keys only reach My Drive; sharing, devices, account settings and keys themselves are managed in the harbor0 apps.

403 TOKEN_SCOPE

A read-only key tried to change something. Create a read and write key for tools that upload, move or delete.

403 E2EE_UNSUPPORTED

Your account uses end-to-end encryption and the request didn’t include X-Harbor-E2EE: h0e1. Add the header only once your code encrypts and decrypts names and contents, as the encryption guides describe.

File names look like h0e1.… and files won’t open.

The account is end-to-end encrypted, so names and contents arrive encrypted. Decrypt them with your passphrase or recovery key, as shown in Decrypting file names and Decrypting files.

409 REVISION_CONFLICT

The item changed since you read it, for example on another device. Read it again and retry with the new revision.

409 NAME_CONFLICT

Something with that name is already in the folder. Choose another name, or upload a new version of the existing file.

409 STORAGE_QUOTA_EXCEEDED

There isn’t room for the file. The error includes the bytes needed and the bytes available. Free some space, or get more storage.

429 RATE_LIMITED

Too many requests. Wait for the number of seconds in the Retry-After header, then retry with the same operation ID.

Uploading to a signed URL fails.

Send the bytes to the signed URL without your Authorization header, and keep the ETag each part returns: completing the upload needs it. Part URLs expire, so ask for new ones if an upload was paused.

Something else went wrong.

Every error includes a requestId. Look the code up in Errors and rate limits, and include the request ID if you contact support.

08 — Related

Every harbor0 account has 10 GB of free storage, and paid plans start at $19 a year.