Palbase Stores · API
/stores/connectHand over an Apple key with a grant
Takes an App Store Connect API key with a grant, checks it with Apple, keeps it sealed with the project's own key and spends the grant. A key Apple does not accept, or a file that is not a key, leaves the grant for the right file. An account whose agreements wait is connected with status agreement. Emits stores.apple.changed (connected).
Called by .
Request body
file_namestring · optionalThe .p8's file name, when a file was picked: Apple names it after the key (AuthKey_<KEYID>.p8), so a mismatch is caught.grantstring · requiredThe grant a connect link carries.issuer_idstring · requiredThe account's issuer id (App Store Connect → Users and Access → Integrations).key_idstring · requiredThe key's id: 10 capital letters and digits.private_keystring · requiredThe .p8 file's text (PEM, a P-256 private key).curl -X POST "https://<your-ref>.palbase.studio/stores/connect" \
-H "content-type: application/json" \
-d '{"grant":"string","issuer_id":"string","key_id":"string","private_key":"string"}'Responses
200Connected
400Validation failed or a required field is missing
410The grant is used, expired, or was tried with 10 keys already
413The body is too large
422Not a key (`not_a_key`), ids of the wrong shape (`key_id_invalid`, `issuer_invalid`), the file is another key (`key_id_mismatch`) or kind (`wrong_key_kind`), or Apple does not accept the key (`apple_key_refused`)
429Over the project's request limit or quota
502App Store Connect could not be reached; retrying is safe
503Temporarily unavailable; retrying is safe after Retry-After
defaultAn error: the envelope names it (`error`) and explains it (`error_description`).
Operation ConnectAppleKey of stores's contract.