TokTagger supports multiple concurrent users with role-based access control. An admin user manages accounts and project membership; regular users annotate within the projects they are assigned to.
TokTagger has two layers of roles:
| Global Role | Permissions |
|---|---|
admin |
Full access: create/edit/delete any project, manage all user accounts, view all annotations |
user |
Access only to projects they are a member of |
| Project Role | Permissions |
|---|---|
admin |
Manage project membership, delete samples and annotations |
annotator |
Submit and update annotations for samples |
viewer |
Read-only access to the project's samples and annotations |
A global admin automatically has unrestricted access to all projects regardless of project role.
On first launch TokTagger automatically creates an admin account with a random password and prints the credentials to the terminal:
Admin user created — username: admin password: <generated>
!!! warning Save this password immediately. You can change it afterwards from the Profile page, but it is only printed once.
Navigate to http://<host>:<port>/ui/login (or the root URL, which redirects there automatically). Enter your username and password to sign in.
The admin panel is accessible from the Admin Panel button on the Projects page (visible to admin users only).
The panel lists all registered accounts with their username, email, role, and active status.
- Click Add User.
- Fill in Username, Password, and optionally Email.
- Select a Role (
useroradmin). - Click Create.
- Find the user in the table and click Edit.
- Select the new Global Role.
- Click Save.
!!! note TokTagger prevents demoting or deactivating the last remaining active admin account to avoid an unrecoverable lockout.
Click Deactivate (or Activate) next to the user. Deactivated accounts cannot sign in but their annotations are preserved. You cannot deactivate your own account.
Click Delete next to the user and confirm. This is permanent. You cannot delete your own account.
Any signed-in user can update their own profile. Click Profile from the Projects page.
Enter a new address in the Email field and click Save Email.
- Enter a new password in New password (minimum 8 characters).
- Confirm it in Confirm new password.
- Click Change Password.
Access to a project is controlled per-project. From the project's Samples page, an admin can click Members to add or remove users.
Only members (and admins) can view samples and submit annotations for a given project.
For automated deployments, the helper script scripts/setup.py can create projects and samples via the API using token-based auth:
python scripts/setup.py \
--url http://localhost:8002 \
--username admin \
--password <password>The script authenticates, obtains a JWT token, and creates projects and sample sets using the REST API. You can adapt it to pre-create user accounts with the POST /users endpoint:
import requests
token = get_token(base_url, "admin", admin_password)
requests.post(
f"{base_url}/users",
json={"username": "alice", "password": "s3cr3t", "global_role": "user"},
headers={"Authorization": f"Bearer {token}"},
)For team use, run the API under Gunicorn so multiple requests can be served concurrently:
# Command-line (installed package)
toktagger --workers 4 --host 0.0.0.0 --port 8002
# Direct Gunicorn invocation
gunicorn toktagger.api.asgi:app \
--worker-class uvicorn.workers.UvicornWorker \
--workers 4 \
--bind 0.0.0.0:8002With Docker Compose the WORKERS variable controls the worker count (default 4 in production, 1 in dev):
WORKERS=8 docker compose upA single Uvicorn worker (the default for toktagger without --workers) is sufficient for personal/local use but will serialise all requests, so concurrent annotators will experience latency under load.