# Edits

The Google Play Developer Publishing API [Edits methods](https://developers.google.com/android-publisher/api-ref/rest/v3/edits#METHODS_SUMMARY)
allow you to prepare a number of
changes to your Google Play app, then deploy them all at once. You do
this by creating an **edit**, which holds all the changes you want to
make to the app. The edit holds such information as:

- Which APKs are associated with the app, and a "track" for each APK.

  Each is associated with a "track", determining which users see
  it. This allows you to provide alpha and beta versions of the app
  for your testers. In addition, you can provide a limited-release
  "staged rollout" version of the app; this app is automatically
  served to a limited number of the app's users (determined by the
  rollout percentage you set), allowing you to deploy a new
  production version of the app gradually.
- Language and locale-specific versions of the app's Google Play
  Store listing

  Each locale-specific version of the store listing can contain
  screenshots and other promotional graphics, localized descriptive
  text, and so on.

> [!NOTE]
> **Note:** Not all the methods provided by the Google Play Developer API use the new, transactional "edits" functionality. Methods for the [inappproducts](https://developers.google.com/android-publisher/api-ref/rest/v3/inappproducts), [products](https://developers.google.com/android-publisher/api-ref/rest/v3/purchases.products), and [subscriptions](https://developers.google.com/android-publisher/api-ref/rest/v3/purchases.subscriptions) resources take effect immediately, whether or not there is an open edit for the app. Each resource's API reference page notes specifically whether the methods for that resource use the "edits" model.

When you first create an edit, the edit is a copy of the current
deployed state of the app. You can then modify the edit by calling the
Edits methods. When the edit is ready to go, you commit it,
making the changes live. You can also abandon the edit at any time,
discarding the changes and leaving your app as it was.

You can only use this API to make changes to an *existing* app (that
has at least one APK uploaded); thus, you will have to upload at least
one APK through the Play Console before you can use this
API. Furthermore, you cannot use this API to change an app's state
from "published" to "unpublished", or to fill out the legal consents
required for publishing. To publish the app, you have to use the
Play Console.

> [!CAUTION]
> **Caution:** If anyone makes any changes to the app through the Google Play Console while you have an edit in progress, your edit is discarded and the Play Console changes take effect.

## Workflow

This section shows the typical way you would use the Google Play Developer Publishing API
[Edits methods](https://developers.google.com/android-publisher/api-ref/rest/v3/edits#METHODS_SUMMARY) to make modifications to an app.

1. Create a new edit, by calling [Edits:
   Insert](https://developers.google.com/android-publisher/api-ref/rest/v3/edits/insert) and specifying the app you want
   to modify.

   This creates a new edit of the specified app. The app's initial
   settings--the APKs, store listings, expansion files, and so on--are all
   copied from the deployed version of the app.
2. Modify the edit as desired.

   You can make most of the changes which could be made through the
   Google Play Console. You do this by calling the
   appropriate Google Play Developer API method, and passing the IDs of the app
   and edit you want to modify. Specifically:
   - You can upload new APKs by calling [Edits.apks:
     upload](https://developers.google.com/android-publisher/api-ref/rest/v3/edits.apks/upload). This puts the APK in a storage area, so it can be assigned to a track in this or a subsequent edit.
   - You can assign APKs to tracks by calling [Edits.tracks:
     update](https://developers.google.com/android-publisher/api-ref/rest/v3/edits.tracks/update). You can also change the track assignments for existing APKs by calling [Edits.tracks:
     patch](https://developers.google.com/android-publisher/api-ref/rest/v3/edits.tracks/patch).
   - You can create a new localized store listing by calling [Edits.listings:
     update](https://developers.google.com/android-publisher/api-ref/rest/v3/edits.listings/update). You can modify an existing store listing by calling [Edits.listings: patch](https://developers.google.com/android-publisher/api-ref/rest/v3/edits.listings/patch).
   - You can add or modify expansion files by calling the [Edits.expansionfiles resource](https://developers.google.com/android-publisher/api-ref/rest/v3/edits.expansionfiles) methods.

   These methods make changes to the edit you have in progress, but
   they do *not* modify the live version of the app. You can make
   further changes or discard the edit in progress without affecting
   the user experience.

   > [!NOTE]
   > **Note:** Each user may have only a single edit open at a time. If you create a new edit, any existing edit you may have open is invalidated. In addition, if anyone commits an edit or makes changes to an app through the Play Console, *all* other edits for the app (owned by any user) are invalidated. If you try to commit an invalid edit, the operation will throw an exception and have no effect.

3. Commit the edit.

   When you call [Edits: commit](https://developers.google.com/android-publisher/api-ref/rest/v3/edits/commit), if there
   are no validation errors, then all the changes specified in the
   edits resource go "live", replacing the current state of the
   app. These changes can take several hours to take effect, just as
   when you make changes through the Play Console.