Skip to API content
TalkLabs API Docs v3
Recipes
POST User sessions & access

Set a user role

Change the role stored on a user.

POST /api/v3/{appid}/user/users/{userid}/role

Change the role stored on a user.

Use a trusted backend API token, or an authorized administrator user token. In applications that share a user pool, the stored role applies across that pool.

Request

Parameters

Values in the path and query string.

appid path
string TalkLabs ID required

The application the user belongs to.

Example: your-app-id
userid path
string customer-defined required

The user whose role is being changed.

Example: u-8842
Request

JSON body

Send as application/json.

role
string required

Required "user", "moderator", or "admin". Fail closed: anything else is a 400.

Request example
{
  "role": "<role>"
}
Response

Status codes

Every JSON response uses the API result envelope.

200 OK ApiResult
400 Bad Request ApiResult
403 Forbidden ApiResult
404 Not Found ApiResult
500 Internal Server Error ApiResult
Search all 118 endpoints Try “join room”, “moderate”, or “POST”.
Request environment

Connect your application

These values fill request examples and the API console. They stay in this browser tab and are never sent to TalkLabs until you run a request.

Credentials are stored in sessionStorage, not in cookies or analytics.