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 / Copilot Studio / API to get the shared ...
Copilot Studio
Suggested Answer

API to get the shared users for an Agent

(0) ShareShare
ReportReport
Posted on by 2
I am having difficulties to find the API to dataverse or any other microsoft platform that can help me to get the users i have shred an agent. for security groups i can find it , but single users i cannot find an API that will give me this infromation. 
I tried searching for permissions issue but i got into conclusion that this is not the issue. 
the learn page is here:  https://learn.microsoft.com/en-us/microsoft-copilot-studio/admin-share-bots?tabs=webApp 
added a picture . i am looking to see in any API the permissions Nadav has on this agent.
image (2).png
  • Suggested answer
    Beyond The Platforms Profile Picture
    274 on at

    At the moment, there is no documented Copilot Studio API that directly returns the list of individual users an agent has been shared with, along with their permissions (Viewer, Editor, etc.). The sharing experience in Copilot Studio is built on top of Dataverse security and sharing mechanisms rather than a dedicated Agent Permissions API.

    For security groups, the information is easier to identify, but for individual users you need to inspect the underlying Dataverse security model. Specifically, you should look at:


    • Team records associated with the agent

    • SystemUser records

    • PrincipalObjectAccess (POA) records, which store explicit sharing permissions granted to users and teams in Dataverse

    •  
     

    By querying these Dataverse tables through the Dataverse Web API, you can determine:


    • Which users have been granted access

    • Whether the access was granted directly or through a team

    • What access rights have been assigned


    •  

    Copilot Studio also creates and manages owner teams behind the scenes for collaborative authoring scenarios, so reviewing team membership can provide additional insight into who has access to the agent.

    Therefore, if your goal is to identify what permissions a specific user (for example, Nadav) has on an agent, the recommended approach is to investigate the Dataverse security layer rather than looking for a Copilot Studio-specific API. Based on the currently available documentation, there does not appear to be a public API that exposes this information directly from Copilot Studio.

    As an alternative for governance and auditing scenarios, you can also leverage Power Platform Admin Center, Dataverse queries, or the CoE Starter Kit to inventory agent access across environments.

    Hope this helps!
    Paolo


    Did this solve your issue? → Accept as Solution
    👍 Partially helpful? → Click "Yes" on "Was this reply helpful?" or drop a Like!


    Want more tips on Power Platform & AI? Follow me here:

    🔗 LinkedIn: https://www.linkedin.com/in/paoloasnaghi/
    ▶️ YouTube: https://www.youtube.com/@BeyondThePlatforms
    📸 Instagram: https://www.instagram.com/beyond_the_platforms/
    🌐 Website: https://www.beyondtheplatforms.com/
    🖥Substack: https://substack.com/@paoloasnaghi

     

  • CU08090528-0 Profile Picture
    2 on at
     Thanks Paolo — that's exactly the path I took, and I want to share what I found because it doesn't hold up in my tenant. I'd appreciate a second look.
     Setup: one agent, shared in the Copilot Studio UI with (a) a security group as Viewer and (b) an individual user — call him User A — with more than Viewer rights. The group part works fine: it lands on the bot row as authorizedsecuritygroupids with accesscontrolpolicy: 2. It's the individual share I can't find anywhere.
     What I ran, and what came back: 1. GET /api/data/v9.2/principalobjectaccessset?$filter=objectid eq <botid> and objecttypecode eq 'bot'
        → exactly one row: the auto-created owner team, accessrightsmask: 786487, inheritedaccessrightsmask: 0. No row for User A.
     2. GET /api/data/v9.2/RetrieveSharedPrincipalsAndAccess(Target=@t)?@t={'@odata.id':'bots(<botid>)'}
        → the same single team, nothing more.
     3. GET /api/data/v9.2/teams(<teamid>)?$select=name,teamtype,membershiptype&$expand=teammembership_association($select=fullname,domainname)
        → teamtype: 0 (owner team), azureactivedirectoryobjectid: null, and membership is the agent owner only. User A is not a member.
     4. GET /api/data/v9.2/systemusers(<userAId>)/Microsoft.Dynamics.CRM.RetrievePrincipalAccess(Target=@t)?@t={'@odata.id':'bots(<botid>)'}
        → {"AccessRights": "None"} — for a user the Share pane shows with edit rights.
     5. I then pulled the entire principalobjectaccessset table with no filter. It contains exactly one objecttypecode: 'bot' row per agent, every one of them principaltypecode: 'team'. There is not a single systemuser principal against any bot in the whole table.
     Ruling out permissions. I know that's the usual explanation, so I checked it directly: the same unfiltered query does return principaltypecode: 'systemuser' rows for other object types — e.g. a connector record shared directly to a named user with accessrightsmask: 17 — as well as principaltypecode: 'organization' rows on other tables. So the app user can read user-level POA rows; there simply aren't any for bots. I also granted Share on the bot table at Organization scope and re-ran everything: byte-identical results.
     The observation I can't get past. I compared User A against User B, who was never shared this agent. They are indistinguishable in Dataverse: same security roles (Environment Maker + Basic User, identical role IDs), same business unit, same islicensed/caltype/accessmode, same team memberships, no POA rows on the bot for either, and RetrievePrincipalAccess returns None for both.were expressed anywhere in the Dataverse security model, those twousers would have to differ somewhere — and they don't.
     So my question, narrowed: if individual-user agent shares are not or systemuser, where are they persisted, and is there any readsurface for them? Specifically:
     - Is there a Dataverse table other than principalobjectaccessset that holds them? (I found nothing bot-share-related when enumerating EntityDefinitions.)
     - Or are they held in the Copilot Studio / Power Platform control se — and if so, is there any documented or supported endpoint thatreads them? The Power Platform API Bots operations don't appear to expose a permissions operation.
     - Does the storage differ between the two share types — Editor / c Viewer / chat access? The docs say collaborative authoring adds theuser to the agent's Dataverse team, but in my tenant the owner team contains only the owner even though User A has more than Viewer rights.
     - On the CoE Starter Kit suggestion: does its agent inventory actuser shares for agents? My reading is that the permission-sync flowscover apps and flows, and the Copilot Studio side is inventory plus telemetry only. If it does collect them, which flow/table — that would point me at the underlying API.
     I'm after static state, not audit events — I know BotUpdateOperation-BotShare shows up in Purview, but replaying an event log isn't a reliable way to 
    reconstruct current access.
  • Suggested answer
    Mohsin Ali Profile Picture
    1,075 on at
    Hello @CU08090528-0 - To the best of my knowledge, Microsoft currently doesn't expose a documented Copilot Studio API that directly returns the individual users an agent has been shared with and their corresponding permissions. You may need to investigate the underlying Dataverse security/sharing records, such as PrincipalObjectAccess, SystemUser, and Teams, to determine this information.
     

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 > Copilot Studio

#1
Mohsin Ali Profile Picture

Mohsin Ali 356

#2
Valantis Profile Picture

Valantis 253 Super User 2026 Season 2

#3
11manish Profile Picture

11manish 179 Super User 2026 Season 2

Last 30 days Overall leaderboard