Users API Code Samples

Selection of code samples that demonstrate the use of the Users API. Copy and edit these code samples to suit your needs.

When using the code samples, remember to replace:

  • {vanity_name} with your tenant name
  • {api_key} with your API key
  • {security_token} with a valid security token

These code samples may not include all available parameters and request body fields for each endpoint. For the endpoint's full request schema, see "Users" in API Reference.

Users API V2

Note: Limited Availability This feature is in limited availability. If you are interested, please contact your Customer Success Manager.

Add users

Use this sample request to add new users to your tenant.

Copy
cURL sample request: Add users 5a4dsasdf55 and 6b5etbteg66
curl -X POST --url 'https://{vanity_name}.api.visier.io/v2/admin/users' \
-H 'apikey:{api_key}' \
-H 'Cookie:VisierASIDToken={security_token}'
-d '{
    "userIds": [
        "5a4dsasdf55",
        "6b5etbteg66"
    ]
}'

The response returns whether or not the request was successful for each user ID.

Update users

Use this sample request to update one or more users.

Copy
cURL sample request: Update users 82424d8b-f99c-cd4d-9ac7-568919d9a0e4 and 93535e9c-g00d-de5e-0bd8-679020e0b1f5
curl -X PUT --url 'https://{vanity_name}.api.visier.io/v2/admin/users' \
-H 'apikey:{api_key}' \
-H 'Cookie:VisierASIDToken={security_token}'
-d {
    "users": [
      {
        "userId": "82424d8b-f99c-cd4d-9ac7-568919d9a0e4",
        "displayName": "John Doe",
        "employeeId": "Employee-1",
        "accountEnabled": "true",
        "email": "john@jupiter.com"
      },
      {
        "userId": "93535e9c-g00d-de5e-0bd8-679020e0b1f5",
        "displayName": "Jane Smith",
        "employeeId": "Employee-2",
        "accountEnabled": "true",
        "email": "jane@jupiter.com"
      }
    ]
}

The response returns whether the updates were successful.

Delete users

Use this sample request to delete users from your tenant.

Copy
cURL sample request: Delete users 5a4dsasdf55 and 6b5etbteg66
curl -X DELETE --url 'https://{vanity_name}.api.visier.io/v2/admin/users' \
-H 'apikey:{api_key}' \
-H 'Cookie:VisierASIDToken={security_token}'
-d '{
    "userIds": [
        "5a4dsasdf55",
        "6b5etbteg66"
    ]
}'

The response returns whether or not the deletion was successful for each user ID.

User groups API V2

Note: Alpha This API is in alpha. While in alpha, APIs may change in a breaking way without notice; functionality may be removed, and no deprecation notices will be issued. If you are interested in using this API, please contact your Customer Success Manager (CSM).

Retrieve a list of user groups

Use this sample request to retrieve all user groups in your tenant.

Copy
cURL sample request: Retrieve all user groups
curl -X GET --url 'https://{vanity_name}.api.visier.io/v2alpha/admin/user-groups' \
-H 'apikey:{api_key}' \
-H 'Cookie:VisierASIDToken={security_token}'

To retrieve user groups that exist in a project that hasn't been published to production, use the ProjectID request header, as shown in the following sample.

Copy
cURL sample request: Retrieve all user groups in the project a1a02d74-2c54-40fd-b171-ec7d9a4c0952
curl -X GET --url 'https://{vanity_name}.api.visier.io/v2alpha/admin/user-groups' \
-H 'apikey:{api_key}' \
-H 'Cookie:VisierASIDToken={security_token}'
-H 'ProjectID:a1a02d74-2c54-40fd-b171-ec7d9a4c0952'

The response returns details about the available user groups.

Retrieve the details of a user group

By default, retrieving a specific user group returns all details about the user group, such as its display name, description, assigned users, and assigned permissions.

Use this sample request to retrieve information about a specific user group.

Copy
cURL sample request: Retrieve the details of user group 7a3e1411-5c32-49f0-8715-d529014718fc
curl -X GET --url 'https://{vanity_name}.api.visier.io/v2alpha/admin/user-groups/7a3e1411-5c32-49f0-8715-d529014718fc' \
-H 'apikey:{api_key}' \
-H 'Cookie:VisierASIDToken={security_token}'

