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

# XUser (API contents)

> XUser

Reference material for XUser APIs.

## Functions

| Function | Description |
| - | - |
| [XUserAddAsync](https://docs.xbox.com/reference/system/xuser/functions/xuseraddasync.md) | Asynchronously adds a user to a game session. |
| [XUserAddByIdWithUiAsync](https://docs.xbox.com/reference/system/xuser/functions/xuseraddbyidwithuiasync.md) | Asynchronously adds a user to a game session based on a XUID from a game invite. This function should only be used in response to a game invite. |
| [XUserAddByIdWithUiResult](https://docs.xbox.com/reference/system/xuser/functions/xuseraddbyidwithuiresult.md) | Retrieves a handle to the user that XUserAddByIdWithUiAsync creates. This function should only be used in response to a game invite. |
| [XUserAddResult](https://docs.xbox.com/reference/system/xuser/functions/xuseraddresult.md) | Retrieves a handle to a user that XUserAddAsync creates. |
| [XUserChangeEventCallback](https://docs.xbox.com/reference/system/xuser/functions/xuserchangeeventcallback.md) | A callback that an application defines for a user change event. |
| [XUserCheckPrivilege](https://docs.xbox.com/reference/system/xuser/functions/xusercheckprivilege.md) | Determines if a user has a specific privilege. |
| [XUserCloseHandle](https://docs.xbox.com/reference/system/xuser/functions/xuserclosehandle.md) | Closes a specific user handle. |
| [XUserCloseSignOutDeferralHandle](https://docs.xbox.com/reference/system/xuser/functions/xuserclosesignoutdeferralhandle.md) | Closes a specific user sign out deferral handle. |
| [XUserCompare](https://docs.xbox.com/reference/system/xuser/functions/xusercompare.md) | Compares two user handles for equality. |
| [XUserDefaultAudioEndpointUtf16ChangedCallback](https://docs.xbox.com/reference/system/xuser/functions/xuserdefaultaudioendpointutf16changedcallback.md) | A callback that an application defines and invokes when the default audio endpoint for a user changes. |
| [XUserDeviceAssociationChangedCallback](https://docs.xbox.com/reference/system/xuser/functions/xuserdeviceassociationchangedcallback.md) | A callback that invokes when the user-device association changes. |
| [XUserDuplicateHandle](https://docs.xbox.com/reference/system/xuser/functions/xuserduplicatehandle.md) | Duplicates a user handle. |
| [XUserFindControllerForUserWithUiAsync](https://docs.xbox.com/reference/system/xuser/functions/xuserfindcontrollerforuserwithuiasync.md) | Shows a dialog that will prompt the user to turn on and identify which controller they want to use. |
| [XUserFindControllerForUserWithUiResult](https://docs.xbox.com/reference/system/xuser/functions/xuserfindcontrollerforuserwithuiresult.md) | Retrieves the application local device ID (APP\_LOCAL\_DEVICE\_ID) that a user has chosen to use. |
| [XUserFindForDevice](https://docs.xbox.com/reference/system/xuser/functions/xuserfindfordevice.md) | Retrieves the user ID for a specific device ID. |
| [XUserFindUserById](https://docs.xbox.com/reference/system/xuser/functions/xuserfinduserbyid.md) | Retrieves the XBOX User ID (XUID) for a local user. |
| [XUserFindUserByLocalId](https://docs.xbox.com/reference/system/xuser/functions/xuserfinduserbylocalid.md) | Retrieves a handle to the user for a specific local user ID. |
| [XUserGetAgeGroup](https://docs.xbox.com/reference/system/xuser/functions/xusergetagegroup.md) | Returns the age group of a user. |
| [XUserGetDefaultAudioEndpointUtf16](https://docs.xbox.com/reference/system/xuser/functions/xusergetdefaultaudioendpointutf16.md) | Retrieves the default audio endpoint for a specific user. |
| [XUserGetGamerPictureAsync](https://docs.xbox.com/reference/system/xuser/functions/xusergetgamerpictureasync.md) | Asynchronously retrieves the gamer picture for a specific user. |
| [XUserGetGamerPictureResult](https://docs.xbox.com/reference/system/xuser/functions/xusergetgamerpictureresult.md) | Retrieves the result of a call to XUserGetGamerPictureAsync. |
| [XUserGetGamerPictureResultSize](https://docs.xbox.com/reference/system/xuser/functions/xusergetgamerpictureresultsize.md) | Returns the buffer size that [XUserGetGamerPictureResult](https://docs.xbox.com/reference/system/xuser/functions/xusergetgamerpictureresult.md) requires to retrieve the gamer picture that [XUserGetGamerPictureAsync](https://docs.xbox.com/reference/system/xuser/functions/xusergetgamerpictureasync.md) returns. |
| [XUserGetGamertag](https://docs.xbox.com/reference/system/xuser/functions/xusergetgamertag.md) | Retrieves the gamertag for a specific user. |
| [XUserGetId](https://docs.xbox.com/reference/system/xuser/functions/xusergetid.md) | Gets the user ID for a specific user. |
| [XUserGetIsGuest](https://docs.xbox.com/reference/system/xuser/functions/xusergetisguest.md) | Returns a boolean indicating if a user is a guest. |
| [XUserGetLocalId](https://docs.xbox.com/reference/system/xuser/functions/xusergetlocalid.md) | Retrieves a unique game session id for a user. |
| [XUserGetMaxUsers](https://docs.xbox.com/reference/system/xuser/functions/xusergetmaxusers.md) | Retrieves the maximum number of users that a game session allows on the current platform. |
| [XUserGetSignOutDeferral](https://docs.xbox.com/reference/system/xuser/functions/xusergetsignoutdeferral.md) | Retrieves a handle to the sign out deferral. |
| [XUserGetState](https://docs.xbox.com/reference/system/xuser/functions/xusergetstate.md) | Retrieves the state of a user. |
| [XUserGetTokenAndSignatureAsync](https://docs.xbox.com/reference/system/xuser/functions/xusergettokenandsignatureasync.md) | Asynchronously retrieves xtokens and signatures for web requests. |
| [XUserGetTokenAndSignatureResult](https://docs.xbox.com/reference/system/xuser/functions/xusergettokenandsignatureresult.md) | Gets the result of a call to XUserGetTokenAndSignatureAsync. |
| [XUserGetTokenAndSignatureResultSize](https://docs.xbox.com/reference/system/xuser/functions/xusergettokenandsignatureresultsize.md) | Gets the buffer size for holding the results of a call to XUserGetTokenAndSignatureAsync. |
| [XUserGetTokenAndSignatureUtf16Async](https://docs.xbox.com/reference/system/xuser/functions/xusergettokenandsignatureutf16async.md) | Asynchronously retrieves Unicode xtokens and signatures for web requests. |
| [XUserGetTokenAndSignatureUtf16Result](https://docs.xbox.com/reference/system/xuser/functions/xusergettokenandsignatureutf16result.md) | Gets the result of a call to XUserGetTokenAndSignatureUtf16Async. |
| [XUserGetTokenAndSignatureUtf16ResultSize](https://docs.xbox.com/reference/system/xuser/functions/xusergettokenandsignatureutf16resultsize.md) | Gets the buffer size for holding the results of a call to XUserGetTokenAndSignatureUtf16Async. |
| [XUserIsSignOutPresent](https://docs.xbox.com/reference/system/xuser/functions/xuserissignoutpresent.md) | Indicates whether the game can sign out a user with XUserSignOutAsync in the current runtime. |
| [XUserIsStoreUser](https://docs.xbox.com/reference/system/xuser/functions/xuserisstoreuser.md) | Checks if the XUser MSA is the same as the MSA signed into the Microsoft Store. |
| [XUserRegisterForChangeEvent](https://docs.xbox.com/reference/system/xuser/functions/xuserregisterforchangeevent.md) | Registers a callback for a user change event. |
| [XUserRegisterForDefaultAudioEndpointUtf16Changed](https://docs.xbox.com/reference/system/xuser/functions/xuserregisterfordefaultaudioendpointutf16changed.md) | Registers a callback that the application defines and invokes when the default audio endpoint changes. |
| [XUserRegisterForDeviceAssociationChanged](https://docs.xbox.com/reference/system/xuser/functions/xuserregisterfordeviceassociationchanged.md) | Registers a callback for user device association change events. |
| [XUserResolveIssueWithUiAsync](https://docs.xbox.com/reference/system/xuser/functions/xuserresolveissuewithuiasync.md) | Displays a system User Interface for solving token issues with a non-unicode URL. |
| [XUserResolveIssueWithUiResult](https://docs.xbox.com/reference/system/xuser/functions/xuserresolveissuewithuiresult.md) | Retrieves the result of a call to XUserResolveIssueWithUiAsync. |
| [XUserResolveIssueWithUiUtf16Async](https://docs.xbox.com/reference/system/xuser/functions/xuserresolveissuewithuiutf16async.md) | Displays a system User Interface for solving token issues with a specific unicode URL. |
| [XUserResolveIssueWithUiUtf16Result](https://docs.xbox.com/reference/system/xuser/functions/xuserresolveissuewithuiutf16result.md) | Retrieves the result of a call to XUserResolveIssueWithUiUtf16Async. |
| [XUserResolvePrivilegeWithUiAsync](https://docs.xbox.com/reference/system/xuser/functions/xuserresolveprivilegewithuiasync.md) | Displays a resolution user interface for required user privileges. |
| [XUserResolvePrivilegeWithUiResult](https://docs.xbox.com/reference/system/xuser/functions/xuserresolveprivilegewithuiresult.md) | Retrieves the result of a call to XUserResolvePrivilegeWithUiAsync. |
| [XUserSignOutAsync](https://docs.xbox.com/reference/system/xuser/functions/xusersignoutasync.md) | Asynchronously signs out a user on runtimes where the game manages sign-out. |
| [XUserSignOutResult](https://docs.xbox.com/reference/system/xuser/functions/xusersignoutresult.md) | Retrieves the result of a call to XUserSignOutAsync. |
| [XUserUnregisterForChangeEvent](https://docs.xbox.com/reference/system/xuser/functions/xuserunregisterforchangeevent.md) | Unregisters a previously registered user change callback. |
| [XUserUnregisterForDefaultAudioEndpointUtf16Changed](https://docs.xbox.com/reference/system/xuser/functions/xuserunregisterfordefaultaudioendpointutf16changed.md) | Unregisters a previously-registered default audio endpoint change callback. |
| [XUserUnregisterForDeviceAssociationChanged](https://docs.xbox.com/reference/system/xuser/functions/xuserunregisterfordeviceassociationchanged.md) | Unregisters a previously registered user device association change callback. |
| [xUserPlatformRemoteConnectSetEventHandlers](https://docs.xbox.com/reference/system/xuser/functions/xuserplatformremoteconnectseteventhandlers.md) | Sets the remote connect event handlers |
| [XUserPlatformRemoteConnectCancelPrompt](https://docs.xbox.com/reference/system/xuser/functions/xuserplatformremoteconnectcancelprompt.md) | Signal to XUser that the remote connect prompt has been dismissed by the user. |
| [XUserPlatformRemoteConnectShowPromptEventHandler](https://docs.xbox.com/reference/system/xuser/functions/xuserplatformremoteconnectshowprompteventhandler.md) | Show prompt for remote connect authentication event handler. |
| [XUserPlatformRemoteConnectClosePromptEventHandler](https://docs.xbox.com/reference/system/xuser/functions/xuserplatformremoteconnectcloseprompteventhandler.md) | Close prompt for remote authentication event handler. |
| [XUserPlatformSpopPromptEventHandler](https://docs.xbox.com/reference/system/xuser/functions/xuserplatformspopprompteventhandler.md) | Show prompt for SPOP operation event handler |
| [XUserPlatformSpopPromptSetEventHandlers](https://docs.xbox.com/reference/system/xuser/functions/xuserplatformspoppromptseteventhandlers.md) | Sets the SPOP prompt event handler. |
| [XUserPlatformSpopPromptComplete](https://docs.xbox.com/reference/system/xuser/functions/xuserplatformspoppromptcomplete.md) | Signal to XUser that the user finished interacting with the SPOP prompt. |

## Removed functions

These functions were removed from XUser.h in the October 2026 GDK. Their pages remain for reference.

| Function | Description |
| - | - |
| [XUserGetMsaTokenSilentlyAsync](https://docs.xbox.com/reference/system/xuser/functions/xusergetmsatokensilentlyasync.md) | Removed in the October 2026 GDK. |
| [XUserGetMsaTokenSilentlyResult](https://docs.xbox.com/reference/system/xuser/functions/xusergetmsatokensilentlyresult.md) | Removed in the October 2026 GDK. |
| [XUserGetMsaTokenSilentlyResultSize](https://docs.xbox.com/reference/system/xuser/functions/xusergetmsatokensilentlyresultsize.md) | Removed in the October 2026 GDK. |

## Structures

| Structure | Description |
| - | - |
| [APP\_LOCAL\_DEVICE\_ID](https://docs.xbox.com/reference/system/xuser/structs/app_local_device_id.md) | Specifies the root ID of a local input device. |
| [XUserDeviceAssociationChange](https://docs.xbox.com/reference/system/xuser/structs/xuserdeviceassociationchange.md) | Specifies the old and new device associations when a device association changes. |
| [XUserGetTokenAndSignatureData](https://docs.xbox.com/reference/system/xuser/structs/xusergettokenandsignaturedata.md) | Specifies the xtokens and signatures that we retrieve for web requests. |
| [XUserGetTokenAndSignatureHttpHeader](https://docs.xbox.com/reference/system/xuser/structs/xusergettokenandsignaturehttpheader.md) | Specifies the HTTP header for a web request. |
| [XUserGetTokenAndSignatureUtf16Data](https://docs.xbox.com/reference/system/xuser/structs/xusergettokenandsignatureutf16data.md) | Contains Unicode xtokens and signatures for web requests. |
| [XUserGetTokenAndSignatureUtf16HttpHeader](https://docs.xbox.com/reference/system/xuser/structs/xusergettokenandsignatureutf16httpheader.md) | Contains a Unicode HTTP header for a web request. |
| [XUserLocalId](https://docs.xbox.com/reference/system/xuser/structs/xuserlocalid.md) | Specifies a game session ID for a user. |
| [XUserPlatformRemoteConnectEventHandlers](https://docs.xbox.com/reference/system/xuser/structs/xuserplatformremoteconnecteventhandlers.md) | Encapsulates the remote connect event handlers |

## Enumerations

| Enumeration | Description |
| - | - |
| [XUserAddOptions](https://docs.xbox.com/reference/system/xuser/enums/xuseraddoptions.md) | Specifies the options for adding a user. |
| [XUserAgeGroup](https://docs.xbox.com/reference/system/xuser/enums/xuseragegroup.md) | Specifies the age group of a user. |
| [XUserChangeEvent](https://docs.xbox.com/reference/system/xuser/enums/xuserchangeevent.md) | Specifies the type of user change event. |
| [XUserDefaultAudioEndpointKind](https://docs.xbox.com/reference/system/xuser/enums/xuserdefaultaudioendpointkind.md) | Specifies whether the user's default audio endpoint renders or captures audio. |
| [XUserGamerPictureSize](https://docs.xbox.com/reference/system/xuser/enums/xusergamerpicturesize.md) | Specifies the size of the gamer picture in pixels. |
| [XUserGamertagComponent](https://docs.xbox.com/reference/system/xuser/enums/xusergamertagcomponent.md) | Specifies the type (or component) of gamertag to fetch. |
| [XUserGetMsaTokenSilentlyOptions](https://docs.xbox.com/reference/system/xuser/enums/xusergetmsatokensilentlyoptions.md) | Options for XUserGetMsaTokenSilentlyOptions. |
| [XUserGetTokenAndSignatureOptions](https://docs.xbox.com/reference/system/xuser/enums/xusergettokenandsignatureoptions.md) | Options for GetUserTokenAndSignatureAsync. |
| [XUserPrivilege](https://docs.xbox.com/reference/system/xuser/enums/xuserprivilege.md) | Specifies the privileges of a user. |
| [XUserPrivilegeDenyReason](https://docs.xbox.com/reference/system/xuser/enums/xuserprivilegedenyreason.md) | Specifies the reason a user could not obtain a privilege. |
| [XUserPrivilegeOptions](https://docs.xbox.com/reference/system/xuser/enums/xuserprivilegeoptions.md) | Specifies the user privilege options. |
| [XUserState](https://docs.xbox.com/reference/system/xuser/enums/xuserstate.md) | Specifies the current state of the user. |
| [XUserPlatformOperationResult](https://docs.xbox.com/reference/system/xuser/enums/XUserPlatformOperationResult.md) | Enum defining the results of a client operation |
| [XUserPlatformSpopOperationResult](https://docs.xbox.com/reference/system/xuser/enums/xuserplatformspopoperationresult.md) | Enum defining the results of a client operation. |

## Conceptual documentation

* [Asynchronous programming design goals and improvements](https://docs.xbox.com/build/core-features/common/async/async-whitepaper.md)
* [WinHTTP overview](https://docs.xbox.com/build/console-features/networking/web-requests/intro-winhttp.md)
* [Web requests (contents)](https://docs.xbox.com/build/console-features/networking/web-requests/web-requests-toc.md)
* [Time-sensitive threads](https://learn.microsoft.com/gaming/gdk/docs/gdk-dev/console-dev/overviews/threads/time-sensitive-threads)
* [Using C# wrappers for GDK APIs in your Unity project](https://docs.xbox.com/build/gdk-and-engines/unity/unity-api-wrappers.md)

## See also

[System API reference](https://docs.xbox.com/reference/system/gc-reference-system-toc.md)

## Error Codes

The following error codes may be returned by XUser APIs. For a complete list, see [Error codes](https://docs.xbox.com/reference/errorcodes.md).

| Code | Value | Description |
| - | - | - |
| E\_GAMEUSER\_MAX\_USERS\_ADDED | 0x89245100 | Cannot add this user because the maximum number of users has been reached. |
| E\_GAMEUSER\_SIGNED\_OUT | 0x89245101 | Cannot perform the operation because the user is signed out. |
| E\_GAMEUSER\_RESOLVE\_USER\_ISSUE\_REQUIRED | 0x89245102 | UI is required to resolve an issue with this user. |
| E\_GAMEUSER\_DEFERRAL\_NOT\_AVAILABLE | 0x89245103 | Not an appropriate time to request deferral. |
| E\_GAMEUSER\_USER\_NOT\_FOUND | 0x89245104 | User matching the ID was not found. |
| E\_GAMEUSER\_NO\_TOKEN\_REQUIRED | 0x89245105 | No token is required for this call. |
| E\_GAMEUSER\_NO\_DEFAULT\_USER | 0x89245106 | No current default user. If you get this error, call XUserAddAsync again without AddDefaultUserSilently. |
| E\_GAMEUSER\_FAILED\_TO\_RESOLVE | 0x89245107 | Failed to resolve the given privilege. |
| E\_GAMEUSER\_NO\_TITLE\_ID | 0x89245108 | An XBOX Live TitleId must be configured. |
| E\_GAMEUSER\_UNKNOWN\_GAME\_IDENTITY | 0x89245109 | The game identity is not recognized. The MSAAppId and TitleId do not match the ones associated to the game. |
| E\_GAMEUSER\_NO\_PACKAGE\_IDENTITY | 0x89245110 | A package identity must be configured. |
| E\_GAMEUSER\_FAILED\_TO\_GET\_TOKEN | 0x89245111 | The token request failed. |
| E\_GAMEUSER\_INVALID\_APP\_CONFIGURATION | 0x89245112 | The MSAAppId in the game config is invalid or not configured for the authentication stack. |
| E\_GAMEUSER\_MALFORMED\_MSAAPPID | 0x89245113 | The MSAAppId in the game config does not match the expected format (16 character string or GUID). |
| E\_GAMEUSER\_INCONSISTENT\_MSAAPPID\_AND\_TITLEID | 0x89245114 | The MSAAppId and TitleId in the game config do not match the ones associated to the game. |


## Related topics

- [User sign-in (contents)](https://docs.xbox.com/services/xbox-services/fundamentals/identity/auth/live-authentication-nav.md)
- [Auth](https://docs.xbox.com/services/xbox-services/fundamentals/identity/auth/index.md)
- [Account authentication and access overview](https://docs.xbox.com/services/xbox-services/fundamentals/identity/auth/live-authentication-overview.md)
- [Users (contents)](https://docs.xbox.com/build/core-features/common/user/user-toc.md)
- [XUserPrivilege](https://docs.xbox.com/reference/system/xuser/enums/xuserprivilege.md)
