Remove Users

You can remove users from your 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 the required values for removing a user from an organization.
    {
        "users": [
            {
                "username": "",
                "idpId": ""
            }
        ],
        "roleNamesToAdd": [],
        "roleNamesToRemove": []
    }
    To remove users from an organization, enter all roles currently held by the users in 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 remove multiple users at the same 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 removing are part, and run the request.
    PATCH https://console.navigator.vmware.com/cphub/api/auth/v1/orgs/org_ID/users-org-roles

Results

The specified users are removed from your provider or customer organization. You receive a response confirming the removal.

Example: Remove Users from an Organization

This example removes users from a given provider organization.

Enter values for the required parameters for removing users from an organization. List all roles currently held by users in the roleNamesToRemove parameter.

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

Remove the users from the organization.

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 removed users.

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