Add User to Account
API Explorer: /accounts/{accountId}/invitations
To add a user, you need the accountId
of the account you want to add the user to and use an API key that has account admin access. For the sample code on the right, accountId
123456
has added user myName@myDomain.com
to the account automatically (skipping the invitation link process). To add a user to your account, replace the accountId
123456
with the accountId
of your account, the workspaceId
attribute with the workspaceId
of your workspace. This user will be given the account role of Standard and the workspace role of Tester.
accountId
of the account, use view the accountId
glossary section for the details on where to find this value.Add User to Account
curl 'https://a.blazemeter.com/api/v4/accounts/123456/invitations' \
-X POST \
-H 'Content-Type: application/json' \
--user 'api_key_id:api_key_secret' \
-d '{"invitations":[{"inviteeEmail":"myName@myDomain.com","attachAutomatically":true,"accountRoles":["standard"],"workspacesId":[123456],"workspacesRoles":["tester"]}]}'
Add User to Account Request Attributes
Attributes
-
invitations
arrayrequired
List of invitation details
Show/Hide Child Attributes-
inviteeEmail
stringrequired
The email address of the user you want to add
-
attachAutomatically
booleanDenotes if the use will be added automatically without the need to click the accept link in the invitation email
-
accountRoles
arrayrequired
An array of account roles that will be assigned to the user. Only ONE role should be assigned for any user, with the execption of the account
owner
role. The following are the available roles:admin
- Account admin rolebilling
- Account billing rolestandard
- Account standard roleuser_manager
- Account user manager role -
workspacesId
arrayThe
workspaceId
s you want to add the user to -
workspacesRoles
arrayAn 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
-
Add User to AccountAdd User to Account POST Body (JSON)
{
"invitations": [
{
"inviteeEmail": "myName@myDomain.com",
"attachAutomatically": true,
"accountRoles": [
"standard"
],
"workspacesId": [
123456
],
"workspacesRoles": [
"tester"
]
}
]
}
Add User to Account Response Attributes
Attributes
-
id
stringThe invitation ID for the inviation that was created
-
inviteeEmail
stringThe email address of the invited user
-
token
stringThe token used in the accept and reject URLs
-
accountRoles
arrayAn array of account roles that will be assigned to the user. Only ONE role should be assigned for any user. The following are the available roles:
admin
- Account admin rolebilling
- Account billing rolestandard
- Account standard roleuser_manager
- Account user manager role -
workspacesRoles
arrayAn 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 -
attachAutomatically
booleanDenotes if the use will be added automatically without the need to click the accept link in the invitation email
-
created
integerThe timestamp the invitation was initially sent
-
updated
integerThe timestamp the invitation was changed
-
accountId
integerThe
accountId
you added the user to -
inviteeUserId
integerThe
userId
of the newly added user -
invitedById
integerThe
userId
of the user who added the new user -
workspacesId
arrayThe
workspaceId
s you want to add the user to -
accountName
stringThe name of the account the user was being added to
-
acceptUrl
stringThe URL that will accept the invitation (if used by the user that was invited)
-
rejectUrl
stringThe URL that will reject the invitation (if used by the user that was invited)
-
invitingEmail
stringThe email of the user that invited the new user
-
invitingName
stringThe name of the user that invited the new user
Response201 Created
{
"api_version": 4,
"error": null,
"result": [
{
"id": "5dc096abb7103a3c3f284b15",
"inviteeEmail": "myName@myDomain.com",
"token": "E0SC2x7U54bn",
"accountRoles": [
"standard"
],
"workspacesRoles": [
"tester"
],
"attachAutomatically": true,
"created": 1572902571,
"updated": 1572902571,
"accountId": 123456,
"inviteeUserId": 234567,
"invitedById": 123456,
"workspacesId": [
123456
],
"accountName": "My Account",
"acceptUrl": "https://a.blazemeter.com/api/v4/accounts/123456/invitations/5dc096abb7103a3c3f284b15/accept/E0SC2x7U54bn",
"rejectUrl": "https://a.blazemeter.com/api/v4/accounts/123456/invitations/5dc096abb7103a3c3f284b15/reject/E0SC2x7U54bn",
"invitingEmail": "adminUser@myDomain.com",
"invitingName": "Admin User"
}
],
"request_id": "5dc096ab2c16d"
}