The response returns the user group's permissions and users.

Create multiple user groups

This endpoint supports the ProjectID request header to make changes in a project. For more information, see Projects API. Use the following sample request to create user groups in a project. If you omit the ProjectID request header, the request is immediately published to your production version.

Copy
cURL sample request: Create user groups in a project
curl -X POST --url 'https://{vanity_name}.api.visier.io/v2alpha/admin/user-groups' \
-H 'apikey:{api_key}' \
-H 'Cookie:VisierASIDToken={security_token}'
-H 'ProjectID:5a031f08-5895-4e54-9333-32de249f2e5a' \
-d '{
    "userGroups": [
       {
            "displayName": "Permission for all users",
            "description": "User population is all users",
            "permissionIds": {
                "ids": [
                    "a117ecb5-2b6f-402e-bcd9-0a5c42adcc76"
                ]
            },
            "users": {
                "includeAllUsers": true
            }
        },
        {
            "displayName": "Dynamic user population",
            "description": "Compound filter for user population",
            "permissionIds": {
                "ids": [
                    "9cefbf06-b4b3-490c-bf04-5fbee0ba85b5",
                    "06a1e2cf-a8e2-4927-92ac-c943a2f4f3e5"
                ]
            },
            "users": {
                "dynamicFilterDefinition": {
                    "filters": [
                        {
                            "dimensionFilters": [
                                {
                                    "dimensionId": "Organization_Hierarchy",
                                    "memberSelections": [
                                        {
                                            "namePath": [ "Sales" ]
                                        },
                                        {
                                            "namePath": [ "IT" ]
                                        }
                                    ]
                                }
                            ]
                        }
                    ]
                }
            }
        },
        {
            "displayName": "Admin tenant level",
            "description": "Grants permission to all but a few users",
            "permissionIds": {
                "ids": [
                    "cae0d8c1-1278-4900-9297-7ea3e789b169"
                ]
            },
            "users": {
                "includeAllUsers": true,
                "manuallyExcludedIds": {
                    "ids": [
                        "7e2809c4-fd3c-6f44-b4f4-95492904bce2",
                        "72a6c22e-76be-a24a-92f7-7cbbed16fd58",
                        "02393fdc-3b43-9648-b042-a589a781a9d0"
                    ]
                }
            }
        }
    ]
}'

Use this sample request to add multiple new user groups to your production version.

Copy
cURL sample request: Add a user group in the default tenant
curl -X POST --url 'https://{vanity_name}.api.visier.io/v2alpha/admin/user-groups' \
-H 'apikey:{api_key}' \
-H 'Cookie:VisierASIDToken={security_token}'
-d '{
    "userGroups": [
       {
            "displayName": "Permission for all users",
            "description": "User population is all users",
            "permissionIds": {
                "ids": [
                    "a117ecb5-2b6f-402e-bcd9-0a5c42adcc76"
                ]
            },
            "users": {
                "includeAllUsers": true
            }
        },
        {
            "displayName": "Dynamic user population",
            "description": "Compound filter for user population",
            "permissionIds": {
                "ids": [
                    "9cefbf06-b4b3-490c-bf04-5fbee0ba85b5",
                    "06a1e2cf-a8e2-4927-92ac-c943a2f4f3e5"
                ]
            },
            "users": {
                "dynamicFilterDefinition": {
                    "filters": [
                        {
                            "dimensionFilters": [
                                {
                                    "dimensionId": "Organization_Hierarchy",
                                    "memberSelections": [
                                        {
                                            "namePath": [ "Sales" ]
                                        },
                                        {
                                            "namePath": [ "IT" ]
                                        }
                                    ]
                                }
                            ]
                        }
                    ]
                }
            }
        },
        {
            "displayName": "Admin tenant level",
            "description": "Grants permission to all but a few users",
            "permissionIds": {
                "ids": [
                    "cae0d8c1-1278-4900-9297-7ea3e789b169"
                ]
            },
            "users": {
                "includeAllUsers": true,
                "manuallyExcludedIds": {
                    "ids": [
                        "7e2809c4-fd3c-6f44-b4f4-95492904bce2",
                        "72a6c22e-76be-a24a-92f7-7cbbed16fd58",
                        "02393fdc-3b43-9648-b042-a589a781a9d0"
                    ]
                }
            }
        }
    ]
}'

