Get started

Users

Authentication and user management.


Login

POST /user/login

Authenticate with username and password. Sets access_token and refresh_token as HTTP-only cookies.

Request body

username string required
Username
password string required
Password
Response
{
  "id": "550e8400-e29b-41d4-a716-446655440000",
  "username": "admin",
  "name": "Admin",
  "email": "admin@example.com",
  "isAdmin": true
}

Logout

POST /user/logout

Invalidate the current session and clear auth cookies.

Refresh Token

POST /user/refresh

Refresh the access token using the refresh token cookie.

Response
{
  "accessToken": "eyJhbGciOiJIUzI1NiIs...",
  "expiresIn": 900
}

Current User

GET /user

Get the currently authenticated user's profile.

Response
{
  "id": "550e8400-e29b-41d4-a716-446655440000",
  "username": "admin",
  "name": "Admin",
  "email": "admin@example.com",
  "isAdmin": true
}

Change Password

POST /user/change-password

Change the current user's password.

Request body

oldPassword string required
Current password
newPassword string required
New password

List Users

GET /users Admin

List all user accounts.

Response
[
  {
    "id": "550e8400-e29b-41d4-a716-446655440000",
    "username": "admin",
    "name": "Admin",
    "email": "admin@example.com",
    "isAdmin": true
  },
  {
    "id": "6ba7b810-9dad-11d1-80b4-00c04fd430c8",
    "username": "jdoe",
    "name": "Jane Doe",
    "email": "jane@example.com",
    "isAdmin": false
  }
]

Create User

POST /users Admin

Create a new user account.

Request body

username string required
Username
password string required
Password
name string required
Full name
email string required
Email address
Response
{ "status": "created" }

Get User

GET /users/{userId} Admin

Get a specific user by ID.

Response
{
  "id": "550e8400-e29b-41d4-a716-446655440000",
  "username": "jdoe",
  "name": "Jane Doe",
  "email": "jane@example.com",
  "isAdmin": false
}

Update User

PATCH /users/{userId} Admin

Update a user's details. Only provided fields are changed.

Request body

username string
New username
name string
New name
email string
New email
newPassword string
New password
Response
{
  "id": "550e8400-e29b-41d4-a716-446655440000",
  "username": "jdoe",
  "name": "Jane Doe",
  "email": "jane-updated@example.com",
  "isAdmin": false
}