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.

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

  • usersIdsarray

    required

    The userIds of the user(s) you want to add as an integer

  • rolesarray

    required

    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

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

All timestamps are in UNIX Epoch time.

Attributes

  • idinteger

    read-only

    The unique identifier for the user. Also know as a userId

  • rolesarray

    The roles assigned to this user. Can be ONE of the following:
    tester - Workspace tester role
    manager - Workspace manager role
    viewer - Workspace viewer role

  • enabledboolean

    Denotes if the user is enabled or not in the workspace

  • lastAccessinteger

    read-only

    The timestamp of when the user last accessed the workspace

  • typestring

    read-only

    The level of the user. Will alwasy be workspace for this case

  • displayNamestring

    read-only

    The display name for the user

  • firstNamestring

    read-only

    The first name of the user

  • lastNamestring

    read-only

    The last name of the user

  • logininteger

    read-only

    The timestamp of the last login for this user

  • emailstring

    The email address of this user

  • accessinteger

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