Add custom file properties

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

Custom file properties are key/value pairs used to store custom metadata for a file, such as tags, IDs from other data stores, information shared between workflow applications, and so on.

To add properties visible to all apps, use the properties field of files resource. To add properties restricted to your app, use the appProperties field on files resource.

Properties can also be used in search expressions.

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.

Drive API v3

"appProperties": {
  "additionalID": "8e8aceg2af2ge72e78",

Drive API v2

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

Custom properties have the following 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.

For more information, refer to the files resource.

Access custom file properties

These properties can only be retrieved using an authenticated request. An authenticated request uses an access token obtained with a OAuth 2 client ID. You cannot use an API key to retrieve private properties.