The response returns whether the request was successful.

Update multiple user groups

Use the following sample requests to update one or more existing user groups in your tenant. You can update user groups through PUT or PATCH.

  • PUT: Use the PUT method to completely replace the definition of a user group. Any fields omitted from the request are removed or replaced by the default value.
  • PATCH: Use the PATCH method to change specific fields in the user group without affecting omitted fields.

You can use v2alpha/admin/user-groups to change the display name, description, permissions, and users assigned to a user group.

In this PUT request, the API call replaces a user group's definition to change its display name, description, assigned permissions, and assigned users. Because it's a PUT request, any previously-assigned permissions or users are replaced by the new definition.

Copy
cURL sample PUT request: Update a user group
curl -X PUT --url 'https://{vanity_name}.api.visier.io/v2alpha/admin/user-groups' \
-H 'apikey:{api_key}' \
-H 'Cookie:VisierASIDToken={security_token}'
-d '{
    "userGroups": [
        {
            "userGroupId": "7a3e1411-5c32-49f0-8715-d529014718fc",
            "displayName": "Dynamic user population - Updated",
            "description": "Compound filter for user population. Updated with PUT method",
            "permissionIds": {
                "ids": [
                    "9cefbf06-b4b3-490c-bf04-5fbee0ba85b5",
                    "06a1e2cf-a8e2-4927-92ac-c943a2f4f3e5",
                    "a117ecb5-2b6f-402e-bcd9-0a5c42adcc76"
                ]
            },
            "users": {
                "includeAllUsers": false,
                "dynamicFilterDefinition": {
                    "filters": [
                        {
                            "filterId": "b4938c10-bd46-4c38-8908-d48166f407d1",
                            "analyticObjectId": "Employee",
                            "dimensionFilters": [
                                {
                                    "dimensionId": "Organization_Hierarchy",
                                    "memberSelections": [
                                        {
                                            "isExcluded": false,
                                            "namePath": [
                                                "Sales"
                                            ]
                                        },
                                        {
                                            "isExcluded": false,
                                            "namePath": [
                                                "IT"
                                            ]
                                        }
                                    ]
                                }
                            ]
                        }
                    ]
                }
            }
        }
    ]
}'

The response returns whether the user group updates were successful.

In this PATCH request, the API call updates a user group to change its display name and assigned permissions. Because it's a PATCH request, the permissions defined in the request are added to the user group in addition to any previously-defined permissions.

Copy
cURL sample PATCH request: Patch a user group
curl -X PATCH --url 'https://{vanity_name}.api.visier.io/v2alpha/admin/user-groups' \
-H 'apikey:{api_key}' \
-H 'Cookie:VisierASIDToken={security_token}'
-d '{
    "userGroups": [
        {
            "userGroupId": "7a3e1411-5c32-49f0-8715-d529014718fc",
            "displayName": "Dynamic user population",
            "description": "Compound filter for user population.",
            "permissionIds": {
                "ids": [
                    "9cefbf06-b4b3-490c-bf04-5fbee0ba85b5",
                    "06a1e2cf-a8e2-4927-92ac-c943a2f4f3e5"
                ]
            }
        }
    ]
}'

The response returns whether the user group updates were successful.

Delete multiple user groups

Use this sample request to delete a list of user groups.

Copy
cURL sample request: Delete user groups
curl -X DELETE --url 'https://{vanity_name}.api.visier.io/v2alpha/admin/user-groups' \
-H 'apikey:{api_key}' \
-H 'Cookie:VisierASIDToken={security_token}' \
-d '{
  "userGroups": [
    {
      "userGroupId": "9a87669a-01d7-45bc-8176-823a557468d2",
    },
    {
      "userGroupId": "0c14d9fe-e5f7-4eb4-8ccd-ebd4c639da94",
    },
    {
      "userGroupId": "fb861a49-c9e0-4e79-8ccf-3f1156014766",
    }
  ]
}'

The response returns the successfully and unsuccessfully deleted user groups.

Delete a user group

Use this sample request to delete a specific user group.

Copy
cURL sample request: Delete user group 7a3e1411-5c32-49f0-8715-d529014718fc
curl -X DELETE --url 'https://{vanity_name}.api.visier.io/v2alpha/admin/user-groups/7a3e1411-5c32-49f0-8715-d529014718fc' \
-H 'apikey:{api_key}' \
-H 'Cookie:VisierASIDToken={security_token}'

