Single-parenting behavior changes

Stay organized with collections Save and categorize content based on your preferences.

Beginning Sept. 30, 2020, you will no longer be able to place a file in multiple parent folders; every file must have exactly one parent folder location. Following is a summary of behavior changes related to the Drive API's new single-parent model.

  • Requests that temporarily orphan a file or attempt to place a file in multiple parent folders now fail. For example, in v2 of the API, you cannot move files by using the combinations of parents.delete() and parents.insert() or children.delete() and children.insert().

  • You can only add a parent folder to a file that doesn't have one. Use canAddMyDriveParent on files.get() or files.list() to see if a parent can be added and if the user user has the access to add the file. This change affects:

    • files.update()
    • children.insert() (v2)
    • parents.insert() (v2).
  • You can only create files in one parent folder. To duplicate a file within other parent folders, use shortcuts. This change affects:

    • files.create() (v3)
    • files.insert() (v2)
    • files.copy()
  • You can only move a file if the current user has share access to the file. Use canMoveItemWithinDrive on files.get() or files.list() to see if the user can move a file. If a user doesn't have share access to a file, you can create a shortcut to the file. This change affects files.update().

  • When you use files.update() to add a new parent folder to a file:

    • If the file already has one or more parents (due to the old multi-parenting model), and you are the file's owner, the file is added to the new single parent folder and removed from any current parent folders.

    • If the file already has one or more parents (due to the old multi-parenting model), and you aren't the file's owner, the call fails.

  • When you use files.update to move a file from one parent folder to another, and the file already has one or more parents (due to the old multi-parenting model):

    • the file is moved to the new parent folder location.
    • the existing parent folder(s), identified in the files.update() removeParent field, are removed.
    • any existing parent folder(s), not identified in the files.update() removeParent field, are preserved.
  • If an operation results in a file without a parent, the file is placed under its owner’s My Drive. This change affects:

    • files.delete()
    • files.emptyTrash()
    • files.update()
    • children.delete() (v2)
    • parents.delete() (v2)
  • When transferring ownership of a file, the requester can control whether the transferred file is moved to the new owner’s My Drive or kept in its current location. If the requester chooses to move the file, any access inherited from the previous parent is lost. However, the access that had been directly added to the file is preserved. The previous owner maintains editor access on the file, just as they had prior to these changes. This change affects:

    • permissions.create (v3)
    • permissions.insert (v2) .
  • The enforceSingleParent field allows you to develop and test apps with the new single parent model. Using this field also ensures you don't have to make further changes to your app when single parenting becomes the enforced behavior. Set enforceSingleParent to true on any requests to modify a file (create, move, add a parent folder) you make to the Drive API.