Forum Discussion
onBehalfOfUserMri cannot be null or empty - Team installedApps
Hi
We started getting the same errors today too approximately from 24 April 2025 7AM UTC. (+-1 hour)
https://learn.microsoft.com/en-us/graph/api/team-post-installedapps?view=graph-rest-1.0&tabs=http endpoint throws errors using Delegated or Application permissions.
When use the Delegated scope TeamsAppInstallation.ReadWriteForTeam the next error is thrown
{ "error": { "code": "Unauthorized", "message": "Failed to execute Skype backend request GetThreadRequest.", "innerError": { "code": "UnauthorizedAccess", "message": "Failed to execute Skype backend request GetThreadRequest.", "details": [], "date": "2025-04-24T20:55:12", "request-id": "4fec60bf-*****-181a1a095af8", "client-request-id": "4fec60bf-*****-181a1a095af8" } } }
When use the Application role TeamsAppInstallation.ReadWriteForTeam.All
{ "error": { "code": "BadRequest", "message": "onBehalfOfUserMri cannot be null or empty. (Parameter 'onBehalfOfUserMri')", "innerError": { "code": "InvalidRequest", "message": "onBehalfOfUserMri cannot be null or empty. (Parameter 'onBehalfOfUserMri')", "details": [], "date": "2025-04-24T20:54:03", "request-id": "e5764205-*****-55f82250024e", "client-request-id": "e5764205-******-55f82250024e" } } }
The most interesting finding that the app is being added to the Team, but if the Teams' app has a Bot, the Bot is not added and when tries to send message behalf of the Bot a Forbidden (BotNotInConversationRoster) error is thrown.
The issue was reproduced on 4 different tenants including dev ones and enterprise with thousands of licensed users.
I have found only one workaround how to temporary mitigate the issue until it will be fixed. This is a combination of usage a Service Account and invoking non-documented Teams internal API endpoint (eg simulate the same request what Microsoft Teams client uses internally).