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
- Go to Settings > Users
- Click Add User
- Fill in username, email, password
- Select permissions
- 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",
"is_admin": false,
"permissions": ["LibrariesRead", "SeriesRead", "BooksRead", "PagesRead"]
}'
User Properties
| Property | Description |
|---|---|
username | Unique login name |
email | Email address (optional verification) |
password | Hashed with Argon2 |
is_admin | Full system access |
permissions | Granular permission list |
email_verified | Email verification status |
created_at | Account creation date |
updated_at | Last 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
| Key | Type | Default | Description |
|---|---|---|---|
ui.theme | string | "system" | Theme: "light", "dark", "system" |
ui.language | string | "en" | UI language (BCP47 code) |
ui.sidebar_collapsed | boolean | false | Sidebar state |
reader.default_zoom | integer | 100 | Default zoom percentage |
reader.reading_direction | string | "auto" | Reading direction |
reader.page_fit | string | "width" | Page fit mode |
library.default_view | string | "grid" | Default view mode |
library.default_page_size | integer | 24 | Items per page |
Managing via Web Interface
- Go to Settings > Profile
- Navigate to the Preferences tab
- Adjust settings as needed
- 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"
External Integrations
Connect your Codex account to external services for reading progress sync.
Available Integrations
| Provider | Auth Type | Features |
|---|---|---|
| AniList | OAuth2 | Sync progress, ratings, import lists |
| MyAnimeList | OAuth2 | Sync progress, ratings, import lists |
| Kitsu | OAuth2 | Sync progress, ratings |
| MangaDex | API Key | Sync progress |
| Kavita | API Key | Sync progress, ratings |
Connecting an Integration
- Go to Settings > Profile
- Navigate to the Integrations tab
- Click Connect on the desired integration
- Follow the OAuth flow or enter your API key
- Configure sync settings
Sync Settings
| Setting | Description |
|---|---|
sync_reading_progress | Sync reading progress to external service |
sync_ratings | Sync ratings to external service |
sync_on_complete | Trigger sync when marking book as complete |
sync_direction | "push", "pull", or "bidirectional" |
Manual Sync
curl -X POST http://localhost:8080/api/v1/user/integrations/anilist/sync \
-H "Authorization: Bearer $TOKEN"
Disconnecting
curl -X DELETE http://localhost:8080/api/v1/user/integrations/anilist \
-H "Authorization: Bearer $TOKEN"