The response returns whether the deletion was successful.

Users API V1

Retrieve a list of all users

Use this sample request to retrieve all the users in your tenant.

Copy
cURL sample request: Retrieve a list of all users
curl -X GET --url 'https://{vanity_name}.api.visier.io/v1/admin/users' \
-H 'apikey:{api_key}' \
-H 'Cookie:VisierASIDToken={security_token}'

The response returns details about each user in your tenant.

Retrieve a user's details

Use this sample request to retrieve the details of a specific user in your tenant.

Copy
cURL sample request: Retrieve the details of user 7f184182-aacc-1f49-85a6-959e8f2f2c7e
curl -X GET --url 'https://{vanity_name}.api.visier.io/v1/admin/users/7f184182-aacc-1f49-85a6-959e8f2f2c7e' \
-H 'apikey:{api_key}' \
-H 'Cookie:VisierASIDToken={security_token}'

To retrieve the details of a user in a project that hasn't been published to production, use the ProjectID request header, as shown in the following sample.

Copy
cURL sample request: Retrieve the details of user 984b70fe-08b8-e949-8e74-9162132d9e4e in project 3f441760-85c7-455b-befc-e2e174239a25
curl -X GET --url 'https://{vanity_name}.api.visier.io/v1/admin/users/984b70fe-08b8-e949-8e74-9162132d9e4e?assignedUserGroups=true&assignedPermissions=true' \
-H 'apikey:{api_key}' \
-H 'Cookie:VisierASIDToken={security_token}' \
-H 'ProjectID:3f441760-85c7-455b-befc-e2e174239a25'

The response returns details about the specified user.

Retrieve a list of all user groups

Note: This action is available in Users V1 and User Groups V2. For User Groups V2, see Retrieve a list of user groups above.

Use this sample request to retrieve all user groups in your tenant.

Copy
cURL sample request: Retrieve all user groups
curl -X GET --url 'https://{vanity_name}.api.visier.io/v1/admin/user-groups' \
-H 'apikey:{api_key}' \
-H 'Cookie:VisierASIDToken={security_token}'

The response returns details about the available user groups.

Retrieve a list of user group users

Note: This action is available in Users V1 and User Groups V2. For User Groups API V2, see Retrieve the details of a user group above.

Use this sample request to retrieve all the users in a specific user group.

Copy
cURL sample request: Retrieve all users in user group d2c53a43-b62b-4d18-b95a-345f0a05e1d1
curl -X GET --url 'https://{vanity_name}.api.visier.io/v1/admin/user-groups/d2c53a43-b62b-4d18-b95a-345f0a05e1d1/users' \
-H 'apikey:{api_key}' \
-H 'Cookie:VisierASIDToken={security_token}'

To retrieve user groups users that exist in a project that hasn't been published to production, use the ProjectID request header, as shown in the following sample.

Copy
cURL sample request: Retrieve all users in the user group 481daf14-5093-46b0-a168-b4c712aaff0c in the project fd2c83f5-440e-4ade-a2bb-7a7c22c95d2c
curl -X GET --url 'https://{vanity_name}.api.visier.io/v1/admin/user-groups/481daf14-5093-46b0-a168-b4c712aaff0c/users' \
-H 'apikey:{api_key}' \
-H 'Cookie:VisierASIDToken={security_token}'
-H 'ProjectID:fd2c83f5-440e-4ade-a2bb-7a7c22c95d2c'

The response returns details about the user group users.

Retrieve users that are assigned a specific permission

Use this sample request to retrieve all the users assigned to a specified permission.

Copy
cURL sample request: Retrieve all users assigned to permission cae0d8c1-1278-4900-9297-7ea3e789b169
curl -X GET --url 'https://{vanity_name}.api.visier.io/v1/admin/permissions/cae0d8c1-1278-4900-9297-7ea3e789b169/users' \
-H 'apikey:{api_key}' \
-H 'Cookie:VisierASIDToken={security_token}'

To retrieve users assigned a specific permission in a project that hasn't been published to production, use the ProjectID request header, as shown in the following sample.

