Skip to main content
GET
/
api
/
admin
/
users
Admin - User Management
curl --request GET \
  --url https://api.example.com/api/admin/users \
  --header 'Content-Type: application/json' \
  --data '
{
  "role": "<string>"
}
'
{
  "id": "<string>",
  "email": "<string>",
  "emailVerified": true,
  "displayName": "<string>",
  "phoneNumber": "<string>",
  "avatarUrl": "<string>",
  "role": "<string>",
  "ownerRequestStatus": "<string>",
  "active": true,
  "lastLoginAt": {},
  "createdAt": {}
}
All admin endpoints require ADMIN role. Unauthorized requests will return 403 Forbidden.

List All Users

Retrieve a paginated list of all users with admin-level details.
curl -X GET 'https://api.sportshub.com/api/admin/users?page=0&size=20' \
  -H 'Authorization: Bearer YOUR_JWT_TOKEN'

Query Parameters

page
integer
default:"0"
Page number for pagination (0-indexed)
size
integer
default:"20"
Number of users per page

Response

id
UUID
Unique user identifier
email
string
User’s email address
emailVerified
boolean
Whether the email has been verified
displayName
string
User’s display name
phoneNumber
string
User’s phone number
avatarUrl
string
URL to user’s avatar image
role
string
User role: ADMIN, OWNER, or PLAYER
ownerRequestStatus
string
Owner request status: PENDING, APPROVED, or REJECTED
active
boolean
Whether the user account is active
lastLoginAt
timestamp
Last login timestamp
createdAt
timestamp
Account creation timestamp

Get Pending Owner Requests

Retrieve users who have requested owner role approval.
curl -X GET 'https://api.sportshub.com/api/admin/users/pending-owners' \
  -H 'Authorization: Bearer YOUR_JWT_TOKEN'

Response

Returns an array of UserProfileResponse objects with pending owner requests.

Get User By ID

Retrieve detailed information about a specific user.
curl -X GET 'https://api.sportshub.com/api/admin/users/{userId}' \
  -H 'Authorization: Bearer YOUR_JWT_TOKEN'

Path Parameters

userId
UUID
required
The unique identifier of the user

Approve Owner Request

Approve a user’s request to become a venue owner.
curl -X PATCH 'https://api.sportshub.com/api/admin/users/{userId}/approve-owner' \
  -H 'Authorization: Bearer YOUR_JWT_TOKEN'

Path Parameters

userId
UUID
required
The unique identifier of the user to approve

Response

Returns 204 No Content on success.

Reject Owner Request

Reject a user’s request to become a venue owner.
curl -X PATCH 'https://api.sportshub.com/api/admin/users/{userId}/reject-owner' \
  -H 'Authorization: Bearer YOUR_JWT_TOKEN'

Path Parameters

userId
UUID
required
The unique identifier of the user to reject

Response

Returns 204 No Content on success.

Change User Role

Manually change a user’s role in the system.
curl -X PATCH 'https://api.sportshub.com/api/admin/users/{userId}/role' \
  -H 'Authorization: Bearer YOUR_JWT_TOKEN' \
  -H 'Content-Type: application/json' \
  -d '{
    "role": "OWNER"
  }'

Path Parameters

userId
UUID
required
The unique identifier of the user

Request Body

role
string
required
New role for the user. Allowed values: ADMIN, OWNER, PLAYER

Response

Returns 204 No Content on success.

Toggle User Active Status

Activate or deactivate a user account.
curl -X PATCH 'https://api.sportshub.com/api/admin/users/{userId}/toggle-active' \
  -H 'Authorization: Bearer YOUR_JWT_TOKEN'

Path Parameters

userId
UUID
required
The unique identifier of the user

Response

Returns 204 No Content on success. The user’s active status will be toggled (active becomes inactive, inactive becomes active).

Build docs developers (and LLMs) love