API Reference
Log in
Authenticate with username / password and receive a 30-day bearer token.
POST
/auth/loginpublicPublic — no token required. Bad credentials return a single 401 regardless of whether the username or the password was wrong. Also runs the admin-seeding self-heal and purges expired sessions opportunistically.
The
token is shown only once, here at login. Store it; it can't be retrieved again.Body
usernamestringrequiredThe account username.
passwordstringrequiredThe account password.
Request
cURL
bash
curl -X POST localhost:8000/auth/login \
-H 'Content-Type: application/json' \
-d '{"username":"admin","password":"admin"}'Responses
200Authenticated
json
{
"token": "<opaque-30-day-token>",
"expires_at": "2026-08-10T12:00:00Z",
"role": "admin",
"default_admin_active": true
}401Wrong username or password
json
{ "detail": "invalid username or password" }503Postgres unreachable
json
{ "detail": "service unavailable" }