Labels overview (original) (raw)

Labels overview

Labels are metadata that you define to help users organize, find, and apply policy to files in Google Drive. The Drive API allows developers to apply labels to files and folders, set label field values, read labels and field values on files, and search for files using metadata terms defined by the custom label taxonomy.

Drive labels can support business processes by attaching metadata to files and folders. Common uses for labels are:

Below is a list of common terms used by Drive labels:

Label

Structured metadata placed on a Drive file. Drive users can assign labels and set label field values for files. Labels are composed of:

Label name

The resource name of the label. The label ID is part of the Label name. Depending on the request, the name is in the form of either:labels/{id} or labels/{id}@{revisionId}. For more information, seeLabel revision below.

Label ID

A globally unique identifier for the label. The ID is part of the label name, but unlike the name, it's consistent between revisions.

Field

An individual typed, settable component of a label. A label can have zero or more fields associated with it. Selection and user fields can be set with multiple values if the field is configured withListOptions in theGoogle Drive Labels API.

Field type

The data type of the value associated with the field. Configurable as integer, dateString, text, user, or selection. The type chosen impacts both the valid values applicable to Drive items and the search query options available.

Label taxonomy

The configured label fields available to users for application to Drive files. Readable and writable through the Drive Labels API. Also known as the label schema.

Label revision

An instance of the label. Anytime a label is created, updated, published, or deprecated, the label revision increments.

Draft revision

The revision number of the current draft instance of the label. You can make several updates to a label, each incrementing its draft revision number, without affecting the published revision. The ability to have draft labels lets you test label updates before publishing.

Published revision

The revision number of the published version of a label. The published label is the instance of the label available to users.

Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.

Last updated 2025-12-03 UTC.