Skip to main content
POST
https://api.tensormesh.ai
/
v1
/
admin
/
users
/
change_role
Change User Role
curl --request POST \
  --url https://api.tensormesh.ai/v1/admin/users/change_role \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "userId": "<string>",
  "targetUserId": "<string>",
  "targetUserRole": "USER_ROLE_UNSPECIFIED"
}
'
{
  "user": {
    "id": "<string>",
    "firstName": "<string>",
    "lastName": "<string>",
    "displayName": "<string>",
    "userEmail": "<string>",
    "authProvider": "AUTH_PROVIDER_UNSPECIFIED",
    "authProviderId": "<string>",
    "avatarUrl": "<string>",
    "stripeCusId": "<string>",
    "userRole": "USER_ROLE_UNSPECIFIED",
    "apiKey": "<string>",
    "company": "<string>",
    "tosAcceptedAt": "2023-11-07T05:31:56Z",
    "surveyCompletedAt": "2023-11-07T05:31:56Z"
  }
}

Authorizations

Authorization
string
header
required

Bearer authentication using an access token. Format: Bearer <access_token>

Body

application/json

ChangeUserRoleRequest is the request for updating a user's role.

userId
string

The unique ID of the operator user.

targetUserId
string

The unique ID of the user to update.

targetUserRole
enum<string>
default:USER_ROLE_UNSPECIFIED

UserRole defines the roles a user can have within the system.

  • USER_ROLE_UNSPECIFIED: Unspecified user role.
  • USER_ROLE_USER: Standard user role.
  • USER_ROLE_ADMIN: Administrator user role.
  • USER_ROLE_SUPER_ADMIN: Super administrator user role with highest privileges.
Available options:
USER_ROLE_UNSPECIFIED,
USER_ROLE_USER,
USER_ROLE_ADMIN,
USER_ROLE_SUPER_ADMIN

Response

A successful response.

ChangeUserRoleResponse is the response for updating a user's role.

user
object

User represents a user profile in the system.