API reference
Every route a personal access token can call, generated from harbor0's OpenAPI description. All routes live on https://api.harbor0.com and take Authorization: Bearer <token>; on end-to-end encrypted accounts, file routes also need X-Harbor-E2EE: h0e1. Field types are shown TypeScript-style: ? marks a field you may leave out. The same routes are available as an OpenAPI file for code generators.
Account
Guide: account.
GET /v1/users/me
Current account, quota, and the features turned on for it on this app.
Response (returns User, Storage):
GET /v1/e2ee
End-to-end encryption: whether it is on, the wrapped keys and unlocked devices.
Response (returns E2eeState):
{
e2ee: E2eeState
}Browsing
Guide: browsing.
GET /v1/drive/items/{id}
Read item metadata.
| Parameter | In | Type |
|---|---|---|
id | path | string |
Response (returns Item):
{
item: Item
}GET /v1/drive/folders/{id}/children
List a folder.
| Parameter | In | Type |
|---|---|---|
id | path | string |
cursor (optional) | query | string |
limit (optional) | query | number |
Response (returns Item):
{
items: Item[]
nextCursor: string | null
}GET /v1/drive/folders/{id}/lookup
Find the item with a name in a folder, compared the way names are kept unique.
| Parameter | In | Type |
|---|---|---|
id | path | string |
name | query | string |
Response (returns Item):
{
item: Item
}GET /v1/search
Search file metadata.
| Parameter | In | Type |
|---|---|---|
cursor (optional) | query | string |
limit (optional) | query | number |
q (optional) | query | string |
type (optional) | query | string |
mimeType (optional) | query | string |
extension (optional) | query | string |
parentId (optional) | query | string |
createdAfter (optional) | query | string |
createdBefore (optional) | query | string |
updatedAfter (optional) | query | string |
updatedBefore (optional) | query | string |
favorite (optional) | query | string |
trash (optional) | query | string |
recent (optional) | query | string |
Response (returns Item):
{
items: Item[]
nextCursor: string | null
}GET /v1/drive/items/{id}/versions
List file versions.
| Parameter | In | Type |
|---|---|---|
id | path | string |
Response (returns Version):
{
items: Version[]
}GET /v1/drive/usage
Read the storage used by folders, every stored version included.
| Parameter | In | Type |
|---|---|---|
ids (optional) | query | string |
Response:
{
items: {
itemId: string // up to 128 characters
bytes: number
files: number
complete: boolean
}[]
}Changing items
Guide: changing items.
PATCH /v1/drive/items/{id}
Rename an item.
| Parameter | In | Type |
|---|---|---|
id | path | string |
Request body:
{
operationId: string // UUID
baseRevision: number
name: string // up to 400 characters
}Response (returns Item):
{
item: Item
}DELETE /v1/drive/items/{id}
Move to trash.
| Parameter | In | Type |
|---|---|---|
id | path | string |
Request body:
{
operationId: string // UUID
baseRevision: number
}Response (returns Item):
{
item: Item
}PATCH /v1/drive/items/{id}/modified
Set a file's modification time without changing its content or revision.
| Parameter | In | Type |
|---|---|---|
id | path | string |
Request body:
{
baseRevision: number
modifiedAt: string // ISO 8601 time
}Response (returns Item):
{
item: Item
}POST /v1/drive/folders
Create folder.
Request body:
{
operationId: string // UUID
parentId?: string | null // up to 128 characters
name: string // up to 400 characters
}Response (returns Item):
{
item: Item
}POST /v1/drive/items/{id}/move
Move an item, renaming it on the way when a name is given.
| Parameter | In | Type |
|---|---|---|
id | path | string |
Request body:
{
operationId: string // UUID
baseRevision: number
parentId: string | null // up to 128 characters
name?: string // up to 400 characters
}Response (returns Item):
{
item: Item
}POST /v1/drive/items/{id}/restore
Restore from trash.
| Parameter | In | Type |
|---|---|---|
id | path | string |
Request body:
{
operationId: string // UUID
baseRevision: number
}Response (returns Item):
{
item: Item
}DELETE /v1/drive/items/{id}/permanent
Permanently delete a trashed item.
| Parameter | In | Type |
|---|---|---|
id | path | string |
Request body:
{
operationId: string // UUID
baseRevision: number
}Response:
{
deleted: boolean
jobId?: string
}POST /v1/drive/trash/empty
Empty the trash at once; content is deleted in the background (cursor is ignored, nextCursor is always null).
Request body:
{
operationId: string // UUID
cursor?: string
}Response:
{
count: number
nextCursor: string | null
}PUT /v1/drive/items/{id}/favorite
Change favorite.
| Parameter | In | Type |
|---|---|---|
id | path | string |
Request body:
{
operationId: string // UUID
baseRevision: number
}Response (returns Item):
{
item: Item
}DELETE /v1/drive/items/{id}/favorite
Change favorite.
| Parameter | In | Type |
|---|---|---|
id | path | string |
Request body:
{
operationId: string // UUID
baseRevision: number
}Response (returns Item):
{
item: Item
}POST /v1/drive/items/{id}/versions/{versionId}/restore
Restore a version.
| Parameter | In | Type |
|---|---|---|
id | path | string |
versionId | path | string |
Request body:
{
operationId: string // UUID
baseRevision: number
}Response (returns Item):
{
item: Item
}Uploads
Guide: uploads.
POST /v1/uploads
Reserve quota and create upload.
Request body:
{
operationId: string // UUID
parentId?: string | null // up to 128 characters
name: string // up to 400 characters
sizeBytes: number
mimeType?: string // up to 255 characters
contentHash?: string | null // SHA-256, hex
driveItemId?: string // up to 128 characters
baseRevision?: number
encrypted?: boolean
modifiedAt?: string // ISO 8601 time
fileCreatedAt?: string // ISO 8601 time
}Response (returns Upload, Storage):
POST /v1/uploads/batch
Create several small uploads at once: each gets an upload and one storage part URL.
Request body:
{
uploads: ({
operationId: string // UUID
parentId?: string | null // up to 128 characters
name: string // up to 400 characters
sizeBytes: number
mimeType?: string // up to 255 characters
contentHash?: string | null // SHA-256, hex
driveItemId?: string // up to 128 characters
baseRevision?: number
encrypted?: boolean
modifiedAt?: string // ISO 8601 time
fileCreatedAt?: string // ISO 8601 time
})[]
}Response:
{
results: { … }[]
}POST /v1/uploads/batch/finish
Finish several small uploads at once.
Request body:
{
files: {
uploadId: string // up to 128 characters
etag: string // up to 256 characters
contentHash: string // SHA-256, hex
}[]
}Response:
{
results: { … }[]
}GET /v1/uploads/{id}
Resume an upload.
| Parameter | In | Type |
|---|---|---|
id | path | string |
Response (returns Upload):
{
upload: Upload
parts: {
partNumber: number // 1–10000
etag: string // up to 256 characters
}[]
}DELETE /v1/uploads/{id}
Abort upload and release reservation.
| Parameter | In | Type |
|---|---|---|
id | path | string |
Response (returns Upload):
{
upload: Upload
}POST /v1/uploads/{id}/parts
Sign upload part URLs.
| Parameter | In | Type |
|---|---|---|
id | path | string |
Request body:
{
partNumbers: number[] // 1–10000
}Response:
{
parts: {
partNumber: number
uploadUrl: string
expiresAt: string
}[]
}POST /v1/uploads/{id}/complete
Finalize upload atomically.
| Parameter | In | Type |
|---|---|---|
id | path | string |
Request body:
{
parts: {
partNumber: number // 1–10000
etag: string // up to 256 characters
}[]
contentHash: string // SHA-256, hex
}Response (returns Item):
{
item: Item
}Downloads
Guide: downloads.
POST /v1/folder-downloads
Prepare one folder ZIP in the background.
Request body:
{
operationId: string // UUID
driveItemId: string // up to 128 characters
}Response (returns FolderDownload):
GET /v1/folder-downloads/{id}
Read ZIP preparation progress.
| Parameter | In | Type |
|---|---|---|
id | path | string |
Response (returns FolderDownload):
DELETE /v1/folder-downloads/{id}
Cancel ZIP preparation.
| Parameter | In | Type |
|---|---|---|
id | path | string |
Response:
{
cancelled: boolean
}POST /v1/downloads
Authorize a short-lived download.
Request body:
{
folderDownloadId?: string // up to 128 characters
driveItemId?: string // up to 128 characters
versionId?: string | null // up to 128 characters
}Response (returns DownloadLink):
Objects
The objects routes return. Object names in the code above link here, and each object lists the routes that return it.
User
Your account, as GET /v1/users/me returns it.
{
id: string
email: string
emailVerified: boolean
username: string
displayName: string
avatarUrl: string | null
appearance?: {
preference: "light" | "dark" | "system"
preset: "default" | "ocean" | "forest" | "violet" | "sunset"
palettes: {
light: {
primary?: string
background?: string
card?: string
sidebar?: string
border?: string
}
dark: {
primary?: string
background?: string
card?: string
sidebar?: string
border?: string
}
}
}
emailPreferences?: {
productUpdates: boolean
}
storageQuotaBytes: number
storageUsedBytes: number
storageReservedBytes: number
e2ee?: {
enabledAt: string
decryptingSince?: string
}
createdAt: string
updatedAt: string
}Returned by:
E2eeState
Whether end-to-end encryption is on, and the wrapped master key. See Unlocking the account key.
{
enabled: boolean
enabledAt: string | null
passphrase: {
v: 1
kdf: "argon2id"
salt: string // up to 2048 characters
memoryKiB: number // 19456–1048576
iterations: number // 2–20
parallelism: number // 1–8
iv: string // up to 2048 characters
ciphertext: string // up to 2048 characters
} | null
recovery: {
v: 1
kdf: "hkdf"
salt: string // up to 2048 characters
iv: string // up to 2048 characters
ciphertext: string // up to 2048 characters
} | null
recoveryCreatedAt: string | null
passphraseChangedAt: string | null
devices: {
id: string
name: string
platform: string
remember: boolean
createdAt: string
lastUsedAt: string
}[]
migration: {
totalFiles: number
doneFiles: number
totalBytes: number
doneBytes: number
skippedFiles: number
complete: boolean
deviceName: string | null
updatedAt: string | null
} | null
decryptingSince: string | null
decryption: {
totalFiles: number
doneFiles: number
totalBytes: number
doneBytes: number
skippedFiles: number
complete: boolean
deviceName: string | null
updatedAt: string | null
} | null
}Returned by:
Item
A file or folder. See Requests and responses for what each field means.
{
backupRootId?: string
access?: "EDITOR" | "VIEWER"
syncRemovedAt?: string | null
cloudState?: "AVAILABLE" | "RELEASED" | "REQUESTED"
id: string
ownerUserId: string
parentId: string | null
type: "FILE" | "FOLDER"
name: string
normalizedName: string
mimeType: string | null
sizeBytes: number
currentVersionId: string | null
revision: number
favorite: boolean
createdAt: string
updatedAt: string
deletedAt: string | null
encrypted?: boolean
contentHash?: string | null // SHA-256, hex
uploadMismatch?: boolean
modifiedAt?: string | null
fileCreatedAt?: string | null
}Returned by:
GET /v1/drive/items/{id}GET /v1/drive/folders/{id}/childrenGET /v1/drive/folders/{id}/lookupGET /v1/searchPATCH /v1/drive/items/{id}DELETE /v1/drive/items/{id}PATCH /v1/drive/items/{id}/modifiedPOST /v1/drive/foldersPOST /v1/drive/items/{id}/movePOST /v1/drive/items/{id}/restorePUT /v1/drive/items/{id}/favoriteDELETE /v1/drive/items/{id}/favoritePOST /v1/drive/items/{id}/versions/{versionId}/restorePOST /v1/uploads/{id}/complete
Also part of Upload.
Upload
An upload in progress. See Uploading files.
{
id: string
state: "CREATED" | "UPLOADING" | "COMPLETING" | "COMPLETED" | "FAILED" | "ABORTED" | "EXPIRED"
multipart: boolean
partSizeBytes: number
expectedSizeBytes: number
expiresAt: string
failure?: string
item?: Item
}Returned by:
Storage
The account's storage, in bytes.
{
quotaBytes: number
usedBytes: number
reservedBytes: number
availableBytes: number
trashBytes?: number
freeing?: {
bytes: number
estimatedBytes: number | null
}
}Returned by:
Version
One stored version of a file. See Versions of a file.
{
cloudState?: "AVAILABLE" | "RELEASED"
id: string
driveItemId: string
versionNumber: number
sizeBytes: number
contentHash: string // SHA-256, hex
contentHashAlgorithm: "SHA256"
uploadMismatch?: boolean
storedContentHash?: string // SHA-256, hex
sourceDeviceId: string | null
encrypted?: boolean
keyHeader?: string
modifiedAt?: string | null
fileCreatedAt?: string | null
createdAt: string
}Returned by:
DownloadLink
A short-lived link to a file's stored bytes. See Downloading files.
{
downloadUrl: string
expiresAt: string
sizeBytes: number
contentHash: string // SHA-256, hex
contentHashAlgorithm: "SHA256"
encrypted?: boolean
uploadMismatch?: boolean
}Returned by:
FolderDownload
A folder ZIP being prepared. See Downloading a folder as a ZIP.
{
id: string
name: string
state: "QUEUED" | "LISTING" | "BUILDING" | "FINALIZING" | "READY" | "FAILED" | "CANCELLED" | "EXPIRED"
files: number
bytes: number
totalFiles: number
totalBytes: number | null
currentFile: string | null
error: string | null
expiresAt: string
downloadUrl?: string
sizeBytes?: number
contentHash?: string
}Returned by: