Authentication
Get current user
Returns the currently authenticated user.
Response:
{
"id" : "uuid" ,
"username" : "alice" ,
"displayName" : "Alice" ,
"avatarUrl" : "https://..." ,
"isBot" : false
}
TypeScript Python
const me = await client . getMe ( )
Update profile
Field Type Description displayNamestring Display name avatarUrlstring | null Avatar URL
TypeScript Python
const updated = await client . updateProfile ( {
displayName : 'New Name' ,
avatarUrl : 'https://example.com/avatar.png' ,
} ) updated = client . update_profile (
display_name = "New Name" ,
avatar_url = "https://example.com/avatar.png" ,
)
Get user profile
Returns a public user profile by ID.
TypeScript Python
const profile = await client . getUserProfile ( 'user-id' ) profile = client . get_user_profile ( "user-id" )
Register
No authentication required.
Field Type Required Description emailstring Yes Email address passwordstring Yes Password usernamestring No Unique username. Generated when omitted. displayNamestring No Display name inviteCodestring No Optional membership invite. Unlocks Cloud and Space creation.
TypeScript Python
const { accessToken , refreshToken , user } = await client . register ( {
email : 'alice@example.com' ,
password : 'secure-password' ,
displayName : 'Alice' ,
} ) result = client . register (
email = "alice@example.com" ,
password = "secure-password" ,
display_name = "Alice" ,
)
access_token = result [ "accessToken" ]
Email code login
POST /api/auth/email/start
POST /api/auth/email/verify
Email code verification signs in an existing user or creates a visitor account.
await client . startEmailLogin ( { email : 'alice@example.com' } )
const { accessToken , refreshToken , user } = await client . verifyEmailLogin ( {
email : 'alice@example.com' ,
code : '123456' ,
} )
Password reset by email
POST /api/auth/password-reset/start
POST /api/auth/password-reset/complete
start always returns the same success shape so callers cannot discover whether an email address is registered. The reset email contains a single-use link to /app/reset-password; the token expires after 30 minutes and is stored space-side only as a hash. Completing the reset updates the password and revokes existing sessions.
await client . startPasswordReset ( { email : 'alice@example.com' } )
await client . completePasswordReset ( {
token : 'token-from-email-link' ,
newPassword : 'new-secure-password' ,
confirmPassword : 'new-secure-password' ,
} )
Login
No authentication required.
Field Type Required emailstring Yes passwordstring Yes
TypeScript Python
const { accessToken , refreshToken , user } = await client . login ( {
email : 'alice@example.com' ,
password : 'secret' ,
} ) result = client . login ( email = "alice@example.com" , password = "secret" )
Refresh token
Returns a new JWT token.
Authentication failures return 401 with a stable code when the service can identify the cause:
Code Meaning AUTH_TOKEN_MISSINGThe protected request did not include a bearer token. ACCESS_TOKEN_INVALIDThe access token is invalid or expired; clients may try /api/auth/refresh. SESSION_REVOKEDThe user session was explicitly revoked and local credentials should be cleared. REFRESH_TOKEN_INVALIDThe refresh token is invalid, revoked, expired, or no longer matches the session. PAT_TOKEN_INVALIDA personal access token is invalid or revoked. PAT_TOKEN_EXPIREDA personal access token has expired.
TypeScript Python
const tokens = await client . refreshToken ( refreshToken ) result = client . refresh_token ( refresh_token )
Membership
Invite codes are not required to register. Use membership APIs to unlock advanced capabilities:
GET /api/membership/me
POST /api/membership/redeem-invite
Membership responses include status, tier, level, isMember, and effective
capabilities. Treat capabilities as the source of truth for advanced actions; new tiers can be
added later without changing this response shape.
Common advanced capabilities include cloud:deploy, server:create, invite:create, and
oauth_app:create. A missing capability should be rendered as an upgrade or invite redemption path,
not as a failed login.
Fast auth endpoints are rate limited. A 429 response includes RATE_LIMITED and Retry-After.
Disconnect
POST /api/auth/disconnect
Notifies the service that the client is disconnecting (used for presence tracking).
TypeScript Python
await client . disconnect ( )
List linked OAuth accounts
GET /api/auth/oauth/accounts
TypeScript Python
const accounts = await client . listOAuthAccounts ( ) accounts = client . list_oauth_accounts ( )
Unlink OAuth account
DELETE /api/auth/oauth/accounts/:accountId
TypeScript Python
await client . unlinkOAuthAccount ( 'account-id' ) client . unlink_oauth_account ( "account-id" )
Change password
Field Type Required Description oldPasswordstring Yes Current password newPasswordstring Yes New password confirmPasswordstring No New password confirmation
TypeScript Python
await client . changePassword ( {
oldPassword : 'old-pass' ,
newPassword : 'new-pass' ,
confirmPassword : 'new-pass' ,
} ) client . change_password (
current_password = "old-pass" ,
new_password = "new-pass" ,
)
Google ID token login
POST /api/auth/google/id-token
Sign in or register using a Google ID token.
Field Type Required Description idTokenstring Yes Google ID token
TypeScript Python
const { accessToken , refreshToken , user } = await client . loginWithGoogleIdToken ( 'google-id-token' ) result = client . login_with_google_id_token ( "google-id-token" )
Dashboard
Returns the current user's dashboard summary.
TypeScript Python
const dashboard = await client . getDashboard ( ) dashboard = client . get_dashboard ( )