Users and API tokens

New installs have no shared token: you create the first administrator in the first-start wizard. Settings → Users & tokens adds more named users: an administrator can do everything, a viewer can look at the map, devices, hierarchy, statistics, uptime and services but cannot change anything, open the terminal, read settings, exports or backups, or see credentials. The last administrator is protected: the web interface refuses to change its role, disable it or delete it while no other enabled administrator exists (the buttons are greyed out and say why), so you cannot lock yourself out; make someone else an administrator first. (The only way back from a lockout is the command line, see Forgot the password?.) Passwords need at least 8 characters; changing one (Settings → Account, or by an administrator) ends that user’s other logins. A forgotten password is fixed from the device that runs Netlens with docker exec -it netlens python -m app.cli reset-password <user>.

Access token (older installs): if NETLENS_TOKEN is set in the container’s environment, it keeps signing in as administrator (login dialog: “Sign in with the access token instead”) and the first-start wizard does not appear. Remove it once you have an administrator account of your own; the Users page reminds you.

An administrator can create API tokens for a user (shown once). They are Bearer tokens that act with the role of their user, for scripts, Prometheus (/metrics) and the Home Assistant integration; a viewer’s token is enough for those because they only read. To be sure a token can never change anything, tick read-only when you create it: it then only reads, even when its user is an administrator. The API reference lists every endpoint.

Roles and customer views

Besides administrators and read-only viewers there is an operator role, and a viewer can be limited to some groups. See Roles and customer views.