Copy
cURL sample request: Retrieve all user assigned to permission cae0d8c1-1278-4900-9297-7ea3e789b169 in the project fd2c83f5-440e-4ade-a2bb-7a7c22c95d2c
curl -X GET --url 'https://{vanity_name}.api.visier.io/v1/admin/permissions/cae0d8c1-1278-4900-9297-7ea3e789b169/users' \
-H 'apikey:{api_key}' \
-H 'Cookie:VisierASIDToken={security_token}'
-H 'ProjectID:fd2c83f5-440e-4ade-a2bb-7a7c22c95d2c'

The response returns information about the users assigned to the permission, including how the permission was assigned to the user.

Retrieve a list of all permissions in XLSX format

Use this sample request to retrieve all the permissions in your tenant in XLSX format.

Copy
cURL sample request: Retrieve all the permissions in XLSX format
curl -X GET --url 'https://{vanity_name}.api.visier.io/v1/admin/users/reports/permissions-list' \
-H 'apikey:{api_key}' \
-H 'Cookie:VisierASIDToken={security_token}'

The response returns information an XLSX file called "permissions_list_<timestamp>.xlsx" that contains the Permission List sheet.

This sheet contains the following information:

Column Description
Permission Name The name of the permission.
Permission Description An optional statement that explains what the permission is and how to use it.
Permission ID The unique identifier of the permission.

Retrieve user permissions in XLSX format

Use this sample request to retrieve all the permissions assigned to users in your tenant.

Copy
cURL sample request: Retrieve all the permissions and their user assignments
curl -X GET --url 'https://{vanity_name}.api.visier.io/v1/admin/users/reports/permission-assignments' \
-H 'apikey:{api_key}' \
-H 'Cookie:VisierASIDToken={security_token}'

The response returns information an XLSX file called "permission_Assignments_<timestamp>.xlsx" that contains the following sheets:

Users Permission Assignment

A list of users and the permissions assigned to them.

This sheet contains the following information:

Column Description
Username The email of the user.
Name The full name of the user.
Permission Display Name The name of the permission.
User Group The name of the User Group where the data access comes from. Assigned Directly indicates that data access was granted through an assigned permission and not through the membership in a User Group.
Full Access Indicates whether full access to all data is granted by the permission.

Users Without Permissions

A list of users that do not have any permissions.

This sheet contains the following information:

Column Description
Username The email of the user.
Name The full name of the user.

Permission Usage

A summary of the permissions and their usage.

This sheet contains the following information:

Column Description
Permission Display Name The name of the permission.
Users Using Permission The total number of users assigned this permission.
User Groups Using Permission The total number of User Groups using this permission.

Retrieve user profile assignments in XLSX format

Use this sample request to retrieve all the profiles assigned to users in your tenant.

Copy
cURL sample request: Retrieve all the profiles and their user assignments
curl -X GET --url 'https://{vanity_name}.api.visier.io/v1/admin/users/reports/profile-assignments' \
-H 'apikey:{api_key}' \
-H 'Cookie:VisierASIDToken={security_token}'

The response returns information an XLSX file called "profile_Assignments_<timestamp>.xlsx" that contains the following sheets:

Local Profile Assignments

A list of profiles assigned to each user. For administrating tenant users, these are the users assigned administrating tenant profiles. For analytic tenant users, these are all the users assigned profiles in your tenant.

This sheet contains the following information:

Column Description
User ID The unique identifier of the user.
User Name The full name of the user.
Profile ID The unique identifier of the profile.
Profile Name The name of the profile.
Expiry Date The date that the profile will no longer be valid for the user. If "indefinite", the profile does not expire for the user.
Status Indicates whether the profile is enabled for the user.

System Profile Assignments

A list of analytic tenant profiles assigned to each user in the administrating tenant. This sheet is empty for analytic tenant users.

This sheet contains the following information:

Column Description
User ID The unique identifier of the user.
User Name The full name of the user.
Profile ID The unique identifier of the profile.
Profile Name The name of the profile.
Tenant Name The tenant that the user has access to with this profile.
Expiry Date The date that the profile will no longer be valid for the user. If "indefinite", the profile does not expire for the user.
Status Indicates whether the profile is enabled for the user.
Column Description

Retrieve the Application Logs

Use this sample request to retrieve the Application Log for your tenant.

