Transfer ownership to another user using API.

Options

We have requirement that we need to transfer ownership to another user using API. I didnt get any API for transferring ownership to another user.

but i got one RemoveUser API. i tried with the api

https://smartsheet.redoc.ly/tag/users#operation/remove-user

But i got the below error while using the above api

Invoke-WebRequest : { "errorCode" : 5666, "message" : "This person is managed from your directory service. Please delete them through your directory
service instead.", "refId" : "lxftbs" }

please let me know if there are permissions i need to add.