Skip to main content

Account Management

Manage team members, roles, and permissions in your Trix account.

Overview

Trix accounts support multiple users with role-based access control. You can invite team members, assign roles, and manage permissions—all within a single account that shares spaces, API keys, and billing.

This page covers Trix's built-in team features. If you're building a multi-tenant application where your end-users each need isolated data, see the Multi-User Apps guide instead.

Account Structure

Trix uses a hierarchical structure for organization:

  • Account — The top-level organization. Contains users, spaces, API keys, and billing.
  • Users — Individual team members who can sign in with email/password.
  • Spaces — Isolated workspaces within an account. Users access spaces via API keys.
  • API Keys — Credentials for programmatic access, scoped to specific spaces.

A user can belong to multiple accounts and switch between them. This is useful for consultants or developers working across organizations.

User Roles

Each user has a role within an account that determines their permissions:

RolePermissions
OwnerFull control. Can transfer ownership, delete account, manage billing, and do everything admins can do.
AdminCan invite/remove members, manage API keys, create spaces, and access all account features except ownership transfer and account deletion.
MemberCan use the account's spaces and API keys but cannot invite users or manage account settings.

Each account must have exactly one owner. To change ownership, the current owner must explicitly transfer it to another user.

Inviting Team Members

Owners and admins can invite new users to the account. Invitations are sent via email and expire after 7 days by default.

Using the CLI

# Invite a new team member
trix account invite [email protected] --role member

# Invite as admin
trix account invite [email protected] --role admin

# List pending invitations
trix account invites

# Revoke a pending invitation
trix account invite revoke <invite-id>

Using the REST API

# Send an invitation
curl -X POST https://api.trixdb.com/v1/accounts/invites \
  -H "Authorization: Bearer $TRIX_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "email": "[email protected]",
    "role": "member"
  }'

# List pending invitations
curl https://api.trixdb.com/v1/accounts/invites \
  -H "Authorization: Bearer $TRIX_API_KEY"

When the recipient accepts the invitation, they'll either:

  • Create a new Trix account (if they don't have one)
  • Be added to your account (if they already have a Trix login)

Managing Members

View, update, and remove team members from your account.

Using the CLI

# List all members
trix account members

# Change a member's role
trix account member update <user-id> --role admin

# Remove a member
trix account member remove <user-id>

Using the REST API

# List all members
curl https://api.trixdb.com/v1/accounts/members \
  -H "Authorization: Bearer $TRIX_API_KEY"

# Update a member's role
curl -X PATCH https://api.trixdb.com/v1/accounts/members/<user-id> \
  -H "Authorization: Bearer $TRIX_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"role": "admin"}'

# Remove a member
curl -X DELETE https://api.trixdb.com/v1/accounts/members/<user-id> \
  -H "Authorization: Bearer $TRIX_API_KEY"

Switching Accounts

Users who belong to multiple accounts can switch between them. This is useful for:

  • Consultants working with multiple clients
  • Developers with personal and work accounts
  • Agencies managing multiple organizations

Using the CLI

# List accounts you belong to
trix account list

# Switch to a different account
trix account switch <account-id>

# Show current account
trix account current

Using the REST API

# List your accounts (requires JWT auth, not API key)
curl https://api.trixdb.com/v1/auth/accounts \
  -H "Authorization: Bearer $JWT_TOKEN"

# Switch account (returns new JWT for that account)
curl -X POST https://api.trixdb.com/v1/auth/switch-account/<account-id> \
  -H "Authorization: Bearer $JWT_TOKEN"

Account switching requires JWT authentication (user login), not API key authentication. API keys are scoped to a single account.

Transferring Ownership

Account ownership can be transferred to another admin or member. Only the current owner can initiate a transfer.

# Transfer ownership (CLI)
trix account transfer-ownership <user-id>

# Transfer ownership (API)
curl -X POST https://api.trixdb.com/v1/accounts/members/<user-id>/transfer-ownership \
  -H "Authorization: Bearer $TRIX_API_KEY"

Ownership transfer is immediate and irreversible. The previous owner becomes an admin.

API Key Access Control

API keys can be scoped to specific spaces with different permission levels:

PermissionCapabilities
readSearch and retrieve memories
read_writeCreate, update, and delete memories
adminFull space access including settings
# Create an API key with space-specific access
trix keys create --name "production-reader" \
  --space prod-space --permission read

# Grant a key access to additional spaces
trix keys grant <key-id> --space staging-space --permission read_write

# Delete a key
trix keys delete <key-id>

# Create an account-admin key (full access to all spaces)
trix keys create --name "admin-key" --account-admin

Account-admin API keys have full access to all spaces. Use them sparingly and prefer space-scoped keys for production services.

Audit Logging

Trix maintains audit logs for account management actions. These logs help with:

  • Security investigations
  • Compliance requirements
  • Understanding who made changes and when

Audited actions include:

  • User invitations sent, accepted, and revoked
  • Role changes
  • Member additions and removals
  • Ownership transfers
  • API key creation and deletion

Audit logs are retained according to your plan's data retention policy. Contact support for extended retention requirements.

Best Practices

  • Use the principle of least privilege — Assign the minimum role needed. Most team members should be "member" not "admin".
  • Create space-scoped API keys — Avoid account-admin keys in production. Scope keys to specific spaces.
  • Rotate API keys regularly — Delete unused keys and create new ones periodically.
  • Document your account structure — Keep a record of who has access and why.
  • Review members periodically — Remove access for people who no longer need it.

Next Steps