> ## Documentation Index
> Fetch the complete documentation index at: https://devdocs.xbox.com/llms.txt
> Use this file to discover all available pages before exploring further.

# PFGroupsListMembershipAsync

> Lists all groups and roles for an entity

Lists all groups and roles for an entity

## Syntax

```cpp theme={null}
HRESULT PFGroupsListMembershipAsync(  
    PFEntityHandle entityHandle,  
    const PFGroupsListMembershipRequest* request,  
    XAsyncBlock* async  
)  
```

### Parameters

**`entityHandle`**   PFEntityHandle

PFEntityHandle to use for authentication.

**`request`**   [PFGroupsListMembershipRequest\*](/services/playfab/api-references/c/pfgroupstypes/structs/pfgroupslistmembershiprequest)

Populated request object.

**`async`**   XAsyncBlock\*<br />*Inout*

XAsyncBlock for the async operation.

### Return value

Type: HRESULT

Result code for this API operation.

## Remarks

This API is available on all platforms. Lists the groups and roles that an entity is a part of, checking to see if group and role metadata and memberships should be visible to the caller. If the entity is not in any roles that are visible to the caller, the group is not returned in the results, even if the caller otherwise has permission to see that the entity is a member of that group. See also GroupListGroupMembersAsync, GroupListMembershipOpportunitiesAsync. When the asynchronous task is complete, call [PFGroupsListMembershipGetResultSize](/services/playfab/api-references/c/pfgroups/functions/pfgroupslistmembershipgetresultsize) and [PFGroupsListMembershipGetResult](/services/playfab/api-references/c/pfgroups/functions/pfgroupslistmembershipgetresult) to get the result.

## Requirements

**Header:** PFGroups.h

## See also

[PFGroups members](/services/playfab/api-references/c/pfgroups/pfgroups_members)


## Related topics

- [PFGroupsListMembershipGetResult](/services/playfab/api-references/c/pfgroups/functions/pfgroupslistmembershipgetresult.md)
- [Services C API overview - PFGroups.h](/services/playfab/api-references/c/pfgroups/pfgroups_members.md)
- [PFGroupsListMembershipOpportunitiesAsync](/services/playfab/api-references/c/pfgroups/functions/pfgroupslistmembershipopportunitiesasync.md)
- [PFGroupsListGroupInvitationsAsync](/services/playfab/api-references/c/pfgroups/functions/pfgroupslistgroupinvitationsasync.md)
- [PFGroupsListMembershipOpportunitiesGetResult](/services/playfab/api-references/c/pfgroups/functions/pfgroupslistmembershipopportunitiesgetresult.md)
