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

# PFLobbySendInvite

> PFLobbySendInvite reference for sending a lobby invitation from the local PlayFab user to another entity using the PlayFab Multiplayer C++ SDK lobby APIs.

Send an invite to this lobby from the local user to the invited entity.

## Syntax

```cpp theme={null}
HRESULT PFLobbySendInvite(  
    PFLobbyHandle lobby,  
    const PFEntityKey* sender,  
    const PFEntityKey* invitee,  
    void* asyncContext  
)  
```

### Parameters

**`lobby`**   PFLobbyHandle

The handle of the lobby.

**`sender`**   [PFEntityKey\*](https://docs.xbox.com/services/playfab/multiplayer/lobby/playfabmultiplayerreference-cpp/pfmultiplayer/pfentitykey_clientsdk.md)

The local user sending the invite.

**`invitee`**   [PFEntityKey\*](https://docs.xbox.com/services/playfab/multiplayer/lobby/playfabmultiplayerreference-cpp/pfmultiplayer/pfentitykey_clientsdk.md)

The invited entity.

**`asyncContext`**   void\*\
*optional*

An optional, app-defined, pointer-sized context value that can be used to associate the completion state change with this call.

### Return value

Type: HRESULT

`S_OK` if the call succeeded or an error code otherwise. The human-readable form of the error code can be retrieved via [PFMultiplayerGetErrorMessage()](https://docs.xbox.com/services/playfab/multiplayer/lobby/playfabmultiplayerreference-cpp/pfmultiplayer/functions/pfmultiplayergeterrormessage.md).

## Remarks

This is an asynchronous operation. Upon successful completion, the title will be provided a [PFLobbySendInviteCompletedStateChange](https://docs.xbox.com/services/playfab/multiplayer/lobby/playfabmultiplayerreference-cpp/pflobby/structs/pflobbysendinvitecompletedstatechange.md) with the [PFLobbySendInviteCompletedStateChange::result](https://docs.xbox.com/services/playfab/multiplayer/lobby/playfabmultiplayerreference-cpp/pflobby/structs/pflobbysendinvitecompletedstatechange.md) field set to `S_OK`. Upon a failed completion, the title will be provided a [PFLobbySendInviteCompletedStateChange](https://docs.xbox.com/services/playfab/multiplayer/lobby/playfabmultiplayerreference-cpp/pflobby/structs/pflobbysendinvitecompletedstatechange.md) with the [PFLobbySendInviteCompletedStateChange::result](https://docs.xbox.com/services/playfab/multiplayer/lobby/playfabmultiplayerreference-cpp/pflobby/structs/pflobbysendinvitecompletedstatechange.md) field set to a failure. \
\
&#x20;The `sender` must be a local user of this lobby which joined from this client.

## Requirements

**Header:** PFLobby.h

## See also

[PFLobby members](https://docs.xbox.com/services/playfab/multiplayer/lobby/playfabmultiplayerreference-cpp/pflobby/pflobby_members.md)


## Related topics

- [Lobby invites](https://docs.xbox.com/services/playfab/multiplayer/lobby/lobby-invites.md)
- [Create a lobby](https://docs.xbox.com/services/playfab/multiplayer/lobby/create-a-lobby.md)
- [Asynchronous Lobby and Matchmaking C++ SDK operations and notifications](https://docs.xbox.com/services/playfab/multiplayer/lobby/lobby-and-matchmaking-client-sdk-async.md)
- [PFMultiplayer C/C++ API overview - PFLobby.h](https://docs.xbox.com/services/playfab/multiplayer/lobby/playfabmultiplayerreference-cpp/pflobby/pflobby_members.md)
- [PFLobbyStateChangeType](https://docs.xbox.com/services/playfab/multiplayer/lobby/playfabmultiplayerreference-cpp/pflobby/enums/pflobbystatechangetype.md)
