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

# get_chat_users

> chat_manager::get_chat_users

Retrieves the collection of local and remote users that have been added to the chat instance.

## Syntax

```cpp theme={null}
void get_chat_users(  
    uint32_t* chatUserCount,  
    chat_user_array* chatUsers  
)  
```

### Parameters

*chatUserCount*   \_Out\_\
Type: uint32\_t\*

The total number of local and remote users that have been added to the chat instance.

*chatUsers*   \_Outptr\_result\_buffer\_(\*chatUserCount)\
Type: [chat\_user\_array](https://docs.xbox.com/reference/chat/gamechat2/classes/chat_user/chat_user.md)\*

An array of [chat\_user](https://docs.xbox.com/reference/chat/gamechat2/classes/chat_user/chat_user.md) pointers that represents the local and remote users that have been added to the chat instance.

### Return value

Type: void

None.

## Remarks

This method retrieves the collection of local and remote users that have been added to the chat instance, returning the total number of users in `chatUserCount` and an array of [chat\_user](https://docs.xbox.com/reference/chat/gamechat2/classes/chat_user/chat_user.md) pointers, each of which represents a local or remote user, in `chatUsers`. The array pointer returned in `chatUsers` is valid until the next call to any of the following methods:

* [chat\_manager::add\_local\_user](https://docs.xbox.com/reference/chat/gamechat2/classes/chat_manager/methods/chat_manager_add_local_user.md)
* [chat\_manager::add\_remote\_user](https://docs.xbox.com/reference/chat/gamechat2/classes/chat_manager/methods/chat_manager_add_remote_user.md)
* [chat\_manager::cleanup](https://docs.xbox.com/reference/chat/gamechat2/classes/chat_manager/methods/chat_manager_cleanup.md)
* [chat\_manager::remove\_user](https://docs.xbox.com/reference/chat/gamechat2/classes/chat_manager/methods/chat_manager_remove_user.md)

The individual `chat_user` objects remain valid until the user has been removed by a call to `chat_manager::remove_user`. For more information about initializing and cleaning up a chat instance, see [Using the Game Chat 2 C++ API](https://docs.xbox.com/services/xbox-services/multiplayer/chat/game-chat2/using-game-chat-2.md).

## Requirements

**Header:** GameChat2.h

**Supported platforms:** Windows, XBOX One family consoles and XBOX Series consoles

## See also

[Intro to Game Chat 2](https://docs.xbox.com/services/xbox-services/multiplayer/chat/game-chat2/game-chat-2-intro.md)\
[chat\_user](https://docs.xbox.com/reference/chat/gamechat2/classes/chat_user/chat_user.md)\
[chat\_manager](https://docs.xbox.com/reference/chat/gamechat2/classes/chat_manager/chat_manager.md)


## Related topics

- [chat_user class](https://docs.xbox.com/reference/chat/gamechat2/classes/chat_user/chat_user.md)
- [PartyXblManager::GetChatUsers](https://docs.xbox.com/services/playfab/multiplayer/networking/xblreference/classes/PartyXblManager/methods/partyxblmanager_getchatusers.md)
- [PartyXblManager](https://docs.xbox.com/services/playfab/multiplayer/networking/xblreference/classes/PartyXblManager/partyxblmanager.md)
- [PartyXblChatUser](https://docs.xbox.com/services/playfab/multiplayer/networking/xblreference/classes/PartyXblChatUser/partyxblchatuser.md)
- [PartyXblLocalChatUser](https://docs.xbox.com/services/playfab/multiplayer/networking/xblreference/classes/PartyXblLocalChatUser/partyxbllocalchatuser.md)
