Hide

Custom File Properties

You can use Drive API to add your own properties to a Drive file. These properties are stored as key/value pairs on the Drive file. Properties may be PUBLIC so all apps can see them, or PRIVATE so only the app that creates the property can see it.

Using properties will allow your app to store additional metadata on a file, such as tags, IDs from other data stores, viewing preferences etc. Public properties can be used to share metadata between applications, for example, in a workflow application.

This is the structure of a typical property that might be used to store your database's ID for a Drive file on the file itself.

{
  'key':        'additionalID',
  'value':      '8e8aceg2af2ge72e78',
  'visibility': 'PRIVATE'
}

Custom properties have the following usage limits:

  • Maximum of 100 custom properties per file, totaled from all sources.
  • Maximum of 30 PUBLIC properties per file, totaled from all sources.
  • Maximum of 30 PRIVATE properties per file from any one application.
  • Maximum of 124 bytes size per property (including both key and value) string in UTF-8 encoding. For example, a property with a key that is ten characters long can only have 114 characters in the value. A property that requires 100 characters for the value can use up to 24 characters for the key.
  • Writing a file property has the same performance implications as other write operations.

Properties are accessed using the drive.properties resource, and can be created, fetched, updated, deleted, listed, and searched. For more information and examples, see drive.properties in the reference documentation.

Send feedback about...

Drive REST API