How To Delete User From Automation Cloud Via API Call?

How to Delete user from Automation Cloud via API?

Delete the user's account from the Automation Cloud using API, by following the below steps.

Step 1: Login to the Automation Cloud https://cloud.uipath.com/OrganizationName.

  1. Create External Application with this application scope "PM.User PM.User.Write"
  2. Update the Redirect URL: https://cloud.uipath.com/identity_/
  3. Application Type: Confidential application
  4. Note Down the App ID and App Secret

Step 2: Open the postman and start the authentication using the below details.

  1. Endpoint URL: https://cloud.uipath.com/identity_/connect/token
  2. Method: POST
  3. Body Format: x-www-form-urlencoded
  4. The field going to be key and the value format.

Find the below screenshot for a sample configuration in Postman.

Step 3: Now delete the Automation cloud user account.

  1. Endpoint URL: https://cloud.uipath.com/OrganizationName/portal_/api/identity/User
  2. Request Method: DELETE
  3. Content-Type: application/json
  4. In Postman add the Authorization header and the values going to be your Bearer token which is you authenticated from the postman. Example: Bearer xxxyyyzzz
  5. Body:

{

"partitionGlobalId":"fdb7133e-fa29-4be6-9eb1-1804e4226558",

"userIds":["bb91255b-9247-4d08-847d-6a4f43e83adb"],

"deleteCurrentUser":false

}



How to get the UserIds and PartitionGlobalId?

  1. UserIds
    1. Go to the automation cloud and admin page Accounts & Groups then right-click the browser page at the bottom, there is an option called inspect just click on inspect option, from there is another option called Network.
    2. Click on the refresh button in the Accounts & Groups
    3. From here copy the Id that needs to be deleted from API example: bb91255b-9247-4d08-847d-6a4f43e83adb


1.jpg

  1. PartitionGlobalId
    1. On the same page just click on Headers there is one URL which is the Request URL example: https://cloud.uipath.com/OrganizationName/portal_/api/identity/UserPartition/users/fdb7133e-fa29-4be6-9eb1-1804e4226558?top=25&skip=0
    2. From this URL just copy this id fdb7133e-fa29-4be6-9eb1-1804e4226558 this value going to change for every organization.

Now update the PartitionGlobalId and UserIds in the body fields as mentioned in Step 3 and send the request this going to delete the user account.