# Admin

> Invite the first administrator, and keep the admin API to your own networks.

From `docs/server.md` in tensile-tools/tensile-auth at commit `e66760d` (v0.4.1-7-ge66760d). The HTML page is https://auth.tensile.tools/docs/server/admin.

The admin API serves `/admin/` on every server with a database. Only people in the server's administrators table reach it, and only with a second factor.

1. Run `tensile-auth-server admin invite`. With Docker, run it inside the container:

   ```sh
   docker exec tensile-auth /tensile-auth-server admin invite
   ```

1. Open the link it prints within 15 minutes. The link is `{first origin}/admin/invite#inv_…`; the code stays in the fragment, so it never reaches a log.
1. Sign in with a passkey. The invitation works once.

`admin list` shows the administrators, and `admin grant USER` and `admin revoke USER` change them. To expose the admin API, have the app's proxy forward `/admin/`, and set `admin.allowed_networks` to keep it to your office or VPN; outside those networks every admin path answers 404.

Every admin route, with its parameters and answers, is in the [admin API reference](/docs/reference/api/admin).
