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

Name
In
Type
Required
Description

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

Name
Type
Required
Restrictions
Description

id

string

true

none

The unique identifier of the workspace

userId

string

true

none

The unique identifier of the user

Request Body Schema

Name
Type
Required
Restrictions
Description

» role

string

true

none

The new role to assign to the user (READ, WRITE, ADMIN)

Enumerated Values

Parameter
Value

» 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

Status
Meaning
Description
Schema

200

User role updated successfully

Inline

400

User not found or not validated

Inline

403

Insufficient permissions

Inline

404

User not found in workspace

Inline

500

Server error

Inline

Response Schema

Status Code 200

Name
Type
Required
Restrictions
Description

» success

boolean

true

none

Operation success status

Status Code 400

Name
Type
Required
Restrictions
Description

» success

boolean

true

none

Operation success status

» message

string

true

none

Error message

Status Code 403

Name
Type
Required
Restrictions
Description

» success

boolean

true

none

Operation success status

» message

string

true

none

Error message

Status Code 404

Name
Type
Required
Restrictions
Description

» success

boolean

true

none

Operation success status

» message

string

true

none

Error message

Status Code 500

Name
Type
Required
Restrictions
Description

» 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?