Overview
Query functions fetch data from the local SQLite database. All queries are type-safe and follow a consistent pattern.Query Pattern
All queries follow this structure:Accounts
account.get
Get a single account by ID.Query type identifier
Account ID to fetch
Returns the account or null if not found
account.list
List all accounts.Query type identifier
Array of all accounts
account.metadata.list
List all metadata entries for an account.Query type identifier
Account ID
Workspaces
workspace.get
Get a single workspace.Query type identifier
Workspace ID
Account ID
Returns the workspace or null if not found
workspace.list
List all workspaces for an account.Query type identifier
Account ID
Array of workspaces
workspace.metadata.list
List workspace metadata (sidebar state, containers, pinned items).Query type identifier
Account ID
Workspace ID
Array of metadata entries including sidebar, containers, and pinned items
workspace.storage.get
Get storage usage information for a workspace.Query type identifier
Account ID
Workspace ID
Nodes
node.get
Get a single node by ID.Query type identifier
Node ID
Account ID
Workspace ID
Returns the node or null if not found. LocalNode is a union type that includes LocalSpaceNode, LocalPageNode, LocalDatabaseNode, LocalFolderNode, LocalFileNode, LocalChannelNode, LocalChatNode, LocalMessageNode, and LocalRecordNode.
node.children.get
Get all children of a node.Query type identifier
Parent node ID
Account ID
Workspace ID
Array of child nodes
node.tree.get
Get the full tree structure starting from a node.Query type identifier
Root node ID
Account ID
Workspace ID
node.search
Search nodes by text content.Query type identifier
Search text
Account ID
Workspace ID
Filter by node types (e.g., [‘page’, ‘database’])
Maximum number of results
Pagination offset
Search only in titles, not content
Filter by updated date
Filter by space (root_id)
Array of search results with snippets and ranking
node.recent.list
Get recently accessed nodes.Query type identifier
Account ID
Workspace ID
node.popular.list
Get popular nodes based on interactions.Query type identifier
Account ID
Workspace ID
node.reaction.list
Get reactions for a node.Query type identifier
Node ID
Account ID
Workspace ID
Array of reactions with user info and timestamps
node.reactions.aggregate
Get aggregated reaction counts for a node.Query type identifier
Node ID
Account ID
Workspace ID
Array with reaction emoji, count, and whether current user reacted
Spaces
space.list
List all spaces in a workspace.Query type identifier
Account ID
Workspace ID
Array of space nodes
Databases
database.list
List all databases in a workspace.Query type identifier
Account ID
Workspace ID
Array of database nodes
database.view.list
List all views for a database.Query type identifier
Account ID
Workspace ID
Records
record.list
List records in a database.Query type identifier
Account ID
Workspace ID
Array of record nodes
record.search
Search records within a database.Query type identifier
Search text
Account ID
Workspace ID
Database ID to search within
Record IDs to exclude from results
Array of matching records
record.field.value.count
Count distinct values for a field.Query type identifier
Account ID
Workspace ID
Users
user.get
Get a single user.Query type identifier
Account ID
Workspace ID
Returns the user or null if not found
user.list
List all users in a workspace.Query type identifier
Account ID
Workspace ID
Array of users
user.search
Search users by name or email.Query type identifier
Search text
Account ID
Workspace ID
User IDs to exclude from results
Array of matching users
user.storage.get
Get storage usage for a user.Query type identifier
Account ID
Workspace ID
Files
file.list
List files in a folder.Query type identifier
Parent folder ID
Page number for pagination
Items per page
Account ID
Workspace ID
Array of file nodes
local.file.get
Get local file path.Query type identifier
Account ID
Workspace ID
upload.list
List file uploads.Query type identifier
Account ID
Workspace ID
upload.list.pending
List pending file uploads.Query type identifier
Account ID
Workspace ID
download.list.manual
List manual downloads.Query type identifier
Account ID
Workspace ID
temp.file.get
Get temporary file information.Query type identifier
Account ID
Workspace ID
file.download.request.get
Get file download request status.Query type identifier
Account ID
Workspace ID
Documents
document.get
Get a document’s CRDT state.Query type identifier
Document ID (same as node ID)
Account ID
Workspace ID
Returns the document or null if not found
document.state.get
Get document state vector.Query type identifier
Account ID
Workspace ID
document.updates.list
List document updates/changes.Query type identifier
Account ID
Workspace ID
Messages
message.list
List messages in a channel or chat.Query type identifier
Account ID
Workspace ID
Chats
chat.list
List all chats in a workspace.Query type identifier
Account ID
Workspace ID
Servers
server.list
List all configured servers.Query type identifier
Array of server configurations
Emojis
emoji.get
Get a single emoji by ID.Query type identifier
emoji.get.by.skin.id
Get emoji by skin tone ID.Query type identifier
emoji.list
List all available emojis.Query type identifier
emoji.search
Search emojis by name or keyword.Query type identifier
emoji.category.list
List emoji categories.Query type identifier
Icons
icon.list
List all available icons.Query type identifier
icon.search
Search icons by name.Query type identifier
icon.category.list
List icon categories.Query type identifier
Avatars
avatar.get
Get avatar data.Query type identifier
Account ID
Interactions
radar.data.get
Get radar/activity data.Query type identifier
Account ID
Workspace ID
App Metadata
app.metadata.list
List application metadata.Query type identifier