web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / ms Graph API doesn't a...
Power Automate
Answered

ms Graph API doesn't allow GET/PATCH with Guest Users

(0) ShareShare
ReportReport
Posted on by 19

Hello All, I'm using the MS Graph API to invite, then update Guest users in the AAD.  Invite works perfectly, but is limited as to what attributes can be defined. Once the user has been invited, we need to assign a license, add to groups etc.  However, I'm getting stuck on updating the 'usageLocation' and things like givenName, surname etc using an HTTP PATCH.

Here is the snip of what the step in the flow looks like:

DTO_2-1667518782098.png

 

It DOES work if I put the ObjectId in the URI such as https://graph.microsoft.com/v1.0/users/a9cdq2c1-3ye1-4d30-b3y0-598c13f5c91c, but I technically can't get that without a GET from the user API, which I would have to use the userPrincipleName to get.

 

If I use the exact same PATCH in Graph Explorer | Try Microsoft Graph APIs - Microsoft Graph,

it works perfectly. I also attempted to get the ObjectID via Power Automate HTTP, but it also doesn't resolve that email or userPrincipleName that contains the '#EXT#@org.onmicrosoft.com'.

 

The error in the flow looks like this:

            "code": "Request_ResourceNotFound",
            "message": "Resource 'slimwilson_org.com' does not exist or one of its queried reference-property objects are not present."
 
 In Flow, it must be ignoring everything from the first # in the Guest users email? Is there a workaround for this? Again the exact same parameters work as expected in graph explorer. Rights are set identically to the application rights I'm using to run the flow.
 
I can also use Get-AzureADUser -ObjectId "slimwilson_org.com#EXT#@org.onmicrosoft.com" or Set-AzureADUser -ObjectId "slimwilson_org.com#EXT#@org.onmicrosoft.com" -UsageLocation "US" -GivenName "Slim" -Surname "Wilson" in local PowerShell without any issues.
 
If there are errors in the most with the fake user, it's because it's a fake user and I might have messed up an '_' or something:)
Thanks!
Categories:
  • Verified answer
    DTO Profile Picture
    19 on at

    For any of you who run into this same problem here is the solution:

     

    The problem is the resolution of the '#' and '@' characters forced into the Guest upn.  You have to use the URL escape codes. For example the '#' is = to '%23' and the '@' = '%40'

    So in the example above, you'd need to pass "slimwilson_org.com%23EXT%23%40org.onmicrosoft.com"

     

    Once I passed the upn variable like that, my flow ran successfully and I was able to update the Guest user properties.

     

    Thanks

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Leaderboard > Power Automate

#1
Mohsin Ali Profile Picture

Mohsin Ali 432

#2
11manish Profile Picture

11manish 313 Super User 2026 Season 2

#3
M Bilal Khan Profile Picture

M Bilal Khan 154

Last 30 days Overall leaderboard