/apple-dev-skills:asc-api-automationfrom apple-dev-skills
Automates App Store Connect via the ASC REST API: JWT token minting, TestFlight beta groups, app store versions, review submissions, sales reports, and analytics. Debugs 401/429 errors and identifies steps without API support.
Ships in apple-dev-skills. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them; scripts run unread.
This catalog's default way to drive App Store Connect from scripts and CI: an Apple-native toolchain — a ~30-line Swift/CryptoKit script mints the JWT, plain curl calls the REST API. No fastlane/spaceship, no Ruby gems, no Homebrew, consistent with the catalog's mise + no-third-party baselines.
NOT_AUTHORIZED) or rate limiting (429)Owns: token minting, curl conventions, and the endpoint cookbook below. Does NOT own:
xcode-cloud-single-track-ci), a local xcodebuild -exportArchive / xcrun altool run (→ local-archive-export-upload), Xcode Organizer, Transporter, or the ASC API's Build Uploads resources (POST /v1/buildUploads + buildUploadFiles reserve / commit — not part of this cookbook). This skill picks up after the build exists in ASC..p8 key storage & leak prevention → build-time-secret-injection (Layer 2 secrets/.env) + apple-public-repo-security (rotate-first SOP).app-store-review-rejections; this skill is how to submit, not what.| Key kind | Where | JWT identity claim | Use for |
|---|---|---|---|
| Team key (default) | Users and Access → Integrations; role-scoped | iss = Issuer ID | CI and shared tooling — pick the least-privilege role that works (App Manager covers release ops; avoid Admin) |
| Individual key | Your user profile → Individual API Key | sub: "user" (no iss) | Personal one-off scripts; inherits your permissions |
Store per build-time-secret-injection Layer 2:
# secrets/.env (gitignored; .env.example committed)
ASC_KEY_ID=2X9R4HXF34
ASC_ISSUER_ID=57246542-96fe-1a63-e053-0824d011072a
ASC_KEY_PATH=secrets/AuthKey_2X9R4HXF34.p8
Claims (verified against Apple's Generating tokens for API requests, 2026-07): header alg: ES256 (the only accepted algorithm), kid, typ: JWT; payload iss (Issuer ID, the UUID from Users and Access → Integrations — not your Team ID), iat, exp (invalid if more than 20 minutes ahead — exception: a token carrying scope and restricted to GET requests on allow-listed resources can live up to 6 months, per Apple's Determine the Appropriate Token Lifetime — but that allow-list is Xcode Cloud / Power-and-Performance resources only (Build Actions, Build Runs, Git References, Issues, macOS Versions, Products, Providers, Power and Performance Metrics and Logs, Pull Requests, Repositories, Test Results, Workflows, Xcode Versions); none of this cookbook's endpoints qualify, so release tooling always mints ≤ 20-minute tokens), aud: "appstoreconnect-v1", optional scope (array of allowed requests like "GET /v1/apps" — pin single-purpose tokens to single endpoints).
The script is bundled at ${CLAUDE_SKILL_DIR}/scripts/mint-asc-token.swift (the scripts/ folder next to this SKILL.md; CryptoKit, zero dependencies) — run it by that path, or copy it into your repo's scripts/ first, which the example below assumes.
source secrets/.env
ASC_TOKEN=$(swift scripts/mint-asc-token.swift)
curl -sf -H "Authorization: Bearer $ASC_TOKEN" "https://api.appstoreconnect.apple.com/v1/apps?limit=200"
Mint fresh per run; a job that outlives the token re-mints instead of extending exp.
Content-Type: application/json with the body wrapped as {"data": {"type": ..., "id": ..., "attributes": {...}, "relationships": {...}}}.limit=200 (the max) and follow links.next until absent; the small default page size silently truncates lists otherwise.X-Rate-Limit: user-hour-lim:3500; user-hour-rem:… (rolling hour, per key; Apple says actual limits vary). Exceeding returns 429 RATE_LIMIT_EXCEEDED — back off and re-queue; a 429 lockout hits everything sharing that key, including CI..errors[].detail. Triage: 401 = token/claims problem, 403 = key role or scope problem, 409 = resource state problem (e.g. version not in a submittable state).| Goal | Call |
|---|---|
| App's ASC id | GET /v1/apps?filter[bundleId]=<bundle-id>, then keep only the result whose attributes.bundleId equals <bundle-id> exactly (see Common Mistakes 11) |
| Latest processed builds | GET /v1/builds?filter[app]=<appId>&sort=-uploadedDate&limit=5 |
| TestFlight what's-new | GET /v1/builds/<id>/betaBuildLocalizations → PATCH /v1/betaBuildLocalizations/<locId> with attributes.whatsNew |
| Add build to a beta group | POST /v1/betaGroups/<groupId>/relationships/builds with {"data":[{"type":"builds","id":"<buildId>"}]} |
| Create next App Store version | POST /v1/appStoreVersions — relationship app, attributes platform: "IOS", versionString, releaseType (see Release automation below — don't omit) |
| Set description / what's-new | GET /v1/appStoreVersions/<id>/appStoreVersionLocalizations → PATCH /v1/appStoreVersionLocalizations/<locId> |
| Attach build to version | PATCH /v1/appStoreVersions/<id>/relationships/build |
| Set release behavior | PATCH /v1/appStoreVersions/<id> with attributes.releaseType — MANUAL (release yourself), AFTER_APPROVAL (auto-release the instant Apple approves), or SCHEDULED (auto-release at attributes.earliestReleaseDate, ISO 8601) |
| Submit for review | POST /v1/reviewSubmissions (app + platform) → POST /v1/reviewSubmissionItems (reviewSubmission + appStoreVersion) → PATCH /v1/reviewSubmissions/<id> with attributes.submitted: true |
| Daily sales report | GET /v1/salesReports?filter[frequency]=DAILY&filter[reportType]=SALES&filter[reportSubType]=SUMMARY&filter[vendorNumber]=<n> (+ filter[reportDate]=YYYY-MM-DD for a specific day) — response is a gzipped TSV, not JSON: curl -o report.gz then gunzip |
| App Store analytics | POST /v1/analyticsReportRequests (accessType: "ONGOING") once per app, then poll its reports → instances → segments for download URLs |
The review-submission flow is the reviewSubmissions model introduced in App Store Connect API 1.7, which replaced the deprecated one-shot appStoreVersionSubmissions.
The POST reviewSubmissions → POST reviewSubmissionItems → PATCH submitted: true sequence above assumes the app is already submittable; in practice three preconditions block it and have no REST fix:
| Blocker | Symptom | Fix | Where |
|---|---|---|---|
| App pricing not set | POST reviewSubmissions fails with a pricing-state error (exact error-code string not found in Apple's published API reference — observed in practice) | Set the price once, via the API (POST /v1/appPriceSchedules, "Add a Scheduled Price Change to an App") or the web UI | Needs the Paid Apps Agreement accepted first — web-UI-only (see "Steps with no ASC API at all" below) |
Empty copyright attribute | An ENTITY_ERROR.ATTRIBUTE.REQUIRED-shaped error — documented for other required fields (e.g. companyName); the same shape is observed in practice for a blank copyright, not confirmed against Apple's official attribute reference | Always send a non-empty copyright string | API |
Leftover non-COMPLETE reviewSubmissions | A new POST /v1/reviewSubmissions is refused; the resource has no DELETE (unlike the deprecated pre-2022 appStoreVersionSubmissions, which did) | PATCH /v1/reviewSubmissions/<id> with {"data":{"type":"reviewSubmissions","id":"<id>","attributes":{"canceled":true}}} — state is read-only and transitions to CANCELING in response; during WAITING_FOR_REVIEW, canceling returns the version to an editable state (observed as DEVELOPER_REJECTED) without leaving an Apple rejection record | API |
The three prerequisites above are gaps in an otherwise-scriptable flow. These are different:
Apple publishes no REST resource for them at all, so no amount of scripting closes the gap —
budget a manual, one-time (or rarely-repeated) click in the ASC web UI. For the two verified
cases (Agreements/Tax/Banking, and whole-app Promo Codes vs Subscription Offer Codes) and their
sourcing, read references/no-api-steps.md.
versionString = SemVer, sourced from the build, not reinvented in CI. Set it to the same value as the archived build's MARKETING_VERSION (CFBundleShortVersionString) — bump that once at the Xcode-project level (→ xcode-cloud-single-track-ci build-number & version automation), then read it back for the appStoreVersions call instead of maintaining a second version counter in release tooling.whatsNew, generated once, written twice. Build the "What's New" text from git log <last-tag>..HEAD --oneline (or your conventional-commit tooling) in the release job, then PATCH it into both betaBuildLocalizations (TestFlight) and appStoreVersionLocalizations (App Store) per locale — one generated string, two writes, so testers and reviewers see the same notes.releaseType — set it explicitly, every time. The attribute is optional and Apple's schema documents no default value. The ASC web UI backs the same behavior with an explicit 3-way choice (Manually release this version / Automatically release this version / Automatically release this version after App Review, no earlier than); skipping releaseType in a scripted create/update leaves the version's release behavior to an undocumented default — in practice new versions show up as auto-release — instead of a decision your pipeline made on purpose. Default to MANUAL in automation unless auto-release is the deliberate intent.scope claim can pin a single script to a single request.iss set to Team ID — ASC API wants the Issuer ID (UUID); Team ID belongs to other Apple JWTs (e.g. APNs). Symptom: 401 NOT_AUTHORIZED with a well-formed token.exp more than 20 minutes ahead — token rejected outright (unless it's a scoped, GET-only token on allow-listed resources, which can live up to 6 months); also watch local clock skew on iat.openssl dgst emits a DER-encoded signature; JWT ES256 requires the raw 64-byte r‖s form. CryptoKit's rawRepresentation is already correct.local-archive-export-upload, Organizer, or Transporter.limit=200 + follow links.next.salesReports as JSON — it's a gzipped TSV file.X-Rate-Limit — 429 locks out every consumer of the key.scoped token suffices..p8 committed to the repo — stop and run the rotate-first SOP in apple-public-repo-security; storage layout per build-time-secret-injection.releaseType on an appStoreVersions create/update — the attribute has no documented default, so an unset value can leave a version on automatic release; it goes live the instant Apple approves it instead of waiting for a deliberate manual release. Set releaseType: "MANUAL" explicitly unless auto-release is intended.filter[bundleId] result — the filter has been observed to match by prefix (2026-10): com.example.app also returns com.example.app.dev, so picking data[0] can upload to or submit the wrong app (ITMS-90055 on upload). Apple's reference does not document the match mode; always exact-match attributes.bundleId client-side.whatsNew — for an update to a live app, the review-submission flow was refused with 409 ENTITY_ERROR.ATTRIBUTE.REQUIRED while an appStoreVersionLocalizations entry had no whatsNew (observed once, 2026-10). Write it for every locale before submitting..p8 + IDs stored per build-time-secret-injection Layer 2, nothing tracked by gitkid header, iss = Issuer ID (or sub: "user" for individual keys), exp ≤ 20 min (or a scoped GET-only token, up to 6 months), aud appstoreconnect-v1limit and follows links.next{"data": {...}} wrapperreleaseType explicitly set on every appStoreVersions create/update (MANUAL unless auto-release is intended) — never left to ASC's undocumented defaultgrep for key IDs / issuer ID / .p8 contents across tracked files returns zero hitsxcode-cloud-single-track-ci — build & upload side; this skill starts after the build exists in ASClocal-archive-export-upload — the local xcodebuild -exportArchive / altool upload path; this skill starts after the build exists in ASCbuild-time-secret-injection — where ASC_KEY_ID / ASC_ISSUER_ID / the .p8 live (Layer 2 secrets/.env)apple-public-repo-security — .p8 leak prevention and the rotate-first SOPapp-store-review-rejections — what to submit so review passes; this skill is how to submitreferences/official-docs.md.What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
app-store-connect, testflight, jwt-auth, release-automation, ci-cd
npx claudepluginhub wei18/apple-dev-skills --plugin apple-dev-skills28 skills in this plugin
/ai-translated-localizationLocalization scope and AI-translation execution for Apple-platform Apps on `Localizable.xcstrings` — default locale set, source / primary language rule, per-locale review gotchas, completeness gates. Use when deciding which locales to ship at project setup; when adding or refreshing user-facing strings (UI keys, Game Center, App Store metadata) in non-source locales; when `extractionState: stale` entries or untranslated placeholder markers appear; or when asked "how many locales", "how do translations enter git". Does NOT cover RTL layout or ASC upload mechanics → asc-api-automation./apple-platform-targetsDefault minimum deployment target for Apple-platform Swift Apps — iOS 26 / macOS 26 on the Xcode 26 toolchain (Swift 6 language mode) — and how to deviate down (iOS 18 / 17) or up. Use when starting a new Apple-platform project, writing the Package.swift `platforms:` list, deciding whether an API newer than the floor is worth bumping for or a client requirement forces dropping below it, or when asked "what should the minimum iOS / macOS version be". Entry point of the bootstrap chain; does NOT own language mode → swift6-concurrency, or module layout → swiftpm-modularization./apple-public-repo-securityUse when a repo goes public or open-sources, when a CloudKit server-to-server PEM, ASC API `.p8`, APNs key, signing `.p12`, or provisioning profile first enters the pipeline, or when asked how to prevent or respond to a secret leak (gitleaks, lefthook, GitHub Secret Scanning, `git filter-repo`, rotate-first). Also for Apple upstream telemetry disclosure (MetricKit, Game Center, sysdiagnose). Repo-hygiene baseline only; ship-in-binary identifiers (AdMob IDs via xcconfig) and CLI keys in `secrets/.env` are build-time-secret-injection; ASC API usage is asc-api-automation./apple-three-piece-analyticsChoose analytics and metrics sources for a solo / small-team Apple app and decide whether a third-party tracking SDK is justified. Use when picking an analytics SDK; when asked "should I add Firebase / Mixpanel / Amplitude / TelemetryDeck"; when asked what App Store Connect Analytics, MetricKit (`MXMetricPayload`) or Game Center can measure without an SDK; when the analytics choice drives `PrivacyInfo.xcprivacy` or forces ATT. Does NOT own MetricKit perf wiring (ios-performance-engineering), App Review privacy-label parity (app-store-review-rejections), or sink code (telemetry-facade-pattern)./app-store-review-rejectionsUse when preparing an App Store submission, reading an App Review rejection or Resolution Center message citing a guideline number (2.1, 2.3.x, 3.1.1, 4.3, 5.1.1, 5.1.2), or a privacy-manifest upload email (ITMS-91061 / ITMS-91056, missing required-reason API), or auditing an ads + Remove-Ads IAP + CloudKit + Game Center app for the rejection classes it realistically hits: the ATT-vs-AdMob trap, privacy-label parity with `PrivacyInfo.xcprivacy`, Restore Purchases, screenshot metadata, export compliance. Maps each class to a pre-submit fix. Not the submission mechanics (asc-api-automation) nor StoreKit implementation (storekit2-iap-defaults)./build-time-secret-injectionUse when wiring a value that ships in the binary but must stay out of public-repo diffs until launch (AdMob `GADApplicationIdentifier` / banner unit ID, a third-party SDK app key) into an Apple build via xcconfig, Info.plist `$()` substitution and a guarded `Bundle.main` read, including `ci_post_clone.sh` generation on Xcode Cloud; or when CLI tooling reads an ASC `.p8` / key ID from `secrets/.env`. Not for signing certs, CloudKit or APNs keys, nor leak prevention (gitleaks, lefthook, Secret Scanning) — see apple-public-repo-security. SDK isolation is monetization-sdk-integration.Other plugins' skills for the same job