Users

Endpoints for managing users

[ADMIN] Get all users

get

Retrieves a list of all users. Required admin role

Authorizations
Responses
200
OK
*/*
get
GET /api/users HTTP/1.1
Host: localhost:8080
Authorization: Bearer JWT
Accept: */*
[
  {
    "id": 1,
    "username": "john_doe"
  }
]

[ADMIN] Create user

post

Create user with provided data. Required admin role.

Authorizations
Body
musernamestring · min: 1Required

Username of the user

Example: john_doe
mpasswordstring · min: 1Required

Password of the user

Example: securepassword123
namestringOptional

Full name of the user

Example: John Doe
Responses
200
OK
*/*
post
POST /api/users HTTP/1.1
Host: localhost:8080
Authorization: Bearer JWT
Content-Type: application/json
Accept: */*
Content-Length: 74

{
  "musername": "john_doe",
  "mpassword": "securepassword123",
  "name": "John Doe"
}
{
  "id": 1,
  "username": "john_doe"
}

[ADMIN] Link user to competition

post

Links a user to a competition. Required admin role.

Authorizations
Body

Request to link a user to a competition

userIdinteger · int64Required

ID of the user

Example: 1
competitionIdinteger · int64Required

ID of the competition

Example: 1001
Responses
200
OK
*/*
post
POST /api/users/link HTTP/1.1
Host: localhost:8080
Authorization: Bearer JWT
Content-Type: application/json
Accept: */*
Content-Length: 33

{
  "userId": 1,
  "competitionId": 1001
}
{
  "status": "OK"
}

Change password

post

Changes the password for the current user. Requires current password verification.

Authorizations
Body
currentPasswordstringRequired
newPasswordstringRequired
Responses
200
OK
*/*
post
POST /api/users/change-password HTTP/1.1
Host: localhost:8080
Authorization: Bearer JWT
Content-Type: application/json
Accept: */*
Content-Length: 47

{
  "currentPassword": "text",
  "newPassword": "text"
}
{
  "status": "OK"
}

Get current user

get

Retrieves current user.

Authorizations
Responses
200
OK
*/*
get
GET /api/users/me HTTP/1.1
Host: localhost:8080
Authorization: Bearer JWT
Accept: */*
{
  "musername": "text",
  "mpassword": "text",
  "name": "text",
  "roles": [
    "USER"
  ],
  "id": 1,
  "createdAt": "2025-06-30T18:44:48.126Z",
  "updatedAt": "2025-06-30T18:44:48.126Z",
  "authorities": [
    {
      "authority": "text"
    }
  ],
  "isAdmin": true,
  "username": "text",
  "password": "text",
  "enabled": true,
  "credentialsNonExpired": true,
  "accountNonExpired": true,
  "accountNonLocked": true
}

Was this helpful?