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

# XblAchievementsManagerUpdateAchievement

> XblAchievementsManagerUpdateAchievement

# XblAchievementsManagerUpdateAchievement

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

## Syntax

```cpp theme={null}
HRESULT XblAchievementsManagerUpdateAchievement(  
         uint64_t xboxUserId,  
         const char* achievementId,  
         uint8_t currentProgess  
)  
```

### Parameters

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

The XBOX User ID of the player.

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

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

*currentProgess*   \_In\_\
Type: uint8\_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.

### Return value

Type: HRESULT

HRESULT return code for this API operation.

## Remarks

Assuming the Achievements Manager has been successfully initialized with [XblAchievementsManagerAddLocalUser](/reference/live/xsapi-c/achievements_manager_c/functions/xblachievementsmanageraddlocaluser), this API will work even when offline on PC and XBOX consoles. Offline updates will be posted by the system when connection is re-established even if the title isn't running. The result of the operation will not be represented locally immediately. The earliest the update will be reflected will be after the next frame's call to DoWork. Once the change is reflected, the array returned by DoWork will contain a [XblAchievementsManagerEvent](/reference/live/xsapi-c/achievements_manager_c/structs/xblachievementsmanagerevent) of with an event type of AchievementProgressUpdated, and potentially an additional event of type AchievementUnlocked if the new progress resulted in unlocking the achievement. If the achievement has already been unlocked or the progress value is less than or equal to what is cached from the server, this function will return E\_NOT\_VALID\_STATE or E\_INVALIDARG respectively. Only title based achievements may be updated with this function. Event based achievements cannot be updated with this function.

## REST Call

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

## Requirements

**Header:** achievements\_manager\_c.h

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

## See also

[achievements\_manager\_c](/reference/live/xsapi-c/achievements_manager_c/achievements_manager_c_members)


## Related topics

- [Overview of the XBOX Achievements Manager API](/services/xbox-services/player-data/achievements/achievements-manager/live-achievements-manager-overview.md)
- [XblAchievementsManagerAddLocalUser](/reference/live/xsapi-c/achievements_manager_c/functions/xblachievementsmanageraddlocaluser.md)
- [XblAchievementsManagerDoWork](/reference/live/xsapi-c/achievements_manager_c/functions/xblachievementsmanagerdowork.md)
- [XblAchievementsUpdateAchievementAsync](/reference/live/xsapi-c/achievements_c/functions/xblachievementsupdateachievementasync.md)
- [XblAchievementsManagerGetAchievements](/reference/live/xsapi-c/achievements_manager_c/functions/xblachievementsmanagergetachievements.md)
