Schedule a Push Upgrade Using SOAP API for First- and Second-Generation Managed Packages
After you’ve created an updated version of your package, you can automatically deploy it to customers using a push upgrade.
Partners can also grant select customers the ability to block push upgrades by setting up customized push upgrades. See Enable a Package Subscriber to Restrict Push Upgrades for more information.
For code samples and more detailed steps, see SOAP API object documentation linked in each step.
-
Authenticate to your Dev Hub org.
-
Query MetadataPackage to verify package details.
-
Query MetadataPackageVersion to verify the package version to use for the push upgrade.
-
Query PackageSubscriber to retrieve details about subscriber orgs such as the org ID and installed package version. To retrieve information about more than 2,000 subscribers, use SOAP API
queryMore()call. -
Create a PackagePushRequest object. Specify the
PackageVersionIdandScheduledStartTime(optional). If you omit theScheduledStartTime, the push begins when you set the PackagePushRequest’s status toPending. -
Create a PackagePushJob for each subscriber and associate it with the
PackagePushRequestyou created in the previous step. -
Schedule the push upgrade by changing the status of the
PackagePushRequesttoPending.
Scheduled push upgrades begin as soon as resources are available on the Salesforce instance, which is either at or after the start time you specify. In certain scenarios, the push upgrade could start a few hours after the scheduled start time.