Start Login
Initiates the login process by finding a user by handle and generating authentication options.Request Body
User handle (username). 3-32 characters.
Response
User ID (UUID)
Whether user has trusted devices (enables device approval login option)
Whether user has passkeys registered (enables passkey login option)
WebAuthn authentication options (null if user has no passkeys)
Authentication session ID for passkey login (UUID, null if no passkeys)
Error Responses
"Account not found"(404) - No user with this handle exists
Login with Passkey
Completes login using WebAuthn passkey authentication.Request Body
Authentication session ID from start login response (UUID format)
WebAuthn authentication response from the authenticator
Device information
Device name (max 64 characters)
Device type:
"phone", "computer", or "tablet"Browser name (optional)
Operating system (optional)
Unique device fingerprint (optional, max 64 characters)
Response
Always
true on successful loginSession token for authentication (also set as HTTP-only cookie)
Array of all user identities
Identity ID
Display name
Handle
Email address
Avatar URL
Banner URL
Whether this is the primary identity
PRF-encrypted master key if stored with this passkey (client can decrypt without trust codes)
Whether master key recovery is needed (true if no PRF-encrypted key available)
Error Responses
"Login session expired"(400) - Challenge expired (10 minute timeout)"Passkey not recognized. It may have been registered on a different device or browser."(400) - Passkey not found"Passkey does not belong to this account"(400) - Passkey belongs to different user"Passkey verification failed"(400) - WebAuthn verification failed
Request Device Approval
Requests login approval from another trusted device. The requesting device generates an ephemeral key pair for secure key exchange.Request Body
User handle (3-32 characters)
Ephemeral public key from the requesting device for E2EE key exchange
Device information
Device name (max 64 characters)
Device type:
"phone", "computer", or "tablet"Browser name (optional)
Operating system (optional)
Unique device fingerprint (optional, max 64 characters)
Response
Login request ID (UUID) - use this to poll for approval status
ISO 8601 timestamp when request expires (5 minutes from creation)
Error Responses
"Account not found"(404) - No user with this handle exists
Check Request Status
Polls the status of a login approval request. When approved, returns session token and encrypted master key.Path Parameters
Login request ID from request-approval response
Response
Pending:"pending" - Request is waiting for approval"expired" - Request has expired (5 minute timeout)"denied" - Request was denied by user"approved" - Request was approvedSession token for authentication (also set as HTTP-only cookie)
Master key encrypted with requester’s public key (decrypt with requester’s private key)
Approver’s ephemeral public key for key exchange
Array of all user identities (same structure as passkey login)
Error Responses
"Request not found"(404) - Invalid request ID"Account not found"(404) - User account was deleted"Approval key missing"(400) - Approved but missing public key
Login with Trust Code
Login using a recovery trust code. Trust codes are reusable and decrypt the master key backup.Request Body
User handle (3-32 characters)
Trust code (recovery code provided during registration)
Device information (same structure as other login methods)
Response
Always
true on successful loginSession token for authentication
Encrypted master key backup (decrypt with the trust code)
Device information (same structure as other login methods)
Array of all user identities
Number of trust codes registered (all are reusable)
Error Responses
"Account not found"(404) - No user with this handle exists"No trust codes found for your account. You may need to regenerate them from the Security page."(400) - No trust codes configured"Invalid trust code. You have {count} trust code(s) registered."(400) - Trust code doesn’t match
Recover Master Key
Recovery endpoint to retrieve the encrypted master key backup without creating a new session. Used when a user is already logged in via passkey but doesn’t have the master key locally.Request Body
User handle (3-32 characters)
Trust code for verification
Response
Always
true on successful recoveryEncrypted master key backup (decrypt with the trust code)
Error Responses
"Account not found"(404) - No user with this handle exists"No trust codes found for your account."(400) - No trust codes configured"Invalid trust code."(400) - Trust code doesn’t match"No encryption backup found."(400) - No encrypted backup stored
Logout
Logs out the current session by invalidating the session token.Headers
Accepts authentication via either:Authorization: Bearer {token}header- Session cookie (automatically set by login endpoints)
Response
Always
trueAuthentication Flow
Ave supports three authentication methods:1. Passkey Login (Recommended)
- Call
/startwith user handle - Use WebAuthn API with
authOptionsto get credential - Call
/passkeywith credential and device info - Receive session token and optional PRF-encrypted master key
2. Device Approval Login
- Call
/startto verify user has devices - Call
/request-approvalwith ephemeral public key - User approves on trusted device (via
/api/devices/approve-request) - Poll
/request-status/:requestIduntil approved - Receive session token and encrypted master key
3. Trust Code Login (Recovery)
- Call
/trust-codewith handle, trust code, and device info - Receive session token and encrypted master key backup
- Decrypt backup using the trust code
Session Management
- Duration: Sessions expire after 30 days
- Storage: Session tokens are set as HTTP-only cookies and also returned in response
- Authentication: Include token in
Authorization: Bearer {token}header or rely on cookie - Revocation: Use
/logoutto invalidate a session
Device Fingerprinting
Devices are identified by an optionalfingerprint field:
- If fingerprint matches an existing device, that device is reused and updated
- If no match, a new device record is created
- Helps track “New device login” vs “Known device login” for security
Activity Logging
All login attempts are logged:- Success: Logged with method (passkey/device_approval/trust_code) and device info
- Failure: Trust code failures logged with severity “warning”
- Recovery: Key recovery attempts logged separately