Skip to main content
PUT
/
workspaces
/
{workspaceId}
/
users
/
{userId}
/
update-role
Update User Role
curl --request PUT \
  --url https://api.raydocs.com/workspaces/{workspaceId}/users/{userId}/update-role \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "role": "admin"
}
'

Authentication & Scope

Requires the workspace-users-write ability.

Request

PUT /workspaces/1/users/5/update-role HTTP/1.1
Host: api.raydocs.com
Authorization: Bearer <token>
Content-Type: application/json

{
  "role": "admin"
}

Path Parameters

ParameterTypeRequiredDescription
workspaceIdintegerYesThe workspace ID
userIdintegerYesThe user ID to update

Body Parameters

ParameterTypeRequiredDescription
rolestringYesNew role: admin, user, or readonly

Response

200 OK – Role updated successfully.
{
  "message": "Role updated successfully"
}
404 Not Found – User is not a member of this workspace.

Authorizations

Authorization
string
header
required

Personal Access Token

Path Parameters

workspaceId
integer
required
userId
integer
required

Body

application/json
role
enum<string>
required
Available options:
admin,
user,
readonly

Response

Role updated