# Create API Keys For App Store Connect API

## Step 1 - Generate Private Key and Assign It a Role

When you create an API key, assign it a role that determines the key's access to areas of the App Store Connect API and permissions for performing tasks. For example, keys with the Admin role have broad permissions and can do things like create new users and delete users. The roles that apply to keys are the same roles that apply to users on your team; for more information, see [Program Roles](https://developer.apple.com/support/roles/). API keys can access all apps, regardless of their role.

{% hint style="info" %}
An API key's access cannot be limited to specific apps.
{% endhint %}

The [App Store Connect API](https://developer.apple.com/app-store-connect/api/) is an official public API used to manage app metadata, pricing and availability, provisioning, and more. StoreSyncer utilizes this API to authenticate operations done to your app metadata.

To generate an API key to use with the App Store Connect API, log in to [App Store Connect](https://appstoreconnect.apple.com/).

1. Select Users and Access, and then select the API Keys tab.
2. Click Generate API Key or the Add (+) button.

<figure><img src="https://2752036286-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FKU4yiEvj2d0yI6EIHgoI%2Fuploads%2Fou1YlHjLU597dkgjgRYa%2F1.png?alt=media&#x26;token=bcd992dd-1293-4a29-abb0-76f3b86c81fa" alt=""><figcaption></figcaption></figure>

3. Enter a name for the key. The name is for your reference only and is not part of the key itself.
4. Under Access, select the role for the key.
5. Click Generate.

<figure><img src="https://2752036286-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FKU4yiEvj2d0yI6EIHgoI%2Fuploads%2FlRhkrZpojYGsMFkio4js%2F2.png?alt=media&#x26;token=afbb07d6-0827-434b-bd4c-6049cf698688" alt=""><figcaption></figcaption></figure>

{% hint style="warning" %}
Role for API key must be [**"App Manager"**](https://developer.apple.com/support/roles/)**,** otherwise StoreSyncer can not function properly.
{% endhint %}

The new key's name, key ID, a download link, and other information appears on the page.

<figure><img src="https://2752036286-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FKU4yiEvj2d0yI6EIHgoI%2Fuploads%2FvT6TlYq9Inhz4tAEvCVE%2F3.png?alt=media&#x26;token=6385de97-428c-4de8-8bcb-1656b1dd110e" alt=""><figcaption></figcaption></figure>

## Step 2 - Download and Store the Private Key

Once you've generated your API key, you are given the opportunity to download the private half of the key.

1. Log in to [App Store Connect](https://appstoreconnect.apple.com/).
2. Select Users and Access, and then select the API Keys tab.
3. Click "Download API Key" link next to the new API key.

<figure><img src="https://2752036286-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FKU4yiEvj2d0yI6EIHgoI%2Fuploads%2FLppGpZwiTJb9soomijU6%2F4.png?alt=media&#x26;token=8329f187-11ca-4397-8fda-96c250f486ea" alt=""><figcaption></figcaption></figure>

{% hint style="warning" %}
The private key is available for download a ***single*** time.
{% endhint %}

<figure><img src="https://2752036286-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FKU4yiEvj2d0yI6EIHgoI%2Fuploads%2FWB6Ygma61tCQEf9SOYq5%2F5.png?alt=media&#x26;token=69942d21-49b3-432f-946c-df9dfadae500" alt=""><figcaption></figcaption></figure>

The download link appears only if the private key has not yet been downloaded. Store your private key in a safe place.
