Get webhook events from Apple at your server
Have an Agent set up an App Store Connect webhook so Apple tells your server when a build, a version or TestFlight feedback changes, send a test ping, read the deliveries and resend one your server missed.
A webhook makes App Store Connect call your own server when something happens to your app: a build upload’s state changes, a version’s state changes, a tester sends feedback. Apple sends each event to an address you choose, and your server decides what to do with it.
You don’t need a webhook to follow your app in AirBuild: AirBuild already notifies you when Apple changes a version’s review state. See Submit to App Review and release.
Before you start
- A server you control, at a public address, ready to take the events. This page doesn’t cover building it: Apple’s Configuring and parsing App Store Connect API webhook notifications ↗ explains what Apple sends.
- A secret: a phrase you choose, that your server also knows. Apple’s help says your server uses it to check that a delivery really comes from App Store Connect.
- Your app’s App Store Connect record. A webhook is for one app. See Create your app’s App Store Connect record.
Choose the events
A webhook sends only the event types you pick. asc accepts these:
| Event type | When Apple sends it |
|---|---|
BUILD_UPLOAD_STATE_UPDATED |
A build upload’s state changes. |
BUILD_BETA_DETAIL_EXTERNAL_BUILD_STATE_UPDATED |
A build’s state for external TestFlight testers changes. |
APP_STORE_VERSION_APP_VERSION_STATE_UPDATED |
An App Store version’s state changes. |
BETA_FEEDBACK_SCREENSHOT_SUBMISSION_CREATED |
A tester sends TestFlight feedback with a screenshot. |
BETA_FEEDBACK_CRASH_SUBMISSION_CREATED |
A tester sends a crash report from TestFlight. |
BACKGROUND_ASSET_VERSION_STATE_UPDATED, BACKGROUND_ASSET_VERSION_INTERNAL_BETA_RELEASE_CREATED, BACKGROUND_ASSET_VERSION_EXTERNAL_BETA_RELEASE_STATE_UPDATED, BACKGROUND_ASSET_VERSION_APP_STORE_RELEASE_STATE_UPDATED |
An asset pack version changes. See Download extra content after your app is installed. |
ALTERNATIVE_DISTRIBUTION_PACKAGE_AVAILABLE_UPDATED, ALTERNATIVE_DISTRIBUTION_PACKAGE_VERSION_CREATED, ALTERNATIVE_DISTRIBUTION_TERRITORY_AVAILABILITY_UPDATED |
Distribution outside the App Store changes: a package’s availability, a new package version, or the countries or regions where it’s available. See Distribute your app from your own website in the EU. |
Apple’s Understanding webhook events ↗ says what each event carries.
Create the webhook
Ask in the Project’s chat with your own address, and your server’s secret in place of YOUR_SECRET, for example:
Create a webhook called Build Updates at https://example.com/apple/webhook with the secret YOUR_SECRET, for build upload and version state events.- The Agent creates it with
asc webhooks create, with a name, the address, the secret, the event types and whether it’s on (--enabled trueorfalse). All of them are needed, so say if you want it off to begin with. - It tells you in the chat what it made: the webhook’s name, address, event types and whether it’s on.
ascdoesn’t show the secret again, so keep your own copy on your server.
To list your app’s webhooks later, ask “Which webhooks does this app have?” The Agent uses asc webhooks list.
Send a test
Ask:
Ping the Build Updates webhook.The Agent sends a test with asc webhooks ping. Apple’s help says the test shows in App Store Connect under Recent Deliveries with the Ping event. Check that your server got it, or ask the Agent for the deliveries (below) to see what your server answered.
Read the deliveries
Each event Apple sends is a delivery. Ask, for example:
Show the Build Updates webhook's deliveries since yesterday.The Agent lists them with asc webhooks deliveries, and can limit them to a time range (--created-after, --created-before). For each delivery it shows:
- when it was made and when it was sent
- its delivery state, and the error, if there was one
- whether it was sent again
- the address it went to
- the HTTP status code your server answered with, and what your server sent back
Resend a delivery
If your server was down or answered with an error, fix it first, then ask:
Resend the failed deliveries from this morning.The Agent sends each one again with asc webhooks deliveries redeliver. Check the deliveries again to see your server’s new answer.
Change, turn off or delete it
| Ask | asc |
|---|---|
| “Point the webhook at https://example.com/new-hook ↗.” | webhooks update --url |
| “Add TestFlight feedback to the webhook’s events.” | webhooks update --events, with the full list of event types it should have. |
| “Change the webhook’s secret to YOUR_NEW_SECRET.” | webhooks update --secret. Put the new secret on your server too. |
| “Turn off the webhook for now.” | webhooks update --enabled false. Turn it back on with --enabled true. |
| “Delete the webhook.” | webhooks delete, only with --confirm, so the Agent asks you first. |
webhooks update can’t move a webhook to another app. Apple’s help says to make a new webhook for that app instead.
Questions
Can I set up a webhook in AirBuild?
The Agent says an --events value is invalid.
invalid --events value "…"; must be one of: and the list. Pick event types from Choose the events.