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

# chat_manager::get_chat_users

> chat_manager::get_chat_users

# chat\_manager::get\_chat\_users

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

<a id="syntaxSection" />

## Syntax

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

<a id="syntaxSection" />

### Parameters

*chatUserCount*   \_Out\_<br />Type: uint32\_t\*

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

*chatUsers*   \_Outptr\_result\_buffer\_(\*chatUserCount)<br />Type: [chat\_user\_array](/reference/chat/gamechat2/classes/chat_user/chat_user)\*

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

<a id="retvalSection" />

### Return value

Type: void

None.

<a id="remarksSection" />

## 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](/reference/chat/gamechat2/classes/chat_user/chat_user) 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](/reference/chat/gamechat2/classes/chat_manager/methods/chat_manager_add_local_user)
* [chat\_manager::add\_remote\_user](/reference/chat/gamechat2/classes/chat_manager/methods/chat_manager_add_remote_user)
* [chat\_manager::cleanup](/reference/chat/gamechat2/classes/chat_manager/methods/chat_manager_cleanup)
* [chat\_manager::remove\_user](/reference/chat/gamechat2/classes/chat_manager/methods/chat_manager_remove_user)

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](/services/xbox-services/multiplayer/chat/game-chat2/using-game-chat-2).

<a id="requirementsSection" />

## Requirements

**Header:** GameChat2.h

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

<a id="seealsoSection" />

## See also

[Intro to Game Chat 2](/services/xbox-services/multiplayer/chat/game-chat2/game-chat-2-intro)<br />[chat\_user](/reference/chat/gamechat2/classes/chat_user/chat_user)<br />[chat\_manager](/reference/chat/gamechat2/classes/chat_manager/chat_manager)


## Related topics

- [PartyXblManager::GetChatUsers](/services/playfab/multiplayer/networking/xblreference/classes/PartyXblManager/methods/partyxblmanager_getchatusers.md)
- [chat_manager::initialize](/reference/chat/gamechat2/classes/chat_manager/methods/chat_manager_initialize.md)
- [chat_manager::remove_user](/reference/chat/gamechat2/classes/chat_manager/methods/chat_manager_remove_user.md)
- [chat_manager::add_remote_user](/reference/chat/gamechat2/classes/chat_manager/methods/chat_manager_add_remote_user.md)
- [chat_manager::add_local_user](/reference/chat/gamechat2/classes/chat_manager/methods/chat_manager_add_local_user.md)
