How to create an App Store Connect API key (and which role to give it)
Step by step: who can create an App Store Connect API key, where the Key ID, Issuer ID and .p8 file are, which role each job needs, and how to fix a 401 error.

An App Store Connect API key lets a script or an app read your sales, reports, reviews and builds without your Apple Account password. You create it in App Store Connect under Users and Access → Integrations → App Store Connect API, give it a role, and download a .p8 file. Apple only lets you download that file once.
You end up with three things: the Key ID (shown next to the key), the Issuer ID (shown at the top of the page) and the .p8 private key. This guide covers who can create a key, the exact steps, which role to choose for common jobs, how the three pieces turn into a token, and what to check when Apple answers with an error. Everything below follows Apple's documentation as of November 2026.
Team keys and individual keys
Apple's guide to creating API keys describes two types:
| Team key | Individual key | |
|---|---|---|
| Access | All apps, limited by the role you pick | The apps and role of the user who made it |
| Who creates it | Account Holder or Admin | Any user, unless an Admin turned this off |
| Where it lives | Users and Access → Integrations | Your profile, under Individual API Key |
| Limits | None of the individual-key limits | One active key per user; no Provisioning endpoints |
For anything that runs without you watching (a report downloader, a dashboard, a CI job), use a team key. Its access is set by a role you choose, so you can give it less than a full user would have. An individual key is tied to a person, so it stops making sense when that person leaves the team.
Who can create one
First, the Account Holder has to request access to the API once. In Apple's help for the API, that means opening Users and Access, clicking Integrations, agreeing to the terms and clicking Submit. Apple says requests are reviewed case by case. You'll only see this step on an account that has never used the API.
After that, the Account Holder or an Admin can generate team keys. If you're a developer on someone else's team, you can't, and you'll need to ask them. Apple also notes that you can't change a key's name or role after you generate it: to change either, revoke it and make a new one.
Create the key, step by step
- Sign in to App Store Connect as the Account Holder or an Admin.
- Open Users and Access, then the Integrations tab, then App Store Connect API in the left column. Make sure Team Keys is selected.
- Click Generate API Key. If you already have an active key, click the add (+) button instead.
- Enter a name. It's for you only and isn't part of the key. A name that says what the key is for ("Storewatch", "CI uploads") makes revoking the right one easier later.
- Under Access, choose the role (see the next section), then click Generate.
- Click Download API Key next to the new key and save the
.p8file somewhere safe. The link disappears after you use it.
Apple's wording on that last point is plain: it doesn't keep a copy of the private key. If you lose the file, revoke the key and generate another.
Where to find the Key ID and Issuer ID
- Key ID: a short code (ten characters in Apple's examples) in the Key ID column of the key list. Hover next to it and click Copy Key ID. It's also in the downloaded file name, which looks like
AuthKey_ABC123DEFG.p8. - Issuer ID: a UUID near the top of the same page. Click Copy next to it. It belongs to your team, so every team key shares the same one.
Individual keys work a little differently: their Key ID is on your profile, and they don't use an Issuer ID at all (more on that below).
Which role should the key have?
Apple says the roles you can give a key are the same ones users have. The safest choice is the role with the least access that still does the job. This table uses the required roles Apple lists on its help pages and API docs for each task:
| Job | Roles Apple lists | Least access that works |
|---|---|---|
| Sales and Trends reports (units, proceeds) | Admin, Finance, Sales | Sales |
| Financial reports (what Apple pays you) | Account Holder, Admin, Finance | Finance |
| Read analytics reports (impressions, page views, sessions) | Admin, Sales and Reports, Finance | Sales and Reports |
| Request analytics reports (once per app) | Admin only | Admin |
| Read customer reviews | Account Holder, Admin, App Manager, Customer Support, Developer, Marketing | Customer Support |
| Reply to reviews | Account Holder, Admin, Customer Support | Customer Support |
| View builds | Account Holder, Admin, App Manager, Developer | Developer |
| Add TestFlight internal testers | Account Holder, Admin, App Manager, Developer, Marketing | Marketing or Developer |
Sources: Apple's help pages for Sales and Trends, financial reports, ratings and reviews, builds and internal testers, and the analytics reports API guide. Those pages describe the App Store Connect screens, and Apple says key roles match user roles, but it doesn't publish one table of roles per API endpoint, so test a new key against the call you care about.
Tip: If you hand a key to a third party that only analyzes reports, Apple suggests the Sales and Reports role. It can read analytics reports but can't create report requests. Roles can't be edited later, so you might make one narrow key per job.
The "analytics" rows are the one place where a single key can't do everything. Apple's analytics reports don't exist until an Admin requests them, so a read-only key has nothing to read until then. The Analytics Reports API guide walks through that request.
From key to token: a short JWT example
The key file isn't sent to Apple. You use it to sign a short-lived JSON Web Token (JWT), and you send that token as a bearer token. Apple's Generating tokens for API requests lists the fields.
The header:
{
"alg": "ES256",
"kid": "ABC123DEFG",
"typ": "JWT"
}
The payload for a team key:
{
"iss": "57246542-96fe-1a63-e053-0824d011072a",
"iat": 1795000000,
"exp": 1795001140,
"aud": "appstoreconnect-v1"
}
kidis your Key ID andissis your Issuer ID.iatandexpare Unix timestamps in seconds. Apple rejects most tokens that expire more than 20 minutes after they're issued. Hereexpis 19 minutes afteriat.audis alwaysappstoreconnect-v1.- The token must be signed with ES256 using the
.p8key. An optionalscopearray limits which requests the token allows. - An individual key has no
iss. Its payload uses"sub": "user"instead.
In Python with the PyJWT library, it's a few lines:
import time, jwt # pip install pyjwt cryptography
now = int(time.time())
token = jwt.encode(
{"iss": ISSUER_ID, "iat": now, "exp": now + 19 * 60, "aud": "appstoreconnect-v1"},
open("AuthKey_ABC123DEFG.p8").read(),
algorithm="ES256",
headers={"kid": "ABC123DEFG", "typ": "JWT"},
)
Then send Authorization: Bearer <token> with every request to https://api.appstoreconnect.apple.com. You can reuse one token until it expires, so there's no need to sign a new one per request.
Keep the key safe, and revoke it if you have to
Treat the .p8 like a password. Apple's advice: don't share it, don't commit it to a repository, and never put it in client-side code. A few habits that make this easy:
- Keep it in a password manager or the macOS Keychain, not in a project folder or a cloud-synced Downloads folder.
- Use one key per tool, so you can revoke one without breaking the others.
- Prefer the narrowest role from the table above.
To revoke a team key, sign in as an Admin, open Users and Access, and use the Keys tab: click Edit next to the active keys, select the key and click Revoke Key. Apple says a revoked key can't be reinstated, and it stays listed under Revoked for 30 days. Revoke at once if the file is lost, shared by accident or pushed to a public repo.
Common errors and what to check
| What you see | Usually means | Fix |
|---|---|---|
| 401 NOT_AUTHORIZED | Apple doesn't accept the token itself: expired, wrong Key ID or Issuer ID, wrong signing key, or an aud that isn't appstoreconnect-v1 | Sign a fresh token. Check that kid matches the key whose .p8 you're signing with. |
| 403 Forbidden | Apple's status table lists a revoked key, a badly formatted token, or an operation the key isn't allowed to do | Check the key is still Active. Then check its role against the table above. |
| Lifetime too long | exp is more than 20 minutes after iat | Use a lifetime of 20 minutes or less. |
| Works for apps, fails for reports | The key's role doesn't cover that area (for example Developer for finance reports) | Make a new key with a role that does. You can't edit the role. |
| No analytics data | Nobody has requested the reports yet, or the request stopped after a long gap without reading | Have an Admin key create the request. See the analytics guide. |
Apple's own status code table lists 403 for revoked keys and malformed tokens, and doesn't list 401. In practice, a token Apple can't validate commonly comes back as 401 NOT_AUTHORIZED, so check the token first and the role second. The errors array in the response body has a code and a detail that narrow it down.
Using the key with Storewatch
If you want your numbers on a Mac dashboard rather than in your own script, Storewatch needs the same three pieces: the .p8 file, the Key ID (it reads it from the file name) and the Issuer ID. It also asks for your vendor number, which is how it downloads Sales reports. You'll find that in Payments and Financial Reports, top left, and it isn't your Team ID.
Storewatch's guided setup suggests an Admin key, because only an Admin key can turn on Apple's analytics reports, edit listings, reply to reviews and submit versions. A narrower role may leave some screens empty, for example analytics. Each developer account needs its own key, so a studio adds one per client.
The key is stored in your Mac's Keychain. It isn't sent to Storewatch, because there's no Storewatch server, and your data stays on your Mac. For what an AI assistant can do with the same data, see connecting Claude to App Store Connect.
Frequently asked questions
Where do I find my Issuer ID in App Store Connect?
Go to Users and Access, open the Integrations tab and choose App Store Connect API. The Issuer ID is near the top of the page, with a Copy button. It's the same for every team key on the account. Individual keys don't use it.
Can I download the .p8 file again?
No. Apple lets you download the private key once and doesn't keep a copy. If it's lost, revoke the key and generate a new one with the same role.
Who can create an App Store Connect API key?
The Account Holder or an Admin can create team keys, after the Account Holder has requested API access. Other users can create an individual key from their profile, unless an Admin has turned that off.
What role should I use for sales and finance reports?
Apple lists Admin, Finance or Sales for Sales and Trends, and Account Holder, Admin or Finance for financial reports. A Finance key covers both. Use Admin only if you also need to request analytics reports.
How long can an App Store Connect API token last?
Apple rejects most tokens that expire more than 20 minutes after they're issued. A few read-only requests with a limited scope can use tokens lasting up to six months, but a 20-minute token is the normal choice.
What is the difference between a Key ID and an Issuer ID?
The Key ID names one specific key and goes in the token header as kid. The Issuer ID names your team and goes in the payload as iss. You need both, plus the .p8 file, to sign a token.