# Query to list entitlements in a role

**URL:** <https://developer.sailpoint.com/discuss/t/query-to-list-entitlements-in-a-role/186636>\
**Category:** SHF Discussion and Questions\
**Tags:** identity-security-cloud\
**Created:** [October 28, 2025, 8:30pm UTC](https://developer.sailpoint.com/discuss/t/query-to-list-entitlements-in-a-role/186636 "2025-10-28T20:30:22Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![mario\_rod](https://avatars.discourse-cdn.com/v4/letter/m/50afbb/32.png) [@mario\_rod](https://developer.sailpoint.com/discuss/u/mario_rod)\
**Post date:** [October 28, 2025, 8:30pm UTC](https://developer.sailpoint.com/discuss/t/query-to-list-entitlements-in-a-role/186636/1 "2025-10-28T20:30:23Z")

</div>

Is there a query that can list the entitlements in a role - something similar to this?

There does not seem to be a way in the ui. Also the entitlements and roles API don’t list the source info. Tried the search API but so far no luck

Would appreciate any feedback.

 ![image](https://global.discourse-cdn.com/sailpoint/original/3X/9/7/971a05cbfc8797ef523f222281d1fa32089a7863.png)

---

<div class="post-metadata">

**Author:** ![markomanium](https://sea1.discourse-cdn.com/sailpoint/discuss/user_avatar/developer.sailpoint.com/markomanium/32/29738_2.png) [@markomanium](https://developer.sailpoint.com/discuss/u/markomanium)\
**Post date:** [October 28, 2025, 10:13pm UTC](https://developer.sailpoint.com/discuss/t/query-to-list-entitlements-in-a-role/186636/2 "2025-10-28T22:13:43Z")

</div>

@mario_rod Hello, have You maybe checked this v2024 API endpoint? [get-role-entitlements | SailPoint Developer Community](https://developer.sailpoint.com/docs/api/v2024/get-role-entitlements/)

---

<div class="post-metadata">

**Author:** ![mario\_rod](https://avatars.discourse-cdn.com/v4/letter/m/50afbb/32.png) [@mario\_rod](https://developer.sailpoint.com/discuss/u/mario_rod)\
**Post date:** [October 28, 2025, 11:15pm UTC](https://developer.sailpoint.com/discuss/t/query-to-list-entitlements-in-a-role/186636/3 "2025-10-28T23:15:01Z")

</div>

Hi @markomanium thanks for the response. Yes I tried that but the issue is getting the JSON response formatted….  
I tried [jsonpath.com](http://jsonpath.com) but not having luck playing with the query

---

<div class="post-metadata">

**Author:** ![markomanium](https://sea1.discourse-cdn.com/sailpoint/discuss/user_avatar/developer.sailpoint.com/markomanium/32/29738_2.png) [@markomanium](https://developer.sailpoint.com/discuss/u/markomanium)\
**Post date:** [October 28, 2025, 11:36pm UTC](https://developer.sailpoint.com/discuss/t/query-to-list-entitlements-in-a-role/186636/4 "2025-10-28T23:36:35Z")

</div>

@mario_rod in [jsonpath.com](http://jsonpath.com) , have you tried extracting data, using something like this `$[*].name`? That should extract all entitlements’ names from the role.

---

<div class="post-metadata">

**Author:** ![mario\_rod](https://avatars.discourse-cdn.com/v4/letter/m/50afbb/32.png) [@mario\_rod](https://developer.sailpoint.com/discuss/u/mario_rod)\
**Post date:** [October 28, 2025, 11:51pm UTC](https://developer.sailpoint.com/discuss/t/query-to-list-entitlements-in-a-role/186636/5 "2025-10-28T23:51:28Z")

</div>

@markomanium jsonpath is not as flexible as jmespath as it does not seem to allow concatenation of elements (or maybe I don’t know how to do it).

This jmespath query using the “/roles/:id/entitlements“ endpoint

`[*].{entitlementName: name, entitlementDescription: attributes.description, sourceName: source.name, owner: owner}`

produces this output

```auto
[
  {
    "entitlementName": "IAM Admin",
    "entitlementDescription": "IAM Team Members",
    "sourceName": "Salesforce",
    "owner": null
  },
  {
    "entitlementName": "Administrator",
    "entitlementDescription": null,
    "sourceName": "IdentityNow",
    "owner": null
  },
  {
    "entitlementName": "Priv Admin",
    "entitlementDescription": "Full administrative access to IdentityNow",
    "sourceName": "Identity Cloud Governance",
    "owner": null
  },

```

but now I need to save to an excel file and uploading data to online converters is not an option for obvious reasons. Using the excel import feature does not seem to work cleanly either.

Is the best option at this point using Pyton or the powershell sdk?

---

<div class="post-metadata">

**Author:** ![markomanium](https://sea1.discourse-cdn.com/sailpoint/discuss/user_avatar/developer.sailpoint.com/markomanium/32/29738_2.png) [@markomanium](https://developer.sailpoint.com/discuss/u/markomanium)\
**Post date:** [October 29, 2025, 12:12am UTC](https://developer.sailpoint.com/discuss/t/query-to-list-entitlements-in-a-role/186636/6 "2025-10-29T00:12:08Z")

</div>

@mario_rod Extracting this data into excel file should be fairly easy with Python/Java e.g. Or you can use Chatgpt to create an excel file for you out of the data provided (if you are sure you aren’t providing sensitive information, but in this case, doesn’t look sensitive to me).

---

<div class="post-metadata">

**Author:** ![David\_Norris](https://avatars.discourse-cdn.com/v4/letter/d/b9e5f3/32.png) [@David\_Norris](https://developer.sailpoint.com/discuss/u/David_Norris)\
**Post date:** [October 29, 2025, 1:39am UTC](https://developer.sailpoint.com/discuss/t/query-to-list-entitlements-in-a-role/186636/7 "2025-10-29T01:39:02Z")

</div>

Something like this:

```auto
get-v2025roles| foreach {write-host "Role: $($_.name)"; Get-V2025RoleEntitlements $_.id | foreach {write-host "$($_.source.name): $($_.name) ($($_.description))"};write-host}

```

---

<div class="post-metadata">

**Author:** ![mario\_rod](https://avatars.discourse-cdn.com/v4/letter/m/50afbb/32.png) [@mario\_rod](https://developer.sailpoint.com/discuss/u/mario_rod)\
**Post date:** [October 29, 2025, 1:49am UTC](https://developer.sailpoint.com/discuss/t/query-to-list-entitlements-in-a-role/186636/8 "2025-10-29T01:49:36Z")

</div>

Thanks @David_Norris I will download the posh sdk and try that out

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/sailpoint/original/2X/f/f2136700ed5e3703e0b85e02f6be799dacca7735.png) [@system](https://developer.sailpoint.com/discuss/u/system)\
**Post date:** [December 28, 2025, 1:50am UTC](https://developer.sailpoint.com/discuss/t/query-to-list-entitlements-in-a-role/186636/9 "2025-12-28T01:50:08Z")

</div>

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.
