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.
- Create External Application with this application scope "PM.User PM.User.Write"
- Update the Redirect URL: https://cloud.uipath.com/identity_/
- Application Type: Confidential application
- Note Down the App ID and App Secret
Step 2: Open the postman and start the authentication using the below details.
- Endpoint URL: https://cloud.uipath.com/identity_/connect/token
- Method: POST
- Body Format: x-www-form-urlencoded
- 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.
- Endpoint URL: https://cloud.uipath.com/OrganizationName/portal_/api/identity/User
- Request Method: DELETE
- Content-Type: application/json
- 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
How to get the UserIds and PartitionGlobalId?
- 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.
- Click on the refresh button in the Accounts & Groups
- From here copy the Id that needs to be deleted from API example: bb91255b-9247-4d08-847d-6a4f43e83adb
- 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
- 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.