Issue with Power Platform API reassign and Copilot Studio

Fornalczyk, Mateusz 5 Reputation points
2026-03-13T08:14:29.7566667+00:00

For governance process I'm trying to reassign the owner of Copilot Studio Agent from service principal to an actual user.

I implemented the API action

POST https://api.powerplatform.com/copilotstudio/environments/{EnvironmentId}/bots/{BotId}/api/botAdminOperations/reassign?api-version=1 

via custom connector and I'm using my global administrator account for the connection.
To the main issue - when I try running it on an agent in my Dev environemnt in unamanaged solution every thing works great it returns 204. But when I try to do it in the target environment it returns 500 error. All the Ids are correct ones including users entra object id

 {
  "ErrorCode": 500,
  "ErrorMessage": "Sequence contains no elements",
  "DiagnosticsMessage": null,
  "ErrorInfo": null
} 
Microsoft Copilot | Microsoft 365 Copilot | Development

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.