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
-
invitationsarrayrequired
List of invitation details
Show/Hide Child Attributes
-
inviteeEmailstringrequired
The email address of the user you want to add
-
attachAutomaticallybooleanDenotes if the use will be added automatically without the need to click the accept link in the invitation email
-
accountRolesarrayrequired
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
ownerrole. The following are the available roles:admin- Account admin rolebilling- Account billing rolestandard- Account standard roleuser_manager- Account user manager role -
workspacesIdarrayThe
workspaceIds you want to add the user to -
workspacesRolesarrayAn 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
All timestamps are in UNIX Epoch time.
Attributes
-
idstringThe invitation ID for the invitation that was created.
-
inviteeEmailstringThe email address of the invited user
-
tokenstringThe token used in the accept and reject URLs
-
accountRolesarrayAn 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 -
workspacesRolesarrayAn 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 -
attachAutomaticallybooleanDenotes if the use will be added automatically without the need to click the accept link in the invitation email
-
createdintegerThe timestamp the invitation was initially sent
-
updatedintegerThe timestamp the invitation was changed
-
accountIdintegerThe
accountIdyou added the user to -
inviteeUserIdintegerThe
userIdof the newly added user -
invitedByIdintegerThe
userIdof the user who added the new user -
workspacesIdarrayThe
workspaceIds you want to add the user to -
accountNamestringThe name of the account the user was being added to
-
acceptUrlstringThe URL that will accept the invitation (if used by the user that was invited)
-
rejectUrlstringThe URL that will reject the invitation (if used by the user that was invited)
-
invitingEmailstringThe email of the user that invited the new user
-
invitingNamestringThe 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"
}