Delete player data
This article describes two main ways to delete a player’s data from PlayFab. You can delete the entire Player account or just delete the data without deleting the account.
Delete a Player account
Deleting a Master Player account deletes all data associated with the player from PlayFab and is synonymous with deleting the player from your game. The DeleteMasterPlayerAccount API does not have a mechanism to selectively delete data associated with the player. See Deleting Event Data and Deleting Custom Data for options to delete data and retain the player account.
Deleting a Master Player account and its data can be accomplished by using the DeleteMasterPlayerAccount Admin API, which is available in all of our SDKs. Please read Make sure you find all the data.
When you make a request to delete a player, PlayFab will quickly remove the player’s personal information from our core system before sending the request to a queue processing agent, which works to remove any remaining information about the player from ancillary systems and subprocessors.
This API returns immediately and provides a JobReceiptId, which you should store for your records. The JobReceiptId is your validation that PlayFab received the request to delete the player.
Once the delete is complete, an email is sent to the notification email address configured for the title. It contains the same JobReceiptId, which was initially returned by the API. The completion of the task will also trigger a PlayStream event.
Using our Webhook feature, you can register to receive these events on an endpoint of your choosing, and process them as needed. The event will contain a JSON blob that has the JobReceiptId.
The following example shows how to use the Admin API with the C# SDK. If you would like to use a different SDK, select one from the list of PlayFab SDKs.
Because this deletion cannot be undone, we suggest confirming with your player that they are comfortable with the scope and impact of their deletion request.
Once the action has been confirmed, use the following code to proceed with Master Player account deletion.
Delete account data without deleting the account
Use this list to help you delete the event data that are associated with a player’s account.
Delete Event Data
Event Data includes PlayStream events and telemetry. Event data is transactional and is generated from user activity.
PlayFab Insights
PlayFab Insights is a fully managed solution where PlayFab stores your event data on your behalf.
You can use the DeleteMasterPlayerEventData API to delete Insights data when the player requests it. This deletes only data stored related to the player in PlayFab Insights, leaving all other data intact.
Delete Custom Data
Custom Data refers to a broad category of features that allow you to associate arbitrary data with a player. PlayFab provides methods to interact with the data from your game logic but doesn’t otherwise interpret or understand the data.
Legacy Player Data
It’s possible to edit and delete the different types of Player Data using the following APIs::
UpdateUserData, UpdateUserInternalData, UpdateUserReadOnlyData, UpdateUserPublisherData, UpdateUserPublisherInternalData, UpdateUserPublisherReadOnlyData
Each of these APIs takes a parameter KeysToRemove which takes in a list of Player Data keys that should be deleted from the player’s profile.
Entity Object
Entity Objects can be deleted using the SetObjects API. In the request body’s Objects array, create an entry for each object you want to delete by specifying its ObjectName and setting DeleteObject to true. Below is an example request body.
Entity Files
Entity Files are deleted using the DeleteFiles API.