Copy
cURL sample request: Get the Application Log in XLSX format
curl -X GET --url 'https://{vanity_name}.api.visier.io/v1/admin/users/reports/application-logs?startTime=1663632418220?endTime=1663632500000' \
-H 'apikey:{api_key}' \
-H 'Cookie:VisierASIDToken={security_token}'

The response returns an XLSX file "application_logs_<timestamp>.xlsx" that contains the Application Logs sheet. The log contains the following information:

Column Description
Time (UTC) The time the event occurred.
Category The type of event that was logged.
Functionality The action that the user performed.
Description Whether or not the event was a user logon.
User The user who performed the action.
IP Address The IP address that the user logged on from.
Details Additional information related to the action that was performed. For example, what user was deleted.
Project ID The unique identifier of the project that the user performed an action in.
Project Name The display name of the project that the user performed an action in.
Project State The status of the project.

Retrieve the Data Security Report

Use this sample request to retrieve the Data Security Report for your tenant.

Copy
cURL sample request: Get the Data Security Report for user 82424d8b-f99c-cd4d-9ac7-568919d9a0e4 in XLSX format
curl -X GET --url 'https://{vanity_name}.api.visier.io/v1/admin/users/82424d8b-f99c-cd4d-9ac7-568919d9a0e4/reports/data-security' \
-H 'apikey:{api_key}' \
-H 'Cookie:VisierASIDToken={security_token}'

The response returns an XLSX file "data_security_report_<timestamp>.xlsx" that contains the Data Security Report sheet. The log contains the following information:

Column Description
Username The email of the user.
Name The full name of the user.
Property Display Name The name of the property that data security is being defined for.
Access level The level of access granted to the property and property values.
Analytic Object Name The name of the subject, event, overlay, or related object that data security is being defined for.
Parent Analytic Object Name The name of the subject that an event is associated with. This column is only populated when the permission defines data security for an event or related object.
Path to Property The subject reference path that shows how two analytic objects are linked.
Population Access The population of the analytic object that can be accessed.
Permission Display Name The name of the permission where the data access is defined.
User Group The name of the User Group where the data access comes from. Assigned Directly indicates that data access was granted through an assigned permission and not through the membership in a User Group.

Add a user

Note: This action is available in Users V1 and Users V2. You can add users in bulk with Users API V2. For Users V2, see Add users above.

Use this sample request to add a new user to your tenant.

Copy
cURL sample request: Add a user in the default tenant
curl -X POST --url 'https://{vanity_name}.api.visier.io/v1/admin/users' \
-H 'apikey:{api_key}' \
-H 'Cookie:VisierASIDToken={security_token}'
-d 'model= {
    "username":"john@jupiter.com",
    "displayName":"John Doe"
}'

The response returns details about the created user.

Update a user

Note: This action is available in Users V1 and Users V2. For Users API V2, see Update users above.

Use this sample request to update an existing user in your tenant.

Copy
cURL sample request: Disable user 82424d8b-f99c-cd4d-9ac7-568919d9a0e4 in the default tenant
curl -X PUT --url 'https://{vanity_name}.api.visier.io/v1/admin/users/82424d8b-f99c-cd4d-9ac7-568919d9a0e4' \
-H 'apikey:{api_key}' \
-H 'Cookie:VisierASIDToken={security_token}'
-d 'model= {
    "accountEnabled":"false"
}'

The response returns details about the updated user.

Assign users to user groups

Note: This action is available in User V1 and User Group V2. For User Group V2, see Update multiple user groups above.

This endpoint supports the ProjectID request header to make changes in a project. For more information, see Projects API. Use the following sample request to assign users to user groups in a project. If you omit the ProjectID request header, the request is immediately published to your production version.

Copy
cURL sample request: Assign users to user groups in a project
curl -X PUT --url 'https://{vanity_name}.api.visier.io/v1/admin/user-groups/users' \
-H 'apikey:{api_key}' \
-H 'Cookie:VisierASIDToken={security_token}'
-H 'ProjectID:fd2c83f5-440e-4ade-a2bb-7a7c22c95d2c' \
-d '{
    "userGroups": [
      {
        "userGroupId": "481daf14-5093-46b0-a168-b4c712aaff0c",
        "userIds": [
          "27c54e86-0cc0-8748-abc6-f6ec2ca62384",
          "984b70fe-08b8-e949-8e74-9162132d9e4e",
          "74d040ff-858f-d543-9d68-72029c1bc672"
        ]
      },
      {
        "userGroupId": "a9ec3b4b-94b6-4d01-bbaa-8ba55fc82319",
        "userIds": [
            "6e09448a-7300-244e-9cfe-7ddebc2c37df"
        ]
      }
    ]
  }'

