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

# 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\*](/services/playfab/multiplayer/lobby/playfabmultiplayerreference-cpp/pfmultiplayer/pfentitykey_clientsdk)

The local user sending the invite.

**`invitee`**   [PFEntityKey\*](/services/playfab/multiplayer/lobby/playfabmultiplayerreference-cpp/pfmultiplayer/pfentitykey_clientsdk)

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()](/services/playfab/multiplayer/lobby/playfabmultiplayerreference-cpp/pfmultiplayer/functions/pfmultiplayergeterrormessage).

## Remarks

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

## Requirements

**Header:** PFLobby.h

## See also

[PFLobby members](/services/playfab/multiplayer/lobby/playfabmultiplayerreference-cpp/pflobby/pflobby_members)


## Related topics

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