|
| 1 | +--- |
| 2 | +title: Data store right to be forgotten (RTBF) |
| 3 | +description: Configure automated deletion of data store keys and stores when you receive a right-to-be-forgotten request, using the Open Cloud Configs API and DataStoresConfig templates. |
| 4 | +--- |
| 5 | + |
| 6 | +<Alert severity="info"> |
| 7 | +Roblox plans to add a dedicated Creator Hub UI for managing your data store right-to-be-forgotten (RTBF) configurations. Until that UI is available, set up and publish templates using the [Open Cloud Configs API](/cloud/reference/features/configs), as described in this guide. |
| 8 | +</Alert> |
| 9 | + |
| 10 | +**Right to be forgotten (RTBF)** for data stores lets you declare which keys and data stores hold a user's data. When Roblox processes an RTBF request for your experience, the system uses those templates to remove the matching data automatically. This page explains how to generate credentials, define JSON templates (including the `{UserId}` token), and publish them to the **DataStoresConfig** repository through the Configs API. |
| 11 | + |
| 12 | +## 1. Add permissions to an API key |
| 13 | + |
| 14 | +1. In the Creator Dashboard, [create or edit an API key](https://create.roblox.com/dashboard/credentials) to include the **`universe:read`** and **`universe:write`** permissions for every universe where you want to automate RTBF deletion. |
| 15 | + |
| 16 | +For more detail, see [Manage API keys](../../cloud/auth/api-keys.md). |
| 17 | + |
| 18 | +## 2. Define RTBF templates |
| 19 | + |
| 20 | +Templates are stored as a JSON configuration named `user_data_templates`. There are two main types: |
| 21 | + |
| 22 | +- **Key template** — Identifies specific keys. Requires `data_store_type` |
| 23 | + (`STANDARD` or `ORDERED`), `data_store_name`, and `key_pattern`. `scope_pattern` |
| 24 | + is optional but recommended. |
| 25 | +- **Data store template** — Identifies an entire data store. Requires `data_store_type` (currently only supports `STANDARD`) and `data_store_pattern`. |
| 26 | + |
| 27 | +For both template kinds, the `{UserId}` token is replaced with the user's ID when an RTBF request is processed. |
| 28 | + |
| 29 | +```json title="Example configuration" |
| 30 | +{ |
| 31 | + "user_data_templates": [ |
| 32 | + { |
| 33 | + "key_template": { |
| 34 | + "data_store_type": "STANDARD", |
| 35 | + "data_store_name": "PlayerInventory", |
| 36 | + "key_pattern": "User_{UserId}", |
| 37 | + "scope_pattern": "Scope_{UserId}" |
| 38 | + } |
| 39 | + }, |
| 40 | + { |
| 41 | + "key_template": { |
| 42 | + "data_store_type": "ORDERED", |
| 43 | + "data_store_name": "PlayerLeaderboard", |
| 44 | + "key_pattern": "User_{UserId}", |
| 45 | + "scope_pattern": "global" |
| 46 | + } |
| 47 | + }, |
| 48 | + { |
| 49 | + "data_store_template": { |
| 50 | + "data_store_type": "STANDARD", |
| 51 | + "data_store_pattern": "Player_{UserId}_Save" |
| 52 | + } |
| 53 | + } |
| 54 | + ] |
| 55 | +} |
| 56 | +``` |
| 57 | + |
| 58 | +The `{UserId}` token is **case-sensitive**. If `scope_pattern` is omitted or blank, it defaults to `global`. |
| 59 | + |
| 60 | +## 3. Submit via Open Cloud API |
| 61 | + |
| 62 | +The following examples show how to submit templates to the Configs API. Replace `<API_KEY>` and `<UNIVERSE_ID>` in each request. Send all requests to the **DataStoresConfig** repository. |
| 63 | + |
| 64 | +For additional endpoints and behavior, see the [Cloud API reference](/cloud/reference/features/configs) and the [experience configs](../../cloud/guides/configs.md) guide. |
| 65 | + |
| 66 | +The update flow has four stages: draft, verify, publish, and confirm. |
| 67 | + |
| 68 | +### A. Create a draft |
| 69 | + |
| 70 | +This `PUT` request defines your configuration. If a draft already exists, this request overwrites it. |
| 71 | + |
| 72 | +```bash |
| 73 | +curl --location --request PUT 'https://apis.roblox.com/creator-configs-public-api/v1/configs/universes/<UNIVERSE_ID>/repositories/DataStoresConfig/draft:overwrite' \ |
| 74 | + --header 'x-api-key: <API_KEY>' \ |
| 75 | + --header 'Content-Type: application/json' \ |
| 76 | + --data-raw '{ |
| 77 | + "entries": { |
| 78 | + "user_data_templates": [ |
| 79 | + { |
| 80 | + "key_template": { |
| 81 | + "data_store_type": "STANDARD", |
| 82 | + "data_store_name": "PlayerInventory", |
| 83 | + "key_pattern": "User_{UserId}", |
| 84 | + "scope_pattern": "Scope_{UserId}" |
| 85 | + } |
| 86 | + }, |
| 87 | + { |
| 88 | + "key_template": { |
| 89 | + "data_store_type": "ORDERED", |
| 90 | + "data_store_name": "PlayerLeaderboard", |
| 91 | + "key_pattern": "User_{UserId}", |
| 92 | + "scope_pattern": "global" |
| 93 | + } |
| 94 | + }, |
| 95 | + { |
| 96 | + "data_store_template": { |
| 97 | + "data_store_type": "STANDARD", |
| 98 | + "data_store_pattern": "Player_{UserId}_Save" |
| 99 | + } |
| 100 | + } |
| 101 | + ] |
| 102 | + } |
| 103 | +}' |
| 104 | +``` |
| 105 | + |
| 106 | +### B. Verify your draft |
| 107 | + |
| 108 | +Use this `GET` request to retrieve and review the draft before it goes live. |
| 109 | + |
| 110 | +```bash |
| 111 | +curl --location --request GET 'https://apis.roblox.com/creator-configs-public-api/v1/configs/universes/<UNIVERSE_ID>/repositories/DataStoresConfig/draft' \ |
| 112 | + --header 'x-api-key: <API_KEY>' |
| 113 | +``` |
| 114 | + |
| 115 | +### C. Publish the configuration |
| 116 | + |
| 117 | +After verification, send this `POST` request to publish. The only way to undo this action is to restore a previous version. |
| 118 | + |
| 119 | +```bash |
| 120 | +curl --location --request POST 'https://apis.roblox.com/creator-configs-public-api/v1/configs/universes/<UNIVERSE_ID>/repositories/DataStoresConfig/publish' \ |
| 121 | + --header 'x-api-key: <API_KEY>' \ |
| 122 | + --data-raw '{ |
| 123 | + "deploymentStrategy": "Immediate" |
| 124 | +}' |
| 125 | +``` |
| 126 | + |
| 127 | +### D. Verify the change |
| 128 | + |
| 129 | +After publishing, confirm the configuration is live with this `GET` request. |
| 130 | + |
| 131 | +```bash |
| 132 | +curl --location --request GET 'https://apis.roblox.com/creator-configs-public-api/v1/configs/universes/<UNIVERSE_ID>/repositories/DataStoresConfig/full' \ |
| 133 | + --header 'x-api-key: <API_KEY>' |
| 134 | +``` |
| 135 | + |
| 136 | +## Best practices |
| 137 | + |
| 138 | +- **Case sensitivity** — Use the exact `{UserId}` token in your patterns. Variants such as `{userId}` are not accepted. |
| 139 | +- **Manual verification** — Compare your patterns to your live Luau usage using [Data Stores Manager](./data-stores-manager.md) in the Creator Hub before you publish configuration. |
| 140 | +- **Default scopes** — If a data store uses the default scope, set `scope_pattern` to `"global"` in the key template. |
| 141 | +- **Test end-to-end flow on a test experience** — For full validation of your templates, consider creating a test experience and dummy account, populating it with dummy data for that account's User ID, requesting RTBF on the dummy account, and ensuring the data is deleted once the account is processed. |
| 142 | +- **Confirm deletions** — After onboarding on your live experience, when an RTBF request appears in your Roblox.com inbox, verify that the corresponding data is removed within one week. |
0 commit comments