Use this sample request to add users to a user group. Because ProjectID isn't defined in the request header, the user group changes are published to production immediately.

Copy
cURL sample request: Assign users to user groups
curl -X PUT --url 'https://{vanity_name}.api.visier.io/v1/admin/user-groups/users' \
-H 'apikey:{api_key}' \
-H 'Cookie:VisierASIDToken={security_token}'
-d 'model={"userGroups":[{"userGroupId":"d2c53a43-b62b-4d18-b95a-345f0a05e1d1","userIds":["0bd2d579-ac7e-7949-8e01-2881ba5f1465","a46ce914-9928-924b-80a2-4999fb4c923e","6a684bee-0ac4-b24f-a293-2fbcbbc7c354","c713ddaa-147d-9a4c-ae3c-e01913d4a911"]},{"userGroupId":"de5c72d2-a1b5-4ce1-8f49-bf6e16a45f6b","userIds":["c713ddaa-147d-9a4c-ae3c-e01913d4a911"]}]}'

The response returns details about the assignment.

Assign permissions to users

This endpoint supports the ProjectID request header to make changes in a project. For more information, see Projects API. Use the following sample request to assign permissions to users in a project. If you omit the ProjectID request header, the request is immediately published to your production version.

Copy
cURL sample request: Assign permissions to users in a project
curl -X PUT --url 'https://{vanity_name}.api.visier.io/v1/admin/permissions/users' \
-H 'apikey:{api_key}' \
-H 'Cookie:VisierASIDToken={security_token}'
-H 'ProjectID:fd2c83f5-440e-4ade-a2bb-7a7c22c95d2c' \
-d '{
  "permissions": [
    {
      "permissionId": "cae0d8c1-1278-4900-9297-7ea3e789b169",
      "userIds": [
        "27c54e86-0cc0-8748-abc6-f6ec2ca62384",
        "984b70fe-08b8-e949-8e74-9162132d9e4e",
        "74d040ff-858f-d543-9d68-72029c1bc672"
      ]
    },
    {
        "permissionId": "06a1e2cf-a8e2-4927-92ac-c943a2f4f3e5",
        "userIds": [
            "984b70fe-08b8-e949-8e74-9162132d9e4e"
        ]
    }
  ],
}'

Use this sample request to assign permissions to a specified user. Because ProjectID isn't defined in the request header, the permission changes are published to production immediately.

Copy
cURL sample request: Assign permission cae0d8c1-1278-4900-9297-7ea3e789b169 to users e52bbbba-8be3-b740-a824-f80c248dc545, fff86c23-bc2d-1d4c-a2ff-39ef1f6aba20, and 0bd2d579-ac7e-7949-8e01-2881ba5f1465
curl -X PUT --url 'https://{vanity_name}.api.visier.io/v1/admin/permissions' \
-H 'apikey:{api_key}' \
-H 'Cookie:VisierASIDToken={security_token}'
-d "permission": "permissionId":"cae0d8c1-1278-4900-9297-7ea3e789b169","userIds":["e52bbbba-8be3-b740-a824-f80c248dc545","fff86c23-bc2d-1d4c-a2ff-39ef1f6aba20","0bd2d579-ac7e-7949-8e01-2881ba5f1465"]}]}'

The response returns details about the permission assignment.

Assign permissions to user groups

Note: This action is available in Users V1 and User Groups V2. For User Groups V2, see Update multiple user groups above.

Use this sample request to assign permissions to a specified user group.

Copy
cURL sample request: Assign permission 9cefbf06-b4b3-490c-bf04-5fbee0ba85b5 to user group d2c53a43-b62b-4d18-b95a-345f0a05e1d1
curl -X PUT --url 'https://{vanity_name}.api.visier.io/v1/admin/user-groups/permissions' \
-H 'apikey:{api_key}' \
-H 'Cookie:VisierASIDToken={security_token}'
-d 'model={"userGroups":[{"userGroupId":"d2c53a43-b62b-4d18-b95a-345f0a05e1d1","permissionsIds":["9cefbf06-b4b3-490c-bf04-5fbee0ba85b5"]}]}'

