> ## 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.

# PFGroupsInviteToGroupAsync

> Invites a player to join a group

Invites a player to join a group

## Syntax

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

### Parameters

**`entityHandle`**   PFEntityHandle

PFEntityHandle to use for authentication.

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

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. Invites a player to join a group, if they are not blocked by the group. An optional role can be provided to automatically assign the player to the role if they accept the invitation. By default, if the entity has an application to the group outstanding, this will accept the application instead and return an error indicating such, rather than creating a duplicate invitation to join that will need to be cleaned up later. Returns information about the new invitation or an error indicating an existing application to join was accepted. See also GroupAcceptGroupInvitationAsync, GroupListGroupInvitationsAsync, GroupListMembershipOpportunitiesAsync, GroupRemoveGroupInvitationAsync. When the asynchronous task is complete, call [PFGroupsInviteToGroupGetResultSize](/services/playfab/api-references/c/pfgroups/functions/pfgroupsinvitetogroupgetresultsize) and [PFGroupsInviteToGroupGetResult](/services/playfab/api-references/c/pfgroups/functions/pfgroupsinvitetogroupgetresult) to get the result.

## Requirements

**Header:** PFGroups.h

## See also

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


## Related topics

- [PFGroupsInviteToGroupGetResult](/services/playfab/api-references/c/pfgroups/functions/pfgroupsinvitetogroupgetresult.md)
- [Services C API overview - PFGroups.h](/services/playfab/api-references/c/pfgroups/pfgroups_members.md)
- [PFGroupsCreateGroupAsync](/services/playfab/api-references/c/pfgroups/functions/pfgroupscreategroupasync.md)
- [PFGroupsInviteToGroupGetResultSize](/services/playfab/api-references/c/pfgroups/functions/pfgroupsinvitetogroupgetresultsize.md)
- [PFGroupsInviteToGroupRequest](/services/playfab/api-references/c/pfgroupstypes/structs/pfgroupsinvitetogrouprequest.md)
