# innerHit results alongside parent's ID?

**URL:** <https://developer.sailpoint.com/discuss/t/innerhit-results-alongside-parents-id/28631>\
**Category:** SHF Discussion and Questions\
**Tags:** sailpoint-identity-security, apis\
**Created:** [February 2, 2024, 10:06pm UTC](https://developer.sailpoint.com/discuss/t/innerhit-results-alongside-parents-id/28631 "2024-02-02T22:06:52Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![pawe1](https://avatars.discourse-cdn.com/v4/letter/p/5e9695/32.png) [@pawe1](https://developer.sailpoint.com/discuss/u/pawe1)\
**Post date:** [February 2, 2024, 10:06pm UTC](https://developer.sailpoint.com/discuss/t/innerhit-results-alongside-parents-id/28631/1 "2024-02-02T22:06:52Z")

</div>

Greetings!

I’ve been trying to get the search-API to return a list of all roles per identity that that identity has access to. Specfically I’m looking to get it as follows:

assume there are two identities and three roles. Identity 1 has access to roles 1 and 2, while Identity 2 has access to roles 1,2 and 3. I’d like my API to return a result similar to the following:

{“Identity.id”:“identityID1”, “access.id”:“roleID1”}  
{“Identity.id”:“identityID1”, “access.id”:“roleID2”}  
{“Identity.id”:“identityID2”, “access.id”:“roleID1”}  
{“Identity.id”:“identityID2”, “access.id”:“roleID2”}  
{“Identity.id”:“identityID2”, “access.id”:“roleID3”}

The furthest I’ve gotten is using the following API call:  
`{"indices":["identities"],"queryType":"SAILPOINT","query":{"query":"*","innerHit":{"type":"access","query":"type:\\"ROLE\\""}},"queryResultFilter":{"includes":["id","access.id","access.type"]},"sort":["+id"]}`

The only thing that’s missing is that the result does not include the ID of the identity to which the retrieved roles pertains. Is there any way to have it included in the API-call?

---

<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:** [April 2, 2024, 10:07pm UTC](https://developer.sailpoint.com/discuss/t/innerhit-results-alongside-parents-id/28631/2 "2024-04-02T22:07:35Z")

</div>

Closed on April 2, 2024, 10:07pm UTC

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