FaceVault Documentation

API Documentation

The FaceVault API provides programmatic access to file management and user authentication features. Note that most endpoints require authentication.

Authentication & User

POST/api/register

Register a new user.

Body: JSON

{
  "username": "user123",
  "password": "securePassword"
}

POST/api/login

Authenticate a user.

Body: JSON

{
  "username": "user123",
  "password": "securePassword"
}

POST/api/user/keys

Update user's public and wrapped private keys.

headers: Cookie: connect.sid=... (Auth required)

Body: JSON

{
  "publicKey": "base64_string",
  "wrappedPrivateKey": "base64_string",
  "faceEnrolled": true
}

File Operations

POST/api/files/upload

Upload an encrypted file. Requires multipart/form-data.

Field Type Description
file File The encrypted file blob.
originalName String Original filename.
encryptedAESKey String AES key encrypted with user's public key.
fileIv String Initialization Vector for the file.
autoDelete Boolean Whether to auto-delete after access.

GET/api/files

Retrieve a list of all files uploaded by the authenticated user.

GET/api/files/:id/download

Download a specific file. Returns the encrypted file blob.

Parameters: id (File ID)

DELETE/api/files/:id

Permanently delete a file.

Parameters: id (File ID)

Statistics

GET/api/stats

Get usage statistics for the user (total files, total size).