Backend API Reference
Backend API Reference
The Backend service exposes both anonymous account-lifecycle routes and authenticated admin or user routes.
Health
GET /health
Returns a simple health payload:
Public Auth APIs
GET /auth/plans
Returns the public plan catalog and enterprise contact metadata.
Response shape:
POST /auth/orgadmin/register
Creates a pending org-admin registration and sends a verification email.
Request:
Success response:
Behavior notes:
planis required.enterpriseis not self-service and returns a contact message.- paid plans require a payment method during verification.
- password must be at least 10 characters.
- country availability is restricted to
US,CA,GB,EU,CH,NO,IS,AL,AZ,AM,TR,MK,ME,AU,NZ,SG,MY,JP, andKR. - if email delivery is disabled,
verificationTokenis returned so non-production environments can continue the flow.
GET /auth/orgadmin/verify?token=<token>
Finalizes registration, optionally creates a Stripe subscription for paid plans, and returns the org-admin API key.
Response:
POST /auth/orgadmin/login
Signs in a verified org admin with email and password and returns a fresh API key.
Request:
Response:
Admin APIs
All admin routes require X-Api-Key.
POST /admin/orgs
Global-admin only. Creates a new organization.
Request:
GET /admin/orgs
Global-admin only. Lists organizations.
POST /admin/orgs/{orgId}/users
Creates a user in an org.
Request:
Authorization behavior:
- global admin can create only the first org admin in a target org
- org admins can create additional org admins or regular users in their org
Response includes the plaintext API key in apiKeyHash.
GET /admin/orgs/{orgId}/users
Lists users in an org for a global admin or that org’s org admin.
POST /admin/orgs/{orgId}/users/{userId}/apikey/rotate
Rotates a user’s API key.
Response:
GET /admin/orgs/{orgId}/storage
Reads the org’s S3-compatible file storage configuration.
Response:
PUT /admin/orgs/{orgId}/storage
Creates or updates the org’s S3-compatible file storage configuration.
Request:
Validation notes:
serviceUrl,bucket, andaccessKeyare requiredserviceUrlmust be an absolute URLsecretKeyis required on first save
User APIs
All user routes require X-Api-Key.
GET /users/me
Returns the authenticated user record. The API key hash is blanked in the response.
POST /users/me/keys
Stores the authenticated user’s public keys and encrypted private keys.
Request:
GET /users/org
Returns org-scoped public profiles for all users in the same organization.
GET /users/org/{userId}
Returns one org-scoped public profile. Users outside the org return 404.
Recovery APIs
These routes support trusted-user recovery workflows.
PUT /users/me/recovery/trustees/{trusteeUserId}
Creates or updates a trusted-user recovery share.
Request:
Validation notes:
- you cannot assign yourself as a trustee
- the trustee must exist in the same org
- both share payloads must be valid base64
GET /users/me/recovery/trustees
Lists trustees configured by the current user.
DELETE /users/me/recovery/trustees/{trusteeUserId}
Removes a trusted-user recovery share.
GET /users/me/recovery/shares
Lists owners who have shared recovery material with the current user.
GET /users/me/recovery/shares/{ownerUserId}
Returns the stored recovery share for the current user as trustee.
POST /users/me/recovery/restore/{ownerUserId}
Lets a trusted user submit restored encrypted private keys for an owner.
Request:
Response:
KV APIs
All KV routes require X-Api-Key.
PUT /kv/{key}
Stores encrypted secret metadata.
Request:
GET /kv/{key}
Returns the stored encrypted record.
DELETE /kv/{key}
Soft-deletes the key.
GET /kv
Lists active keys for the authenticated user.
File APIs
All file routes require X-Api-Key.
POST /files
Stores encrypted file metadata and uploads ciphertext to the configured object store.
Request:
Validation notes:
- free plan orgs cannot store files
- the org must have file storage configured
- file count and size are enforced by plan
GET /files
Lists file metadata for the current user.
GET /files/{id}
Returns encrypted file metadata plus ciphertext loaded from object storage.
DELETE /files/{id}
Soft-deletes the file record and attempts to delete the object from storage.
Audit API
GET /audit
Org-admin only. Returns KV audit entries for the org.
Each entry includes:
keyactionascreate,update, ordeletetimestampUtcversionuserId
Plan Limits
| Plan | Max KV Records | Max Key + Value Bytes | Max Files | Max File Size |
|---|---|---|---|---|
| Free | 1,000 | 1,024 | 0 | 0 |
| Starter | 10,000 | 2,048 | 1,000 | 1 MiB |
| SMB | 25,000 | 4,096 | 2,500 | 4 MiB |
| Business | 100,000 | 8,192 | 10,000 | 8 MiB |
Error Patterns
400: validation failure, unsupported plan/country, missing storage config, plan limit reached401: missing or invalid API key403: caller is authenticated but lacks the required admin role404: org, user, key, file, or recovery share not found
Error payloads generally follow: