Skip to content

auth

11 endpoints at a glance
MethodPathSummary
POST/auth/loginLogin
POST/auth/logoutLogout
GET/auth/meMe
PATCH/auth/meUpdate Me
POST/auth/me/passwordChange Password
POST/auth/registerRegister
GET/auth/users/List Users
POST/auth/users/Create User
DELETE/auth/users/{username}Delete User
PATCH/auth/users/{username}Update User
POST/auth/users/{username}/passwordAdmin Reset Password

auth


Login

POST
/auth/login

Verify credentials, set the session cookie, return the user.

Generic 401 on any failure — never leak whether the username exists.

Request Body

application/json
JSON
{
  
"username": "string",
  
"password": "string"
}

Responses

Successful Response

application/json
JSON
{
  
"additionalProperties": "string"
}

Playground

Body

Samples


Register

POST
/auth/register

Self-serve signup. Creates a viewer and auto-logs in.

Two failure modes return 409 — username already taken, or the
given ally code is already linked to another account. The data
layer's unique indexes (username, player_id) enforce both;
we disambiguate by inspecting which key the duplicate fired on.

Officers and admins are still admin-created via POST /auth/users/.
Self-registration intentionally has no role field on the wire.

Request Body

application/json
JSON
{
  
"username": "string",
  
"password": "string",
  
"player_id": "string"
}

Responses

Successful Response

application/json
JSON
{
  
"additionalProperties": "string"
}

Playground

Body

Samples


Logout

POST
/auth/logout

Responses

Successful Response

application/json
JSON
{
  
"additionalProperties": "string"
}

Playground

Samples


Me

GET
/auth/me

Parameters

Responses

Successful Response

application/json
JSON
{
  
"additionalProperties": "string"
}

Playground

Samples


Update Me

PATCH
/auth/me

Patch the current user's preferences.

Only fields explicitly present in the request body are touched —
pydantic's model_fields_set gives us the explicit-set list, so
we can distinguish "omit" from "set to null" without a sentinel
on the wire.

Parameters

Request Body

application/json
JSON
{
  
"player_id": "string",
  
"preferences": {
  
  
"additionalProperties": "string"
  
}
}

Responses

Successful Response

application/json
JSON
{
  
"additionalProperties": "string"
}

Playground

Body

Samples


Change Password

POST
/auth/me/password

Parameters

Request Body

application/json
JSON
{
  
"current_password": "string",
  
"new_password": "string"
}

Responses

Successful Response

application/json
JSON
{
  
"additionalProperties": "string"
}

Playground

Body

Samples


List Users

GET
/auth/users/

Parameters

Responses

Successful Response

application/json
JSON
[
  
{
  
  
"additionalProperties": "string"
  
}
]

Playground

Samples


Create User

POST
/auth/users/

Parameters

Request Body

application/json
JSON
{
  
"username": "string",
  
"password": "string",
  
"role": "viewer",
  
"player_id": "string"
}

Responses

Successful Response

application/json
JSON
{
  
"additionalProperties": "string"
}

Playground

Body

Samples


Delete User

DELETE
/auth/users/{username}

Parameters

Path Parameters

username*
Type
string
Required

Responses

Successful Response

application/json
JSON
{
  
"additionalProperties": "string"
}

Playground

Variables
Key
Value

Samples


Update User

PATCH
/auth/users/{username}

Parameters

Path Parameters

username*
Type
string
Required

Request Body

application/json
JSON
{
  
"role": "string",
  
"player_id": "string"
}

Responses

Successful Response

application/json
JSON
{
  
"additionalProperties": "string"
}

Playground

Variables
Key
Value
Body

Samples


Admin Reset Password

POST
/auth/users/{username}/password

Parameters

Path Parameters

username*
Type
string
Required

Request Body

application/json
JSON
{
  
"new_password": "string"
}

Responses

Successful Response

application/json
JSON
{
  
"additionalProperties": "string"
}

Playground

Variables
Key
Value
Body

Samples


SWGoH — Blue Sapphire Software.