Overview
Users are the people who create and interact with memos. The User API provides endpoints for user management, authentication, settings, and statistics.List Users
Retrieves a list of all users. Requires admin privileges.
GET /api/v1/users
Query Parameters
Maximum number of users to return. Default: 50, Maximum: 1000
Token for retrieving the next page (from previous response)
Filter users by criteria. Example:
username == "alice"Supported operators: ==Supported fields: usernameInclude deleted users in results. Default:
falseResponse
Array of user objects
Token for the next page. Omitted if no more pages.
Total count of users (may be approximate)
Error Responses
Unauthenticated - User not authenticated
Permission Denied - User is not an admin
Get User
Retrieves a single user by ID or username. Supports both numeric IDs and username strings.
GET /api/v1/users/{user}
Path Parameters
The user ID (numeric) or username (string). Examples:
users/101- Get user by IDusers/alice- Get user by username
Response
The resource name of the user. Format:
users/{user_id}The user’s role:
ADMIN or USERUnique username for login
Email address (may be empty)
Display name shown in the UI
URL to user’s avatar image
User bio/description
Account state:
NORMAL or ARCHIVEDAccount creation timestamp
Last update timestamp
Error Responses
Invalid Argument - Invalid user name format
Not Found - User does not exist
Create User
Creates a new user account. The first user created automatically becomes an admin. Subsequent users require admin privileges or enabled registration.
POST /api/v1/users
Request Body
The user to create
Optional custom user ID. Must match pattern
[a-z0-9-]+. If not provided, an ID will be generated.If true, validates the request without creating the user. Default:
falseIdempotency token to ensure multiple requests have the same result
User Creation Rules
- First User: Automatically becomes an admin (no authentication required)
- Admin Users: Can create users with any role
- Regular Users: Can only create regular user accounts if registration is enabled
- Disabled Registration: Non-admin users cannot create accounts
Response
Returns the created user object (same structure as Get User response).Error Responses
Invalid Argument - Invalid username format or missing required fields
Permission Denied - User registration is disabled
Update User
Updates specific fields of a user account using field masks. Users can update their own accounts; admins can update any account.
PATCH /api/v1/users/{user_id}
Path Parameters
The ID of the user to update
Request Body
The user object with updated fields. Must include
name field.Specifies which fields to update.
If true, allows updating sensitive fields. Default:
falseUpdatable Fields
username- Username (admin only)email- Email addressdisplay_name- Display nameavatar_url- Avatar URLdescription- User biopassword- Password (self or admin only)role- User role (admin only)
Response
Returns the updated user object.Error Responses
Invalid Argument - Empty update_mask or invalid field values
Unauthenticated - User not authenticated
Permission Denied - User cannot modify this account
Delete User
Deletes a user account. Requires admin privileges.
DELETE /api/v1/users/{user_id}
Path Parameters
The ID of the user to delete
Query Parameters
If true, delete even if user has associated data. Default:
falseResponse
Returns empty response on success.Get User Statistics
Retrieves statistics for a specific user including memo counts, tags, and activity.
GET /api/v1/users/{user_id}:getStats
Response
Resource name of the user
Total number of memos created by the user
Array of timestamps when memos were displayed
Statistics by memo type:
link_count- Memos containing linkscode_count- Memos containing codetodo_count- Memos with task listsundo_count- Memos with completed tasks
Map of tag names to usage counts. Example:
{"work": 15, "personal": 42}Array of pinned memo resource names
List All User Statistics
Retrieves statistics for all users. Requires admin privileges.
GET /api/v1/users:stats
Response
Array of user statistics objects (same structure as Get User Statistics)
User Settings
Get User Setting
Retrieves a specific user setting.GET /api/v1/users/{user_id}/settings/{setting_key}
GENERAL- General user preferences (locale, theme, default visibility)WEBHOOKS- Webhook configurations
Update User Setting
PATCH /api/v1/users/{user_id}/settings/{setting_key}
locale- Preferred language code (e.g.,"en","zh","fr")theme- Theme name fromweb/public/themes/directorymemo_visibility- Default visibility for new memos:PRIVATE,PROTECTED, orPUBLIC
List User Settings
GET /api/v1/users/{user_id}/settings
Personal Access Tokens
List Personal Access Tokens
Retrieves all Personal Access Tokens for a user.GET /api/v1/users/{user_id}/personalAccessTokens
Create Personal Access Token
Creates a new long-lived token for API/script access.POST /api/v1/users/{user_id}/personalAccessTokens
description- Human-readable description of the token’s purposeexpires_in_days- Expiration in days (0 = never expires)
Delete Personal Access Token
DELETE /api/v1/users/{user_id}/personalAccessTokens/{token_id}
User Webhooks
List User Webhooks
GET /api/v1/users/{user_id}/webhooks
Create User Webhook
POST /api/v1/users/{user_id}/webhooks
Update User Webhook
PATCH /api/v1/users/{user_id}/webhooks/{webhook_id}
Delete User Webhook
DELETE /api/v1/users/{user_id}/webhooks/{webhook_id}
User Notifications
List User Notifications
GET /api/v1/users/{user_id}/notifications
page_size- Maximum notifications to returnpage_token- Pagination tokenfilter- CEL expression to filter notifications
Update User Notification
Mark a notification as read or archived.PATCH /api/v1/users/{user_id}/notifications/{notification_id}
UNREAD- New notificationARCHIVED- Read/dismissed
MEMO_COMMENT- Someone commented on your memo
Delete User Notification
DELETE /api/v1/users/{user_id}/notifications/{notification_id}