Skip to main content

Overview

Borg UI uses JWT (JSON Web Token) based authentication with OAuth2 password flow. Most API endpoints require a valid access token.

Login

Authenticate and obtain an access token. Endpoint: POST /api/auth/login
string
required
Username for authentication
string
required
Password for authentication
Example Request:
Response:
string
JWT access token to use for authenticated requests
string
Always “bearer”
integer
Token expiration time in seconds (default: 43200 = 12 hours)
boolean
If true, user must change their password before accessing other endpoints

Using the Token

Include the access token in the Authorization header:

Get Current User

Retrieve information about the authenticated user. Endpoint: GET /api/auth/me Example Request:
Response:

Refresh Token

Obtain a new access token before the current one expires. Endpoint: POST /api/auth/refresh Example Request:
Response:

Logout

Invalidate the current session (client should discard the token). Endpoint: POST /api/auth/logout Example Request:
Response:

Change Password

Change the current user’s password. Endpoint: POST /api/auth/change-password
string
required
Current password
string
required
New password to set
Example Request:
Response:

Authentication Configuration

Get authentication configuration for the UI. Endpoint: GET /api/auth/config Example Request:
Response:

User Management (Admin Only)

List Users

Endpoint: GET /api/auth/users Example Request:

Create User

Endpoint: POST /api/auth/users
string
required
Username for the new user
string
required
Password for the new user
string
Email address
boolean
default:false
Whether user has admin privileges
Example Request:

Update User

Endpoint: PUT /api/auth/users/{user_id}

Delete User

Endpoint: DELETE /api/auth/users/{user_id} Example Request: