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

# XGameSave

> XGameSave

# XGameSave

The XGameSave API is designed to enable creating, loading, saving and managing game related states. The primary difference between this and previous implementations is that this will provide a flat API with access to an Asynchronous Programming Model that allows the caller to control the threading and memory management of how the API behaves.

## Functions

| Function                                                                                                             | Description                                                                                                                                                                              |
| -------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| [XGameSaveBlobInfoCallback](/reference/system/xgamesave/functions/xgamesaveblobinfocallback)                         | Callback function to retrieve the results of [XGameSaveEnumerateBlobInfo](/reference/system/xgamesave/functions/xgamesaveenumerateblobinfo).                                             |
| [XGameSaveCloseContainer](/reference/system/xgamesave/functions/xgamesaveclosecontainer)                             | Closes the XGameSaveContainer.                                                                                                                                                           |
| [XGameSaveCloseProvider](/reference/system/xgamesave/functions/xgamesavecloseprovider)                               | Releases resources held by the XGameSaveProvider.                                                                                                                                        |
| [XGameSaveCloseUpdate](/reference/system/xgamesave/functions/xgamesavecloseupdate)                                   | Closes a XGameSaveUpdate.                                                                                                                                                                |
| [XGameSaveContainerInfoCallback](/reference/system/xgamesave/functions/xgamesavecontainerinfocallback)               | The callback function for a call made to [XGameSaveGetContainerInfo](/reference/system/xgamesave/functions/xgamesavegetcontainerinfo).                                                   |
| [XGameSaveCreateContainer](/reference/system/xgamesave/functions/xgamesavecreatecontainer)                           | Creates a XGameSaveContainer handle.                                                                                                                                                     |
| [XGameSaveCreateUpdate](/reference/system/xgamesave/functions/xgamesavecreateupdate)                                 | Creates an update which will later be submitted by calling [XGameSaveSubmitUpdate](/reference/system/xgamesave/functions/xgamesavesubmitupdate).                                         |
| [XGameSaveDeleteContainer](/reference/system/xgamesave/functions/xgamesavedeletecontainer)                           | Deletes a XGameSaveContainer from cloud storage.                                                                                                                                         |
| [XGameSaveDeleteContainerAsync](/reference/system/xgamesave/functions/xgamesavedeletecontainerasync)                 | Deletes a XGameSaveContainer asynchronously.                                                                                                                                             |
| [XGameSaveDeleteContainerResult](/reference/system/xgamesave/functions/xgamesavedeletecontainerresult)               | Retrieves the result of a [XGameSaveDeleteContainerAsync](/reference/system/xgamesave/functions/xgamesavedeletecontainerasync) call, use this function to check the success of the call. |
| [XGameSaveEnumerateBlobInfo](/reference/system/xgamesave/functions/xgamesaveenumerateblobinfo)                       | Retrieves the blob info for the contents of a XGameSaveContainer.                                                                                                                        |
| [XGameSaveEnumerateBlobInfoByName](/reference/system/xgamesave/functions/xgamesaveenumerateblobinfobyname)           | Retrieves the blob info for the contents of a XGameSaveContainer limited to the blobs which share a prefix with the blobNamePrefix parameter.                                            |
| [XGameSaveEnumerateContainerInfo](/reference/system/xgamesave/functions/xgamesaveenumeratecontainerinfo)             | Retrieves the container info for a XGameSaveProvider.                                                                                                                                    |
| [XGameSaveEnumerateContainerInfoByName](/reference/system/xgamesave/functions/xgamesaveenumeratecontainerinfobyname) | Retrieves the container info for a XGameSaveProvider.                                                                                                                                    |
| [XGameSaveGetContainerInfo](/reference/system/xgamesave/functions/xgamesavegetcontainerinfo)                         | Retrieves info for the containers in a XGameSaveProvider.                                                                                                                                |
| [XGameSaveGetRemainingQuota](/reference/system/xgamesave/functions/xgamesavegetremainingquota)                       | Returns the amount of data available to store using the XGameSave api.                                                                                                                   |
| [XGameSaveGetRemainingQuotaAsync](/reference/system/xgamesave/functions/xgamesavegetremainingquotaasync)             | Returns the amount of data available to store using the XGameSave api asynchronously.                                                                                                    |
| [XGameSaveGetRemainingQuotaResult](/reference/system/xgamesave/functions/xgamesavegetremainingquotaresult)           | Retrieves the results of the [XGameSaveGetRemainingQuotaAsync](/reference/system/xgamesave/functions/xgamesavegetremainingquotaasync) function.                                          |
| [XGameSaveInitializeProvider](/reference/system/xgamesave/functions/xgamesaveinitializeprovider)                     | Provides and initializes a XGameSave Provider handle.                                                                                                                                    |
| [XGameSaveInitializeProviderAsync](/reference/system/xgamesave/functions/xgamesaveinitializeproviderasync)           | Provides and initializes an XGameSave Provider handle asynchronously.                                                                                                                    |
| [XGameSaveInitializeProviderResult](/reference/system/xgamesave/functions/xgamesaveinitializeproviderresult)         | Contains the results of a [XGameSaveInitializeProviderAsync](/reference/system/xgamesave/functions/xgamesaveinitializeproviderasync) call.                                               |
| [XGameSaveReadBlobData](/reference/system/xgamesave/functions/xgamesavereadblobdata)                                 | Reads the blob data for a container.                                                                                                                                                     |
| [XGameSaveReadBlobDataAsync](/reference/system/xgamesave/functions/xgamesavereadblobdataasync)                       | Read XGameSaveBlob data from a XGameSaveContainer asynchronously.                                                                                                                        |
| [XGameSaveReadBlobDataResult](/reference/system/xgamesave/functions/xgamesavereadblobdataresult)                     | Retrieves the results of a [XGameSaveReadBlobDataAsync](/reference/system/xgamesave/functions/xgamesavereadblobdataasync) call.                                                          |
| [XGameSaveSubmitBlobDelete](/reference/system/xgamesave/functions/xgamesavesubmitblobdelete)                         | Adds a delete action to a game save XGameSaveUpdate.                                                                                                                                     |
| [XGameSaveSubmitBlobWrite](/reference/system/xgamesave/functions/xgamesavesubmitblobwrite)                           | Adds a write action to a XGameSaveUpdate.                                                                                                                                                |
| [XGameSaveSubmitUpdate](/reference/system/xgamesave/functions/xgamesavesubmitupdate)                                 | Submit an update to the XGameSave service. Updates blobs within a container.                                                                                                             |
| [XGameSaveSubmitUpdateAsync](/reference/system/xgamesave/functions/xgamesavesubmitupdateasync)                       | Submit an update to the XGameSave service asynchronously. Updates blobs within a container.                                                                                              |
| [XGameSaveSubmitUpdateResult](/reference/system/xgamesave/functions/xgamesavesubmitupdateresult)                     | Retrieves the result of the [XGameSaveSubmitUpdateAsync](/reference/system/xgamesave/functions/xgamesavesubmitupdateasync) call.                                                         |

## Structures

| Structure                                                                            | Description                                                                     |
| ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------- |
| [XGameSaveBlob](/reference/system/xgamesave/structs/xgamesaveblob)                   | Unit of information for XGameSave storage. Resides within a XGameSaveContainer. |
| [XGameSaveBlobInfo](/reference/system/xgamesave/structs/xgamesaveblobinfo)           | Information about the XGameSaveBlob.                                            |
| [XGameSaveContainerInfo](/reference/system/xgamesave/structs/xgamesavecontainerinfo) | Information about a XGameSaveContainer.                                         |

## Error Codes

The following error codes may be returned by XGameSave APIs. For a complete list, see [Error codes](/reference/errorcodes). For detailed troubleshooting guidance, see [Game Saves Debugging](/build/core-features/common/game-save/game-saves-debugging).

| Code                                      | Value      | Description                                                                                                                                            |
| ----------------------------------------- | ---------- | ------------------------------------------------------------------------------------------------------------------------------------------------------ |
| E\_GS\_INVALID\_CONTAINER\_NAME           | 0x80830001 | The name of the container is invalid. Valid container name characters include uppercase/lowercase letters, digits, underscores, and forward slashes.   |
| E\_GS\_NO\_ACCESS                         | 0x80830002 | The operation failed because the title does not have access to the container storage spaces. Check that the SCID and TitleId are configured correctly. |
| E\_GS\_OUT\_OF\_LOCAL\_STORAGE            | 0x80830003 | The device does not have enough storage capacity to save the game.                                                                                     |
| E\_GS\_USER\_CANCELED                     | 0x80830004 | The user canceled the download of their save games.                                                                                                    |
| E\_GS\_UPDATE\_TOO\_BIG                   | 0x80830005 | The size of the save update is too large. The total size of an XGameSave update must be smaller than GS\_MAX\_BLOB\_SIZE (16 MB).                      |
| E\_GS\_QUOTA\_EXCEEDED                    | 0x80830006 | The title's storage quota for this user has been exceeded.                                                                                             |
| E\_GS\_PROVIDED\_BUFFER\_TOO\_SMALL       | 0x80830007 | The buffer provided to the API was too small.                                                                                                          |
| E\_GS\_BLOB\_NOT\_FOUND                   | 0x80830008 | The specified blob cannot be found.                                                                                                                    |
| E\_GS\_NO\_SERVICE\_CONFIGURATION         | 0x80830009 | The title is not properly configured for connected storage. Check that the SCID is correct and the title is configured in Partner Center.              |
| E\_GS\_CONTAINER\_NOT\_IN\_SYNC           | 0x8083000A | The container is not synchronized yet. Ensure the XGameSave container is synchronized before submitting updates.                                       |
| E\_GS\_CONTAINER\_SYNC\_FAILED            | 0x8083000B | The synchronization of the container failed.                                                                                                           |
| E\_GS\_USER\_NOT\_REGISTERED\_IN\_SERVICE | 0x8083000C | The user's MSA is not yet an XBOX services account.                                                                                                    |
| E\_GS\_HANDLE\_EXPIRED                    | 0x8083000D | The handle used by the function expired and must be reacquired.                                                                                        |
| E\_GS\_ASYNC\_FUNCTION\_REQUIRED          | 0x8083000E | This synchronous function is being called on a time-sensitive thread and risks deadlocks. Use the async implementation instead.                        |
| E\_GS\_PROVIDER\_MISMATCH                 | 0x8083000F | The game is mixing XGameSave and XGameSaveFiles calls, which is not supported.                                                                         |

## Conceptual documentation

* [Game Saves overview](/build/core-features/common/game-save/game-saves-overview)
* [XGameSave guide](/build/core-features/common/game-save/xgamesave)
* [Game Saves debugging](/build/core-features/common/game-save/game-saves-debugging)

## See also

[System API reference](/reference/system/gc-reference-system-toc)


## Related topics

- [XGameSave API overview](/build/core-features/common/game-save/xgamesave.md)
- [XGameSave Provider Save method reference](/reference/system/Wrappers/classes/provider/methods/xgamesave_wrapper_provider_save.md)
- [XGameSave Provider Initialize method reference](/reference/system/Wrappers/classes/provider/methods/xgamesave_wrapper_provider_initialize.md)
- [XGameSave Provider Load method reference](/reference/system/Wrappers/classes/provider/methods/xgamesave_wrapper_provider_load.md)
- [XGameSaveFiles](/reference/system/xgamesavefiles/xgamesavefiles_members.md)
