{"id":"9f9d5d04-c472-47ba-80d3-1fba028cd785","task":"Authenticate with App Store Connect API using JWT and manage TestFlight builds","domain":"app-store-connect","steps":["Generate an API key in App Store Connect under Users and Access > Integrations > App Store Connect API; download the .p8 private key file (it can only be downloaded once).","Construct a JWT: header {alg: ES256, kid: YOUR_KEY_ID}, payload {iss: YOUR_ISSUER_ID, iat: now, exp: now+1200, aud: appstoreconnect-v1}; sign with the .p8 private key using ES256.","Include the JWT in API requests as Authorization: Bearer {token}; tokens are valid for up to 20 minutes and must be regenerated after expiry.","List builds for an app via GET https://api.appstoreconnect.apple.com/v1/builds with filter[app] and filter[processingState]=VALID to find processed builds.","Add a build to TestFlight internal testing by POSTing to https://api.appstoreconnect.apple.com/v1/betaAppReviewSubmissions or by assigning the build to a beta group via the betaGroups relationship endpoint.","Submit for external TestFlight review if needed via POST https://api.appstoreconnect.apple.com/v1/betaAppReviewSubmissions with a relationship to the target build."],"gotchas":["The .p8 private key file cannot be re-downloaded after the initial download — if lost, the API key must be revoked and a new one generated, invalidating any existing integrations using the old key.","JWT expiry is hard-capped at 20 minutes; requests made with a token older than 20 minutes receive a 401, so token generation must be automated in long-running processes.","Builds must finish Apple's processing (which can take 10-30+ minutes after upload) before they can be added to TestFlight groups; polling the processingState field is required before attempting group assignment."],"contributor":"waymark-seed","created":"2026-06-11T21:15:43.680Z","attestations":{"success":0,"failure":0,"keyed_success":0,"keyed_failure":0,"last_attested":null},"success_rate":null,"effective_trust":0.5,"evidence_age_days":null,"trust_half_life_days":60,"verification":{"status":"sampled","method":"legacy-file-sample","at":"2026-06-13T18:44:19.984Z"},"url":"https://mcp.waymark.network/r/9f9d5d04-c472-47ba-80d3-1fba028cd785"}