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

# XblTitleManagedStatsWriteAsync

> XblTitleManagedStatsWriteAsync

# XblTitleManagedStatsWriteAsync

Completely update the calling user's stats. This call wipes out all existing stats (any stats not referenced in the provided array will be removed).

## Syntax

```cpp theme={null}
HRESULT XblTitleManagedStatsWriteAsync(  
         XblContextHandle xblContextHandle,  
         uint64_t xboxUserId,  
         const XblTitleManagedStatistic* statistics,  
         size_t statisticsCount,  
         XAsyncBlock* async  
)  
```

### Parameters

*xblContextHandle*   \_In\_\
Type: [XblContextHandle](/reference/live/xsapi-c/types_c/handles/xblcontexthandle)

XBOX live context for the local user.

*xboxUserId*   \_In\_\
Type: uint64\_t

User whose stats are being updated (can only be the local user).

*statistics*   \_In\_\
Type: [XblTitleManagedStatistic\*](/reference/live/xsapi-c/title_managed_statistics_c/structs/xbltitlemanagedstatistic)

A list of XblTitleManagedStatistic to submit.

*statisticsCount*   \_In\_\
Type: size\_t

Number of items in the statistics array.

*async*   \_In\_\
Type: XAsyncBlock\*

Used for async call.

### Return value

Type: HRESULT

HRESULT return code for this API operation.

## Remarks

To get the result, call [XAsyncGetStatus](/reference/system/xasync/functions/xasyncgetstatus) inside the AsyncBlock callback or after the AsyncBlock is complete. If the call fails for any reason, it is the responsibility of the game to re-submit the request.

## Requirements

**Header:** title\_managed\_statistics\_c.h

**Library:** Microsoft.Xbox.Services.14x.GDK.C.lib

## See also

[title\_managed\_statistics\_c](/reference/live/xsapi-c/title_managed_statistics_c/title_managed_statistics_c_members)


## Related topics

- [Writing title-managed stats](/services/xbox-services/player-data/stats-leaderboards/title-managed/how-to/live-writing-tm-stats.md)
- [XblTitleManagedStatistic](/reference/live/xsapi-c/title_managed_statistics_c/structs/xbltitlemanagedstatistic.md)
- [XblTitleManagedStatsUpdateStatsAsync](/reference/live/xsapi-c/title_managed_statistics_c/functions/xbltitlemanagedstatsupdatestatsasync.md)
- [XblTitleManagedStatsDeleteStatsAsync](/reference/live/xsapi-c/title_managed_statistics_c/functions/xbltitlemanagedstatsdeletestatsasync.md)
- [XblTitleManagedStatType](/reference/live/xsapi-c/title_managed_statistics_c/enums/xbltitlemanagedstattype.md)
