palbaseDocs

Palbase Stores · API

POST/stores/apple/keys

Make a key at Apple

Makes one key at Apple with the Apple ID session the environment uses, and connects it: no one downloads a .p8. asc — the environment's App Store Connect API key (Admin, every app), connected as POST /stores/connect connects one (409 key_connected when one is). apns — two APNs keys, one for each APNs environment (Apple makes a key scoped to apps for one environment), scoped to the environment's iOS apps, which the notify module takes as its APNs provider. iap — an In-App Purchase key for one of its iOS apps (bundle, required with more than one), which the iap module connects. A module that keeps a key the environment connected itself refuses the one made, and it is revoked at Apple. One a request (each well inside the edge's time); 409 key_made for a kind Palbase made already. The Apple ID must be an Admin or the Account Holder (409 apple_role_insufficient). An owner's or an admin's, or the project's secret key's (403 admin_required for a member); never an environment's token's (403 token_out_of_scope): a key outlives it. Emits stores.apple.changed (asc) or stores.apple.key.made (apns, iap).

Called by your server, with the project's secret key.

Headers

Idempotency-Keystring · optionalMakes the write safe to send again (at most 255 characters). A retry with the same key and the same request gets the first answer back, marked `Idempotent-Replayed: true`, and changes nothing; the same key with a different request is refused with 422, and while the first request still runs a retry gets 409 with Retry-After. Answers are kept for 24 hours.

Request body

bundlestring · optionalThe iOS app an In-App Purchase key is for; required when the environment has more than one.
kind"asc" | "apns" | "iap" · required`asc` (App Store Connect API), `apns` or `iap` (In-App Purchase).
curl
curl -X POST "https://<your-ref>.palbase.studio/stores/apple/keys" \
  -H "apikey: $PALBASE_SECRET_KEY" \
  -H "content-type: application/json" \
  -d '{"kind":"asc"}'

Responses

201The keys made

400Validation failed or a required field is missing

401Missing or invalid API key

403Not the project's secret key; or a change to the platform's own project (`owner_only`) without its owner's access token (X-Palbase-Owner) or its operator's token (X-Palbase-Operator) beside the key. An owner's sign-in that is not a passkey one from the last 15 minutes is 401 `insufficient_user_authentication`.

409The environment is full, or a request with this Idempotency-Key is still running

422The Idempotency-Key was sent with a different request, or the request cannot be done as asked

429Over the project's request limit or quota

502Apple could not be reached; trying again is safe

503Temporarily unavailable; retrying is safe after Retry-After

defaultAn error: the envelope names it (`error`) and explains it (`error_description`).

Operation MakeAppleKey of stores's contract.