Skip to content
Stand with Ukraine flag

User management

TBMQ is initialized with a default admin user ([email protected] / sysadmin). In production, create a dedicated admin user and either remove the default account or change its password.

All examples below use curl. Replace localhost:8083 with your server address if TBMQ is running remotely.

Obtain an access token by logging in:

Terminal window
curl --location --request POST 'http://localhost:8083/api/auth/login' \
--header 'Content-Type: application/json' \
--data-raw '{
"username":"[email protected]",
"password":"sysadmin"
}'

The response contains a token field. Export it for use in subsequent requests:

Terminal window
export ACCESS_TOKEN=PLACE_YOUR_TOKEN_HERE
Terminal window
curl --location --request GET "http://localhost:8083/api/admin?pageSize=50&page=0" \
--header "X-Authorization: Bearer $ACCESS_TOKEN"

Each user entity has a unique id that can be used to update or delete that user.

Terminal window
curl --location --request POST 'http://localhost:8083/api/admin' \
--header "X-Authorization: Bearer $ACCESS_TOKEN" \
--header 'Content-Type: application/json' \
--data-raw '{
"id":$USER_ID,
"email":"[email protected]",
"password":"test",
"firstName":"test",
"lastName":"test",
"roleName": "ADMIN"
}'

If $USER_ID is null or the id field is absent, a new user is created. Otherwise, the user with the given ID is updated.

Terminal window
curl --location --request DELETE 'http://localhost:8083/api/admin/$USER_ID' \
--header "X-Authorization: Bearer $ACCESS_TOKEN"

Replace $USER_ID with the actual ID of the user you want to delete.