Workspace Users
Update User Role
Change a member's role within a workspace.
PUT
/open/workspaces/{workspaceId}/users/{userId}/update-roleChange a member's role within a workspace.
#Authentication & Scope
Requires the workspace-users-write ability and admin privileges in the workspace.
#Request
http
PUT /open/workspaces/{workspaceId}/users/{userId}/update-role HTTP/1.1
Host: api.sharaforms.com
Content-Type: application/json
Authorization: Bearer <token>#Path Parameters
| Parameter | Type | Description |
|---|---|---|
| workspaceId | number | ID of the workspace. |
| userId | number | ID of the user to update. |
#Body Parameters
| Field | Type | Required | Description |
|---|---|---|---|
| role | string | Yes | New role (admin, user, or readonly). |
Example:
json
{
"role": "readonly"
}#Response
200 OK – Confirmation message.
json
{
"message": "User role changed successfully."
}403 Forbidden – Token lacks workspace-users-write or you lack permission.