API Documentation
25 routes · Version fe45baa
Pages
/
Serves the main HTML page.
text/html/api/docs
This page. Auto-generated API documentation.
text/html/qr
QR code scanner page.
text/html/login
Login page with username/password and passkey support.
text/html/logout
Clear session cookie and redirect to home.
302 Redirect/settings
Auth
Settings page for passkey management. Requires authentication.
text/html/admin/settings
Auth Admin
Admin settings page with site-wide toggles. Requires admin authentication.
text/htmlAuthentication
/api/v1/auth/login
Authenticate with username and password. Returns a temporary bearer token.
{"username": "string", "password": "string"}{"token": "string", "expiresAt": 1750000000000}- 400 Invalid request body
- 401 Invalid credentials
/api/v1/auth/logout
Revoke the bearer token from the Authorization header.
{"message": "Logged out"}WebAuthn
/api/v1/auth/webauthn/register/options
Auth
Get WebAuthn registration options for the authenticated user.
PublicKeyCredentialCreationOptions JSON/api/v1/auth/webauthn/register
Auth
Complete WebAuthn registration with attestation response.
{ id, rawId, type, attestationObject, clientDataJSON, name? }{"message": "Passkey registered"}- 400 Invalid request body
- 400 Invalid or expired challenge
/api/v1/auth/webauthn/login/options
Get WebAuthn login options with allowed credentials.
PublicKeyCredentialRequestOptions JSON/api/v1/auth/webauthn/login
Complete WebAuthn login with assertion response. Sets session cookie.
{ id, rawId, type, authenticatorData, clientDataJSON, signature, userHandle? }{"message": "Authenticated as <username>"}- 400 Invalid request body
- 400 Invalid or expired challenge
- 401 Unknown credential
- 401 Authentication failed
/api/v1/auth/webauthn/credentials
Auth
List the authenticated user's registered passkeys.
{"credentials": [{"id": "...", "name": "...", "createdAt": "..."}]}/api/v1/auth/webauthn/credentials/{id}
Auth
Delete a passkey owned by the authenticated user.
{"message": "Credential deleted"}- 400 Credential ID required
- 404 Credential not found
QR Scanner
/api/v1/qr/scan
Upload a QR code image for processing. Multipart form data with field 'image'.
multipart/form-data (field: image){"content": "decoded QR string"}- 400 No image provided
- 400 File is not an image
- 400 Image too large (max 10 MB)
- 400 Could not decode QR code
- 429 Rate limit exceeded (max 3 per 90 minutes)
- 500 Processing failed
VGTU
/api/v1/vgtu/totp
Auth
Returns the encrypted TOTP secret.
text/plain (encrypted string)Admin
/api/v1/admin/users
Auth Admin
Register a new user.
{"username": "string", "password": "string"}{"message": "User '<name>' created"}- 400 Invalid request body
- 400 Username and password must not be blank
- 403 Admin access required
- 409 User already exists
- 409 Cannot register the admin user
/api/v1/admin/users
Auth Admin
List all registered usernames.
{"users": ["string"]}- 403 Admin access required
/api/v1/admin/users/{username}
Auth Admin
Delete a registered user by username.
{"message": "User '<name>' deleted"}- 400 Username is required
- 403 Admin access required
- 404 User not found
/api/v1/admin/qr-ratelimits
Auth Admin
Clear all QR scan rate limit buckets.
{"message": "QR rate limits cleared"}- 403 Admin access required
/api/v1/admin/settings/qr-protection
Auth Admin
Get the current QR protection state.
{"enabled": true}- 403 Admin access required
/api/v1/admin/settings/qr-protection
Auth Admin
Toggle QR protection. When enabled, QR scanner page and API require authentication.
{"enabled": true}{"enabled": true}- 400 Invalid request body
- 403 Admin access required
/api/v1/admin/settings
Auth Admin
Get all admin settings including QR protection state, env overrides, and env defaults.
{"qrProtectionEnabled": true, "envOverrides": {"KEY": "value"}, "envDefaults": {"KEY": "value"}}- 403 Admin access required
/api/v1/admin/settings
Auth Admin
Update all admin settings. Validates env values (not blank, URL format, boolean). Overrides take precedence over .env file values.
{"qrProtectionEnabled": true, "envOverrides": {"KEY": "value"}}{"qrProtectionEnabled": true, "envOverrides": {"KEY": "value"}, "envDefaults": {"KEY": "value"}}- 400 Invalid request body
- 400 Validation error (key-specific)
- 403 Admin access required