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

# XblAchievementsUpdateAchievementAsync

> XblAchievementsUpdateAchievementAsync

# XblAchievementsUpdateAchievementAsync

Allow achievement progress to be updated and achievements to be unlocked.

## Syntax

```cpp theme={null}
HRESULT XblAchievementsUpdateAchievementAsync(  
         XblContextHandle xboxLiveContext,  
         uint64_t xboxUserId,  
         const char* achievementId,  
         uint32_t percentComplete,  
         XAsyncBlock* async  
)  
```

### Parameters

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

An xbox live context handle created with XblContextCreateHandle.

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

The XBOX User ID of the player.

*achievementId*   \_In\_z\_\
Type: char\*

The UTF-8 encoded achievement ID as defined by XDP or Dev Center.

*percentComplete*   \_In\_\
Type: uint32\_t

The completion percentage of the achievement to indicate progress. Valid values are from 1 to 100. Set to 100 to unlock the achievement. Progress will be set by the server to the highest value sent

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

Caller allocated AsyncBlock.

### Return value

Type: HRESULT

HRESULT return code for this API operation.

## Remarks

This API will work even when offline on PC and XBOX One. Offline updates will be posted by the system when connection is re-established even if the title isn't running. The result of the asynchronous operation can be obtained by calling [XAsyncGetStatus](/reference/system/xasync/functions/xasyncgetstatus) inside the AsyncBlock callback or after the AsyncBlock is complete. If the achievement has already been unlocked or the progress value is less than or equal to what is currently recorded on the server, then XAsyncGetStatus() inside the callback will return HTTP\_E\_STATUS\_NOT\_MODIFIED (0x80190130L).

## REST Call

V2 POST /users/xuid({xuid})/achievements/{scid}/update

## Requirements

**Header:** achievements\_c.h

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

## See also

[achievements\_c](/reference/live/xsapi-c/achievements_c/achievements_c_members)


## Related topics

- [Updating title-managed Achievements](/services/xbox-services/player-data/achievements/title-managed/how-to/live-how-to-update-achievements.md)
- [Unity C# API wrappers for the GDK](/build/gdk-and-engines/unity/unity-api-wrappers.md)
- [Stats and achievements](/build/steam-porting-guide/features/stats-and-achievements.md)
- [XblAchievementsManagerAddLocalUser](/reference/live/xsapi-c/achievements_manager_c/functions/xblachievementsmanageraddlocaluser.md)
- [XblAchievementsUpdateAchievementForTitleIdAsync](/reference/live/xsapi-c/achievements_c/functions/xblachievementsupdateachievementfortitleidasync.md)
