put__workspace_{wksId}_users_{userId}
PUT /workspace/{id}/users/{userId}
Update User Role in Workspace
Update a user's role in a workspace. The authenticated user must have ADMIN access to the workspace to perform this operation.
TypeScript Client Library
public updateWorkspaceUserRole = async (workspaceId: string, userId: string, request: WorkspaceTypes.UpdateUserRoleRequest): Promise<WorkspaceTypes.UpdateUserRoleResponse> => {
return this.makeRequest<WorkspaceTypes.UpdateUserRoleResponse>(`workspace/${workspaceId}/users/${userId}`, 'PUT', request);
};
Code Samples
# You can also use wget
curl -X PUT https://backend.flashback.tech/workspace/123e4567-e89b-12d3-a456-426614174000/users/user-456 \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'Authorization: Bearer {access-token}' \
-d '{
"role": "ADMIN"
}'
Body parameter
{
"role": "ADMIN"
}
Parameters
id
path
string
true
The unique identifier of the workspace
userId
path
string
true
The unique identifier of the user
body
body
object
true
Role update data
Path Parameters
id
string
true
none
The unique identifier of the workspace
userId
string
true
none
The unique identifier of the user
Request Body Schema
» role
string
true
none
The new role to assign to the user (READ, WRITE, ADMIN)
Enumerated Values
» role
READ
» role
WRITE
» role
ADMIN
Example responses
200 Response
{
"success": true
}
400 Response
{
"success": false,
"message": "User not found or account is not validated"
}
403 Response
{
"success": false,
"message": "Insufficient permissions to manage workspace users"
}
404 Response
{
"success": false,
"message": "User not found in workspace"
}
500 Response
{
"success": false,
"message": "Failed to update user role"
}
Responses
Response Schema
Status Code 200
» success
boolean
true
none
Operation success status
Status Code 400
» success
boolean
true
none
Operation success status
» message
string
true
none
Error message
Status Code 403
» success
boolean
true
none
Operation success status
» message
string
true
none
Error message
Status Code 404
» success
boolean
true
none
Operation success status
» message
string
true
none
Error message
Status Code 500
» success
boolean
true
none
Operation success status
» message
string
true
none
Error message
Notes
Authentication Required: User must be authenticated with a valid Bearer token
Permissions: User must have ADMIN access to the workspace to update user roles
Account Validation: User account must be validated to perform this operation
User Existence: The target user must already exist in the workspace
Role Assignment: Users can be assigned READ, WRITE, or ADMIN roles
Role Hierarchy: All roles (READ, WRITE, ADMIN) can be assigned to any user
Organization Scoped: Users can only be managed within workspaces of their organization
Immediate Effect: Role changes take effect immediately
Last updated
Was this helpful?