Overview
The User API provides operations for managing user accounts, profiles, settings, and authentication in AFFiNE.Queries
Get Current User
Retrieve the authenticated user’s profile and settings.Get User by Email
Retrieve a user’s public information by email address.The email address to search for
For privacy, this query only returns user information if you share a workspace with them.
Get Public User by ID
Retrieve a user’s public profile information by user ID.Mutations
Update Profile
Update the authenticated user’s profile information.Upload Avatar
Upload a new avatar image for the authenticated user.Image file to upload (max 5MB, will be resized to 512x512 WebP)
Supported formats: JPEG, PNG, GIF, WebP. Images are automatically processed and converted to WebP format.
Remove Avatar
Remove the authenticated user’s avatar image.Update Settings
Update user notification and preference settings.Delete Account
Permanently delete the authenticated user’s account.Access Tokens
Generate Access Token
Create a new API access token for programmatic access.Revoke Access Token
Revoke an API access token.Type Definitions
UserType
Unique user identifier
User’s display name
User’s email address
Whether the email has been verified
URL to the user’s avatar image
Whether the user has set a password
Account creation timestamp
Whether the account is disabled
Array of enabled feature flags
User notification and preference settings
User storage and usage quotas
Active subscriptions
PublicUserType
Limited public information about a user.User ID
Display name
Avatar image URL
UserSettingsType
Receive workspace invitation emails
Receive comment notification emails
Receive mention notification emails
UserQuotaType
Quota plan name (e.g., “Free”, “Pro”)
Total storage quota in bytes
Used storage in bytes
Maximum single file size in bytes
Maximum workspace members
AI action quota limit
Document history retention period in milliseconds
FeatureType Enum
Available feature flags:FreePlan- Free tier accessProPlan- Pro tier accessTeamPlan- Team tier accessLifetimeProPlan- Lifetime pro accessEarlyAccess- Early access featuresAIEarlyAccess- AI early accessUnlimitedCopilot- Unlimited AI actionsUnlimitedWorkspace- Unlimited workspacesAdmin- Admin privileges
Error Handling
- UserNotFound
- InvalidEmail
- ImageFormatNotSupported
- AuthenticationRequired