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.

If you do not know the 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

  • invitationsarray

    required

    List of invitation details

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

  • idstring

    The invitation ID for the invitation that was created.

  • inviteeEmailstring

    The email address of the invited user

  • tokenstring

    The token used in the accept and reject URLs

  • accountRolesarray

    An 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 role
    billing - Account billing role
    standard - Account standard role
    user_manager - Account user manager role

  • workspacesRolesarray

    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 role
    manager - Workspace manager role
    viewer - Workspace viewer role

  • attachAutomaticallyboolean

    Denotes if the use will be added automatically without the need to click the accept link in the invitation email

  • createdinteger

    The timestamp the invitation was initially sent

  • updatedinteger

    The timestamp the invitation was changed

  • accountIdinteger

    The accountId you added the user to

  • inviteeUserIdinteger

    The userId of the newly added user

  • invitedByIdinteger

    The userId of the user who added the new user

  • workspacesIdarray

    The workspaceIds you want to add the user to

  • accountNamestring

    The name of the account the user was being added to

  • acceptUrlstring

    The URL that will accept the invitation (if used by the user that was invited)

  • rejectUrlstring

    The URL that will reject the invitation (if used by the user that was invited)

  • invitingEmailstring

    The email of the user that invited the new user

  • invitingNamestring

    The 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"
}