Update Workspace User
API Explorer: /workspaces/{workspaceId}/users/{userId}
To change a user's workspace role and disable or enable an user in the workspace, a workspaceId and an userId are required. The sample code changes the workspace role of userId of 123456 within workspaceId of 123456 to viewer and disables the user. Use the actual ID value for the workspace and user you are wanting to change.
workspaceId of the workspace, use List Workspaces to return a list of your workspaces.Update Workspace User
curl 'https://a.blazemeter.com/api/v4/workspaces/123456/users/123456' \
-X PUT \
-H 'Content-Type: application/json' \
--user 'api_key_id:api_key_secret' \
-d '{"roles":["viewer"],"enabled": false}'
Update Workspace User Request Attributes
Attributes
-
rolesarrayAn array of workspace roles that will be assigned to the user. Only ONE role should be assigned for any user. The following are the available roles:
tester- Workspace tester rolemanager- Workspace manager roleviewer- Workspace viewer role -
enabledbooleanDenotes if the user is enabled or disabled in the account
The following JSON sample provides a more readable version of the content contained in the above curl example. This example represents the attributes and values contained in the -d flag of the curl example.
Update Workspace UserUpdate Workspace User PUT Body (JSON)
{
"roles": [
"viewer"
],
"enabled": false
}
Update Workspace User Response Attributes
For a breakdown of the response attributes, see the Add User to Workspace Response Attributes section.
Response200 OK
{
"api_version": 4,
"error": null,
"result": {
"id": 123456,
"roles": [
"viewer"
],
"enabled": false,
"lastAccess": 1573506574,
"type": "workspace",
"displayName": "Viewer User",
"login": 1562944843,
"email": "viwerUser@myDomain.com"
},
"request_id": "5dc9ce0e3076d"
}