Updating robot user unattended credentials

I need to update the unattended credentials of an account of the type ‘Robot’.
Currently i have a powershell script, which sends a request to the orchestrator.

I am using the call /odata/Users({Id}) from the orchestrator swagger documentation.

Except the response I get is this:
“message”: “This type of user cannot be updated.”,
“errorCode”: 1407,
“traceId”: “”,
“resourceIds”: null

The request body is this:
“UnattendedRobot”: {
“UserName”: “$machineName\$userName”,
“Password”: “password”
Is there a way to do this?

Hi @jesper.van.der.sluis, welcome to the Community.

There is another API call that you can use to update the credentials of an unattended robot. You can use ’/odata/Assets’ API call to update the credential asset associated with the robot.

Please try the following powershell script & let us know:

$uri = “https:///odata/Assets()”
$body = @{
“Value” = @{
“CredentialType” = “Windows”,
“UserName” = “<username>”,
“Password” = “”
} | ConvertTo-Json

Invoke-RestMethod -Uri $uri -Method Put -Headers @{Authorization = “Bearer ”} -Body $body

Hope this helps,
Best Regards.

Check this link: Robots Requests


1 Like


This results in the same error, I do not believe the problem is with the request body. When editing the same information through the orchestrator UI there is no problem

From the error message, it seems that for that robot type, the Rest API call endpoint and Body json is a different one.

In this case, you need to use the Inspect tool in your browser → Network → then change again the robot password in your UI. Monitor the request that was made and adapt the request in your external tool.

If you want to update the password of a different robot, make a PUT request to the same endpoint, using the ID of the respective user.

I have done this. My request already resembled the request sent from the orchestrator, which we see using the inspect Tool:
The Orchestrator UI also calls the /odata/Users({userId}) method POST, endpoint.

Except nothing we do seems to resolve the error message “This type of user cannot be updated”.

Why is updating, or Creating a User of the type ‘Robot’ Not allowed?

Maybe you are using an AD user.
Check with a local user.

The user is an UiPath only account. It is no AD user.

Updating another account works without problems, the error appears only when the Account Type is Robot.

Did you check the documentation that I sent or did you just simply skip it?

Example of a robot account for which the password was changed with the PUT method.

The issue seems to be the user Type.
When the user is of type ‘Robot’, no modification or creation is allowed.
When the user is of type ‘DirectoryUser’ it behaves as expected.

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.