Update Organizational Roles of Users

You can modify the organizational roles of users in a provider or customer organization by using the user management API.

Prerequisites

  • You have the Provider Administrator, Provider Operations Administrator, Provider Account Administrator, or Customer Administrator role in your VMware Cloud Partner Navigator organization.
  • Obtain an access token from the organization you want to manage and set it as the csp-auth-token request header. See Using VMware Cloud Partner Navigator APIs.
  • Set the Content-Type header of this request to application/json.

Procedure

  1. In the body of the request, enter values for the required parameters for updating the organizational roles of users.
    {
        "users": [
            {
                "username": "",
                "idpId": ""
            }
        ],
        "roleNamesToAdd": [],
        "roleNamesToRemove": []
    }
    1. Enter all roles that you want to assign to a user within the roleNamesToAdd parameter.
    2. Enter all roles that you want to revoke from a user within the roleNamesToRemove parameter.
    For a list of API values of the organizational roles in VMware Cloud Partner Navigator, see VMware Cloud Partner Navigator API Request Parameters.
  2. (Optional) If you want to update the roles of multiple users at a time, insert an extra array of username and idpId, for each user, within the users parameter.
    {
        "users": [
            ...
            {
                "username": "",
                "idpId": ""
            },
            {
                "username": "",
                "idpId": ""
            }
            ...
        ],
        "roleNamesToAdd": [],
        "roleNamesToRemove": []
    }
  3. Enter the ID of the organization of which the users you are updating are part, and run the PATCH request.
    PATCH https://console.navigator.vmware.com/cphub/api/auth/v1/orgs/org_ID/users-org-roles

Results

The organizational roles of the specified users are updated. You receive a response confirming the updated roles.

Example: Update the Organizational Roles of a User

This example modifies the organizational role of a provider user, from Provider Administrator to Provider Support User.

Enter values for the required parameters for updating the organizational roles of a user.

{
    "users": [
        {
            "username": "[email protected]",
            "idpId": ""
        }
    ],
    "roleNamesToAdd": [
        "msp:provider_admin"
    ],
    "roleNamesToRemove": [
        "msp:provider_support_user"
    ]
}

Update the roles of the user.

PATCH https://console.navigator.vmware.com/cphub/api/auth/v1/orgs/62aad261-0c59-4d50-9725-3848afd5b1dd/users-org-roles

The response returns information on the updated user's roles.

{
    "roleNamesToRemove": [
        "msp:provider_support_user"
    ],
    "roleNamesToAdd": [
        "msp:provider_admin"
    ],
    "users": [
        {
            "username": "[email protected]",
            "idpId": ""
        }
    ]
}