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.
For code samples and more detailed steps, see SOAP API object documentation linked in each step.
  1. Authenticate to your Dev Hub org.
  2. Query MetadataPackage to verify package details.
  3. Query MetadataPackageVersion to verify the package version to use for the push upgrade.
  4. 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.
  5. Create a PackagePushRequest object. Specify the PackageVersionId and ScheduledStartTime (optional). If you omit the ScheduledStartTime, the push begins when you set the PackagePushRequest's status to Pending.
  6. Create a PackagePushJob for each subscriber and associate it with the PackagePushRequest you created in the previous step.
  7. Schedule the push upgrade by changing the status of the PackagePushRequest to Pending.

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.

Note