Skip to main content
PUT
/
v1
/
api
/
superadmin
/
users
/
{id}
/
role
Change a user's role
curl --request PUT \
  --url http://localhost:3091/v1/api/superadmin/users/{id}/role \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "newRole": "<string>",
  "reason": "<string>"
}
'
{
  "id": 123,
  "firstName": "<string>",
  "lastName": "<string>",
  "username": "<string>",
  "email": "<string>",
  "phoneNumber": "<string>",
  "nationality": "<string>",
  "birthDate": "<string>",
  "enabled": true,
  "banned": true,
  "banReason": "<string>",
  "bannedAt": "2023-11-07T05:31:56Z",
  "roles": [
    "<string>"
  ],
  "walletBalance": 123,
  "pendingWithdrawalAmount": 123,
  "totalEarned": 123,
  "totalWithdrawn": 123,
  "stripeConnectedAccountId": "<string>",
  "stripeAccountComplete": true,
  "kycStatus": "PENDING",
  "kycSubmittedAt": "2023-11-07T05:31:56Z",
  "kycReviewedAt": "2023-11-07T05:31:56Z",
  "totalAnnonces": 123,
  "totalReservationsAsSender": 123,
  "totalReservationsAsCarrier": 123,
  "totalTransactions": 123,
  "createdAt": "2023-11-07T05:31:56Z",
  "updatedAt": "2023-11-07T05:31:56Z",
  "lastLoginAt": "2023-11-07T05:31:56Z"
}

Authorizations

Authorization
string
header
required

JWT access token from POST /v1/api/auth/login

Path Parameters

id
integer<int32>
required

Body

application/json
newRole
string
required
reason
string

Response

Role changed

id
integer<int32>
firstName
string
lastName
string
username
string
email
string
phoneNumber
string
nationality
string
birthDate
string
enabled
boolean
banned
boolean
banReason
string
bannedAt
string<date-time>
roles
string[]
walletBalance
number
pendingWithdrawalAmount
number
totalEarned
number
totalWithdrawn
number
stripeConnectedAccountId
string
stripeAccountComplete
boolean
kycStatus
enum<string>
Available options:
PENDING,
APPROVED,
REJECTED,
EXPIRED
kycSubmittedAt
string<date-time>
kycReviewedAt
string<date-time>
totalAnnonces
integer<int32>
totalReservationsAsSender
integer<int32>
totalReservationsAsCarrier
integer<int32>
totalTransactions
integer<int32>
createdAt
string<date-time>
updatedAt
string<date-time>
lastLoginAt
string<date-time>