Skip to main content

User Management

Create and manage user accounts in Codex.

Creating the Admin User

The first user is created during initial setup:

# Via CLI
codex seed --config codex.yaml

Or via the setup API:

curl -X POST http://localhost:8080/api/v1/setup/initialize \
-H "Content-Type: application/json" \
-d '{
"username": "admin",
"email": "admin@example.com",
"password": "secure-password"
}'

Creating Additional Users

Admin users can create new accounts.

Via Web Interface

  1. Go to Settings > Users
  2. Click Add User
  3. Fill in username, email, password
  4. Select permissions
  5. Save

Via API

curl -X POST http://localhost:8080/api/v1/users \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{
"username": "reader",
"email": "reader@example.com",
"password": "user-password",
"role": "reader"
}'

User Properties

PropertyDescription
usernameUnique login name
emailEmail address (optional verification)
passwordHashed with Argon2
roleUser role: reader, maintainer, or admin
permissionsCustom permission overrides (optional)
email_verifiedEmail verification status
created_atAccount creation date
updated_atLast modification date

Updating Users

curl -X PUT http://localhost:8080/api/v1/users/{id} \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{
"email": "newemail@example.com",
"permissions": ["LibrariesRead", "BooksRead"]
}'

Deleting Users

curl -X DELETE http://localhost:8080/api/v1/users/{id} \
-H "Authorization: Bearer $TOKEN"
warning

Deleting a user also deletes their reading progress and API keys.

User Preferences

Codex supports per-user preferences for customizing the user experience.

Available Preferences

KeyTypeDefaultDescription
ui.themestring"system"Theme: "light", "dark", "system"
ui.languagestring"en"UI language (BCP47 code)
ui.sidebar_collapsedbooleanfalseSidebar state
reader.default_zoominteger100Default zoom percentage
reader.reading_directionstring"auto"Reading direction
reader.page_fitstring"width"Page fit mode
library.default_viewstring"grid"Default view mode
library.default_page_sizeinteger24Items per page

Managing via Web Interface

  1. Go to Settings > Profile
  2. Navigate to the Preferences tab
  3. Adjust settings as needed
  4. Changes are saved automatically

Managing via API

# Get all preferences
curl http://localhost:8080/api/v1/user/preferences \
-H "Authorization: Bearer $TOKEN"

# Set a preference
curl -X PUT http://localhost:8080/api/v1/user/preferences/ui.theme \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{"value": "dark"}'

# Reset to default
curl -X DELETE http://localhost:8080/api/v1/user/preferences/ui.theme \
-H "Authorization: Bearer $TOKEN"