Add User to Workspace
API Explorer: /workspaces/{workspaceId}/users
To add a user to a workspace, you need the workspaceId
of the workspace you want to add the user to and use an API key that has account admin access or a workspace manager role. For the sample code on the right, workspaceId
123456
has added user myName@myDomain.com
to the workspace with the workspace manager role.
workspaceId
of the workspace, use List Workspaces to return a list of your workspaces.Add User to Workspace
curl 'https://a.blazemeter.com/api/v4/workspaces/123456/users' \
-X POST \
-H 'Content-Type: application/json' \
--user 'api_key_id:api_key_secret' \
-d '{"usersIds":[352749],"roles": ["manager"]}'
Add User to Workspace Request Attributes
Attributes
-
usersIds
arrayrequired
The
userId
s of the user(s) you want to add as aninteger
-
roles
arrayrequired
An 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
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.
Add User to WorkspaceAdd User to Workspace POST Body (JSON)
{
"usersIds": [
352749
],
"roles": [
"manager"
]
}
Add User to Workspace Response Attributes
Attributes
-
id
integerread-only
The unique identifier for the user. Also know as a
userId
-
roles
arrayThe roles assigned to this user. Can be ONE of the following:
tester
- Workspace tester rolemanager
- Workspace manager roleviewer
- Workspace viewer role -
enabled
booleanDenotes if the user is enabled or not in the workspace
-
lastAccess
integerread-only
The timestamp of when the user last accessed the workspace
-
type
stringread-only
The level of the user. Will alwasy be
workspace
for this case -
displayName
stringread-only
The display name for the user
-
firstName
stringread-only
The first name of the user
-
lastName
stringread-only
The last name of the user
-
login
integerread-only
The timestamp of the last login for this user
-
email
stringThe email address of this user
-
access
integerread-only
The timestamp of the last access for this user
Response201 Created
{
"api_version": 4,
"error": null,
"result": [
{
"id": 123456,
"roles": [
"manager"
],
"enabled": true,
"lastAccess": 1573503678,
"type": "workspace",
"memberId": {
"$oid": "5dc9c2be4b5cab1c82345bb3"
},
"displayName": "Standard Manager",
"firstName": "Standard",
"lastName": "Manager",
"login": 1570322423,
"email": "myName@myDomain.com",
"access": 1573503678
}
],
"request_id": "5dc9c2be0ae5a"
}