Proxy API Reference
Proxy API Reference
Health
GET /health
Returns:
Key APIs
POST /v1/keys/generate
Required headers:
X-Api-KeyX-User-Secret
Generates an ECC keypair and a Kyber keypair, encrypts the private keys with a KEK derived from X-User-Secret, stores the encrypted private keys in Backend, and returns the public keys.
Response:
GET /v1/keys/status
Required headers:
X-Api-Key
Returns:
POST /v1/keys/rekey
Required headers:
X-Api-KeyX-User-SecretX-New-User-Secret
Re-encrypts the stored private keys with a KEK derived from the new user secret.
Errors:
401if the old user secret cannot decrypt the stored private keys400if the user has not generated key material yet
KV APIs
PUT /v1/kv/{key}
Required headers:
X-Api-Key
Request:
Behavior:
- Proxy generates a random AES-256 key for the value
- Proxy encrypts the plaintext with AES-GCM
- Proxy wraps the AES key with ECC, then wraps the ECC payload with Kyber
- Backend receives only ciphertext and wrapped keys
GET /v1/kv/{key}
Required headers:
X-Api-KeyX-User-Secret
Response:
Errors:
401for a wrong user secret400for tampered wrapped keys, key mismatch, or invalid ciphertext404if the key does not exist
DELETE /v1/kv/{key}
Required headers:
X-Api-Key
Deletes the stored key.
GET /v1/kv
Required headers:
X-Api-Key
Returns an array of active key names.
KV Sharing APIs
Shares are same-org and currently read-only. The only accepted permission value is "read".
POST /v1/kv/{key}/shares
Required headers:
X-Api-KeyX-User-Secret
Request:
Behavior:
- Proxy unwraps the stored AES key with the caller’s private keys.
- Proxy re-wraps that AES key to the recipient’s ECC and Kyber public keys.
aliasis optional and is encrypted with the same AES key before it is stored.expiresUtcis optional but, if supplied, must be in the future.
Success response:
Errors:
400for missing owner private keys, missing recipient public keys, invalid wrapped keys,permissionother thanread, or anexpiresUtcin the past401for a wrongX-User-Secret404if the key or recipient user does not exist in the caller’s org409if an active share already exists for that recipient and key
GET /v1/kv/{key}/shares
Required headers:
X-Api-Key
Returns active owner-side grants for one key:
DELETE /v1/kv/{key}/shares/{recipientUserId}
Required headers:
X-Api-Key
Revokes the active share for that recipient.
Response:
GET /v1/kv/shared
Required headers:
X-Api-KeyX-User-Secret
Returns active shares that the current user can still unwrap:
Expired or no-longer-decryptable shares are omitted from this list.
GET /v1/kv/shared/{shareId}
Required headers:
X-Api-KeyX-User-Secret
Response:
Behavior:
- Proxy decrypts the recipient envelope locally and returns plaintext only to the recipient.
- Proxy records a share-access event after a successful read.
Errors:
401for a wrongX-User-Secret403if the share exists but can no longer be decrypted with the user’s current keys404if the share does not exist, is expired, or does not belong to the caller
DELETE /v1/kv/shared/{shareId}
Required headers:
X-Api-Key
Allows the recipient to remove their own access.
Response:
File APIs
POST /v1/files
Required headers:
X-Api-KeyX-User-Secret
Request:
Behavior:
- file name and file content are encrypted with a random AES key
- the AES key is wrapped with ECC and Kyber
- Backend stores encrypted metadata
- Backend writes ciphertext to the org’s configured object store
Validation:
fileNameis requiredcontentB64must be valid base64- the user’s public keys must already exist
- the org must have storage configured and an eligible plan
GET /v1/files
Required headers:
X-Api-KeyX-User-Secret
Returns decrypted file metadata for files the current user can unwrap:
GET /v1/files/{id}
Required headers:
X-Api-KeyX-User-Secret
Response:
DELETE /v1/files/{id}
Required headers:
X-Api-Key
Deletes the file record and object.
File Sharing APIs
File shares are also same-org and currently read-only.
POST /v1/files/{id}/shares
Required headers:
X-Api-KeyX-User-Secret
Request:
Behavior:
- Proxy unwraps the file AES key with the caller’s private keys.
- Proxy re-wraps that AES key for the recipient’s public keys.
expiresUtcis optional but must be in the future when provided.
Success response:
Errors:
400for missing owner private keys, missing recipient public keys, invalid wrapped keys,permissionother thanread, or anexpiresUtcin the past401for a wrongX-User-Secret404if the file or recipient user does not exist in the caller’s org409if an active share already exists for that recipient and file
GET /v1/files/{id}/shares
Required headers:
X-Api-Key
Returns active owner-side grants for one file:
DELETE /v1/files/{id}/shares/{recipientUserId}
Required headers:
X-Api-Key
Revokes the active file share for that recipient.
Response:
GET /v1/files/shared
Required headers:
X-Api-KeyX-User-Secret
Returns active shared files that the current user can still unwrap:
GET /v1/files/shared/{shareId}
Required headers:
X-Api-KeyX-User-Secret
Response:
Behavior:
- Proxy decrypts the file name and ciphertext locally for the recipient.
- Proxy records a share-access event after a successful download.
Errors:
401for a wrongX-User-Secret403if the share exists but can no longer be decrypted with the user’s current keys404if the share does not exist, is expired, or does not belong to the caller
DELETE /v1/files/shared/{shareId}
Required headers:
X-Api-Key
Allows the recipient to remove their own file access.
Response:
User Discovery APIs
GET /v1/users/me
Required headers:
X-Api-Key
Returns the Backend users/me payload through Proxy.
GET /v1/users/org
Required headers:
X-Api-Key
Returns org-scoped public profiles for the current user’s organization.
GET /v1/users/org/{userId}
Required headers:
X-Api-Key
Returns one org-scoped public profile or 404 for a different org.
Recovery APIs
PUT /v1/recovery/trustees/{trusteeUserId}
Required headers:
X-Api-Key
Request:
Creates or updates a trusted-user recovery share.
GET /v1/recovery/trustees
Required headers:
X-Api-Key
Lists trustees configured by the current user.
DELETE /v1/recovery/trustees/{trusteeUserId}
Required headers:
X-Api-Key
Deletes a trusted-user entry.
GET /v1/recovery/shares
Required headers:
X-Api-Key
Lists owners who have shared recovery material with the current user.
GET /v1/recovery/shares/{ownerUserId}
Required headers:
X-Api-Key
Returns the raw encrypted recovery share for an owner where the current user is the trustee.
POST /v1/recovery/restore/{ownerUserId}
Required headers:
X-Api-Key
Request:
Response:
The expected next step is for the recovered user to rekey with a fresh X-User-Secret.
Admin Passthrough APIs
The following routes are forwarded to Backend using the caller’s X-Api-Key:
POST /admin/orgsGET /admin/orgsPOST /admin/orgs/{orgId}/usersGET /admin/orgs/{orgId}/usersPOST /admin/orgs/{orgId}/users/{userId}/apikey/rotate
These are not versioned under /v1; they preserve the Backend route shape.
Common Error Cases
401: missing API key, missing required user secret, or wrong user secret400: missing user keys, invalid base64, tampered wrapped keys, invalid ciphertext, invalid share payloads, or Backend validation failure403: share envelope exists but cannot be decrypted with the caller’s current keys404: missing key, file, user, or recovery share409: an active share already exists for that recipient and resource