# appstore_update_privacy

> Set an app's App Privacy answers to exactly a given declaration: preview the changes, save them, or save and publish.

Source: https://air.build/docs/mcp-tools/appstore_update_privacy/

Sets the app's App Privacy answers to exactly the declaration sent: what is in it is added or updated, and answers Apple holds that it leaves out are deleted. `mode` decides how far it goes:

- `preview` (the default) shows what would change and sends nothing;
- `apply` saves the answers;
- `applyAndPublish` saves them and publishes them on the App Store.

When the declaration would delete answers, `apply` and `applyAndPublish` refuse unless `allowDeletes` is true; `preview` shows which answers would be deleted. Changes are made deletes first, then updates, then adds, and stop at the first refusal; the ones made before it stay.

This tool works through the Team owner's Apple sign-in in AirBuild (see [Connect your Apple Developer account](https://air.build/docs/app-store/connect-apple-developer-account/)). Any member of the Team can call it; when the owner's sign-in has lapsed and only the owner can renew it, the call fails with the sentence below until they sign in again.

| Read-only | Destructive | Idempotent |
| --- | --- | --- |
| No | Yes | Yes |

## Inputs

| Input | Type | Required | Default | What it does |
| --- | --- | --- | --- | --- |
| `teamId` | string (UUID) | yes | — | The Team, from [list_teams](https://air.build/docs/mcp-tools/list_teams/). |
| `projectId` | string (UUID) | this or `appId` | — | The Project whose app this is, from [list_projects](https://air.build/docs/mcp-tools/list_projects/): the usual way to name an app. The app is the one on App Store Connect with the bundle id the Project builds. When both are sent, `projectId` is used. |
| `appId` | string | this or `projectId` | — | An App Store Connect app id from [appstore_list_apps](https://air.build/docs/mcp-tools/appstore_list_apps/), for an app no Project builds. |
| `appleTeamId` | string (UUID) | no | every connected Apple team | One of the Team's Apple teams, from [appstore_list_apple_teams](https://air.build/docs/mcp-tools/appstore_list_apple_teams/). With `appId`, only this Apple team is searched for the app. With `projectId` it is not needed: the Project's app decides. |
| `dataUsages` | array of objects | yes | — | Every data use (the rows below). An app that collects nothing: `[{"dataProtections": ["DATA_NOT_COLLECTED"]}]`. [appstore_privacy](https://air.build/docs/mcp-tools/appstore_privacy/) with `includeCatalog` lists every token. |
| `dataUsages[].category` | string | when data is collected | — | The kind of data, e.g. `EMAIL_ADDRESS`, `PRECISE_LOCATION`. Leave out with `DATA_NOT_COLLECTED`. |
| `dataUsages[].purposes` | array of strings | with a linked or not-linked protection | — | e.g. `APP_FUNCTIONALITY`, `ANALYTICS`. Not needed for tracking alone; leave out with `DATA_NOT_COLLECTED`. |
| `dataUsages[].dataProtections` | array of strings, at least 1 | yes | — | `DATA_LINKED_TO_YOU`, `DATA_NOT_LINKED_TO_YOU`, `DATA_USED_TO_TRACK_YOU`; or `DATA_NOT_COLLECTED` alone, as the only entry. |
| `mode` | string: `preview`, `apply`, `applyAndPublish` | no | `preview` | How far to go (above). |
| `allowDeletes` | boolean | no | false | Let `apply` and `applyAndPublish` delete answers the declaration leaves out. |

The checks every tool makes on its inputs are on [Server and sign-in](https://air.build/docs/mcp-tools/server/#errors).

## Result

A JSON object, as text and as `structuredContent`. Each change is written as "_category_ / _purpose_ / _protection_", with `—` for no category. With `preview`:

| Field | What |
| --- | --- |
| `mode` | `preview` |
| `adds` | Answers that would be added |
| `updates` | Answers that would change |
| `deletes` | Answers that would be deleted |
| `note` | Only when there are deletes: "Applying removes the deletes only with allowDeletes: true." |

With `apply` or `applyAndPublish`:

| Field | What |
| --- | --- |
| `mode` | The mode |
| `changed` | What was done, each "`create`, `update` or `delete`: _change_" |
| `keptBecauseDeletesNotAllowed` | Answers that were left in place because Apple gave no way to delete them |
| `published` | Only with `applyAndPublish`: whether the answers are now published |

```json
{
  "mode": "applyAndPublish",
  "changed": [
    "create: EMAIL_ADDRESS / APP_FUNCTIONALITY / DATA_LINKED_TO_YOU"
  ],
  "keptBecauseDeletesNotAllowed": [],
  "published": true
}
```

## Errors

Each comes back as a tool error (`isError: true`). _Italic_ words stand for the values in the sentence. The errors every tool can return are on [Server and sign-in](https://air.build/docs/mcp-tools/server/#errors).

| Message | When | What to do |
| --- | --- | --- |
| This declaration removes _n_ existing data usage declaration(s). Confirm deletion to proceed. | `apply` or `applyAndPublish` would delete answers and `allowDeletes` is not true; nothing was changed | Preview, confirm with the person, then send `allowDeletes: true` |
| dataUsages must be a list. | `dataUsages` is not an array | Send an array |
| declaration.dataUsages must contain at least one entry. | `dataUsages` is empty | Send at least one entry; `DATA_NOT_COLLECTED` for none |
| dataUsages[_i_].category must match [A-Z0-9_]+. | A category is not a token | Use a token from the catalog |
| dataUsages[_i_].purposes contains the invalid value "_value_". | A purpose is not a token | Use a token from the catalog |
| dataUsages[_i_].dataProtections is required. | An entry has no protections | Add them |
| dataUsages[_i_].dataProtections contains the unsupported value "_value_". | A protection other than the four | Use one of the four |
| dataUsages[_i_] with DATA_NOT_COLLECTED cannot be combined with collected data usages. | `DATA_NOT_COLLECTED` beside other entries | Send it alone |
| dataUsages[_i_] with DATA_NOT_COLLECTED cannot include other dataProtections. | `DATA_NOT_COLLECTED` with another protection | Send it alone |
| dataUsages[_i_] with DATA_NOT_COLLECTED cannot include category. | `DATA_NOT_COLLECTED` with a category | Leave the category out |
| dataUsages[_i_] with DATA_NOT_COLLECTED cannot include purposes. | `DATA_NOT_COLLECTED` with purposes | Leave the purposes out |
| dataUsages[_i_] with collected data cannot be combined with DATA_NOT_COLLECTED. | A collected entry before a `DATA_NOT_COLLECTED` one | Drop one of them |
| dataUsages[_i_].category is required when data is collected. | A collected entry without category | Add the category |
| dataUsages[_i_].purposes is required when data is collected. | A linked or not-linked entry without purposes | Add the purposes |
| The Team owner's Apple sign-in has lapsed and only they can renew it: ask them to open AirBuild and sign in to Apple again, then try once more. | The Team owner's Apple sign-in in AirBuild has expired and AirBuild could not renew it without them | Tell the Team owner; they sign in again in AirBuild (see [Connect your Apple Developer account](https://air.build/docs/app-store/connect-apple-developer-account/)). Retrying before that gives the same answer |
| Another Apple account operation is already in progress. | Another App Store action on the same Apple account was running | Try again shortly; the owner does not need to sign in |
| Apple has locked this Apple Account for security reasons. Unlock it at account.apple.com by signing in with the Apple ID and password, then sign in again. | Apple locked the Team owner's Apple Account | Only the Team owner can unlock it at account.apple.com and sign in again in AirBuild |
| Pass projectId, or appId from appstore_list_apps. | Neither `projectId` nor `appId` was sent | Send one of them |
| This Project has not been built for iOS yet, so it has no bundle id to find its app by. Ask the Team's Agent to build it, or pass appId. | The Project has never been built for iOS | Ask the Project's Agent for an iOS build ([send_message](https://air.build/docs/mcp-tools/send_message/)), or name the app by `appId` |
| This Project has no app on App Store Connect yet. Create one with appstore_create_app (its bundle id is the Project's), or pass appId. | No app on the Team's connected Apple teams has the Project's bundle id, or no Apple team is connected | Create the app with [appstore_create_app](https://air.build/docs/mcp-tools/appstore_create_app/), or name another app by `appId` |
| No connected Apple team of this Team has that app. See appstore_list_apps. | `appId` is not an app of any connected Apple team (or of `appleTeamId`) | Take the id from [appstore_list_apps](https://air.build/docs/mcp-tools/appstore_list_apps/) |
| App Store Connect: _Apple's sentence_ | Apple refused the request. Up to five of Apple's own sentences follow, each with the field it is about in brackets when Apple names one. An Apple agreement waiting in App Store Connect is refused this way too | Act on Apple's words. Agreements are accepted by the Apple Developer account's Account Holder in App Store Connect (Business › Agreements) |
| App Store Connect answered _status_. Try again in a moment. | Apple refused without saying why | Try again in a moment |

## Example

```json
{
  "name": "appstore_update_privacy",
  "arguments": {
    "teamId": "00000000-0000-0000-0000-000000000000",
    "projectId": "00000000-0000-0000-0000-000000000000",
    "dataUsages": [
      {
        "category": "EMAIL_ADDRESS",
        "purposes": [
          "APP_FUNCTIONALITY"
        ],
        "dataProtections": [
          "DATA_LINKED_TO_YOU"
        ]
      }
    ],
    "mode": "preview"
  }
}
```
