harbor0APIBeta

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

Requests and responses

JSON in, JSON out

Requests with a body send JSON with Content-Type: application/json. Every response, including errors, is JSON. Most routes refuse fields they do not know with VALIDATION_ERROR, so send only the fields documented for each route.

Items

Files and folders are both items. An item looks like this:

{
  "id": "c41f0a8e-…",
  "type": "FILE",
  "name": "notes.txt",
  "parentId": "9b7d…",
  "sizeBytes": 812,
  "mimeType": "text/plain",
  "contentHash": "5e884898da28047151d0e56f8dc6292773603d0d6aabbdd62a11ef721d1542d8",
  "currentVersionId": "1d2e…",
  "revision": 3,
  "favorite": false,
  "modifiedAt": "2026-11-30T09:12:44.000Z",
  "fileCreatedAt": "2026-11-02T18:01:10.000Z",
  "createdAt": "2026-11-30T09:13:02.511Z",
  "updatedAt": "2026-11-30T09:13:02.511Z",
  "deletedAt": null,
  "encrypted": false
}
  • parentId is null for items at the top of My Drive. In URL paths, the top folder is written root.
  • revision goes up by one each time the item changes. You send it back as baseRevision when you change the item (see below).
  • contentHash is the SHA-256, in hex, of the stored bytes of the current version.
  • modifiedAt and fileCreatedAt are the file's own times, as the uploading device saw them. createdAt and updatedAt are when harbor0 stored and last changed the item.
  • deletedAt is set while the item is in the trash.
  • encrypted is true when the current version is end-to-end encrypted. Its name is then an encrypted h0e1.… token and sizeBytes is the stored (encrypted) size. See Decrypting file names.

Operation IDs make writes safe to retry

Most writes take an operationId: a new random UUID (version 4) that you make for each change.

{ "operationId": "0f8fad5b-d9cb-469f-a165-70867728950e", "baseRevision": 3, "name": "notes-2026.txt" }

If a request fails part way, for example because the connection dropped, send exactly the same request with the same operation ID again. harbor0 remembers operations for 7 days: if the first attempt went through, you get its original result back rather than a second change. Reusing an operation ID for a different request is refused with 409 IDEMPOTENCY_KEY_REUSED.

Make a new operation ID for each new change, and keep it while you retry that change.

Revisions guard against overwriting

Changes to an existing item send the baseRevision you last saw. If someone else changed the item since (another device, the web app, another script), the request is refused with 409 REVISION_CONFLICT and nothing changes. Read the item again with GET /v1/drive/items/{id}, decide what to do, and retry with the new revision and a new operation ID.

Paging

Lists return up to limit items (1 to 500) and a nextCursor. Pass the cursor back to get the next page, until it is null:

curl -s "https://api.harbor0.com/v1/drive/folders/root/children?limit=500&cursor=$CURSOR" \
  -H "Authorization: Bearer $HARBOR0_TOKEN"

Cursors are opaque strings. Use them soon after you get them and only with the request they came from.

Names

  • A name is 1 to 240 characters and cannot contain /, \ or control characters, or be . or ...
  • Names are unique within a folder, compared without case: Report.pdf and report.pdf cannot share a folder. Creating, moving or renaming onto a taken name fails with 409 NAME_CONFLICT.
  • Names are kept in Unicode NFC form.
  • On encrypted accounts, names are h0e1.… tokens of up to 400 characters, made from real names of up to 255 UTF-8 bytes. There, names are compared exactly, so names that differ only in case can share a folder.

Times

All times are ISO 8601 in UTC with a Z, such as 2026-12-03T10:15:00.000Z. Times you send must use the same form.

IDs

IDs are opaque strings of letters, digits, - and _, up to 128 characters. Do not parse them.