The response returns details about the permission assignment.

Delete a user

Note: This action is available in Users V1 and Users V2. You can delete users in bulk with Users API V2. For Users V2, see Delete users above.

Use this sample request to delete a user in your tenant.

Copy
cURL sample request: Delete user 82424d8b-f99c-cd4d-9ac7-568919d9a0e4 in the default tenant
curl -X DELETE --url 'https://{vanity_name}.api.visier.io/v1/admin/users/82424d8b-f99c-cd4d-9ac7-568919d9a0e4' \
-H 'apikey:{api_key}' \
-H 'Cookie:VisierASIDToken={security_token}'

The response returns whether the deletion was successful or unsuccessful.

Remove users from user groups

Note: This action is available in Users V1 and User Groups V2. For User Groups V2, see Update multiple user groups above.

Use this sample request to remove a list of users from a user group.

Copy
cURL sample request: Remove users from user groups
curl -X DELETE --url 'https://{vanity_name}.api.visier.io/v1/admin/user-groups/users' \
-H 'apikey:{api_key}' \
-H 'Cookie:VisierASIDToken={security_token}' \
-d 'model={"userGroups":[{"userGroupId":"d2c53a43-b62b-4d18-b95a-345f0a05e1d1","userIds":["0bd2d579-ac7e-7949-8e01-2881ba5f1465","a46ce914-9928-924b-80a2-4999fb4c923e","6a684bee-0ac4-b24f-a293-2fbcbbc7c354","c713ddaa-147d-9a4c-ae3c-e01913d4a911"]},{"userGroupId":"de5c72d2-a1b5-4ce1-8f49-bf6e16a45f6b","userIds":["c713ddaa-147d-9a4c-ae3c-e01913d4a911"]}]}'

The response returns whether the removal was successful or unsuccessful.

Remove permissions from users

Use this sample request to remove a permission from a list of users.

Copy
cURL sample request: Remove permission cae0d8c1-1278-4900-9297-7ea3e789b169 from users e52bbbba-8be3-b740-a824-f80c248dc545, fff86c23-bc2d-1d4c-a2ff-39ef1f6aba20, 0bd2d579-ac7e-7949-8e01-2881ba5f1465, d445efc0-fdde-5d4b-9b3e-586981acf800, and 94e5e022-a5fb-fe4f-99c9-de981fb87282
curl -X DELETE --url 'https://{vanity_name}.api.visier.io/v1/admin/permissions/users \
-H 'apikey:{api_key}' \
-H 'Cookie:VisierASIDToken={security_token}'
-d '{"permissions":[{"permissionId":"cae0d8c1-1278-4900-9297-7ea3e789b169","userIds":["e52bbbba-8be3-b740-a824-f80c248dc545","fff86c23-bc2d-1d4c-a2ff-39ef1f6aba20","0bd2d579-ac7e-7949-8e01-2881ba5f1465","d445efc0-fdde-5d4b-9b3e-586981acf800","94e5e022-a5fb-fe4f-99c9-de981fb87282"]}]}'

The response returns whether the removal was successful or unsuccessful.

Remove permissions from user groups

Note: This action is available in Users V1 and User Groups V2. For User Groups V2, see Update users above.

Use this sample request to remove a permission from a list of user groups.

Copy
cURL sample request: Remove permissions from user groups
curl -X DELETE --url 'https://{vanity_name}.api.visier.io/v1/admin/user-groups/permissions' \
-H 'apikey:{api_key}' \
-H 'Cookie:VisierASIDToken={security_token}'
-d 'model={"userGroups":[{"userGroupId":"d2c53a43-b62b-4d18-b95a-345f0a05e1d1","permissionsIds":["9cefbf06-b4b3-490c-bf04-5fbee0ba85b5"]},{"userGroupId":"8e2a6e78-35b0-439d-87d7-45a950b1b5a3","permissionsIds":["9cefbf06-b4b3-490c-bf04-5fbee0ba85b5"]}]}'

The response returns whether the removal was successful or unsuccessful.