Remove a label from a file

This page describes how to remove a label on a single Google Drive file. To remove the file label metadata from a file, use the files.modifyLabels method.

You also need to specify:

  • The labelId of the label to modify.

  • The fileId of the file for which the labels are modified.

This example uses the labelId to remove all fields associated with the label using the fileId. To locate the labels on a file, use the files.listLabels method.


ModifyLabelsRequest modifyLabelsRequest =
  new ModifyLabelsRequest()
              new LabelModification()

ModifyLabelsResponse modifyLabelsResponse = driveService.files().modifyLabels("FILE_ID", modifyLabelsRequest).execute();


label_modification = {'labelId':'LABEL_ID', 'removeLabel': True]}

modified_labels = drive_service.files().modifyLabels(fileId="FILE_ID", body = {'labelModifications' : [label_modification]});


* Remove a label on a Drive file
* @return{obj} updated label data
async function modifyLabelTextField() {
  // Get credentials and build service
  // TODO (developer) - Use appropriate auth mechanism for your app

  const {GoogleAuth} = require('google-auth-library');
  const {google} = require('googleapis');

  const auth = new GoogleAuth({scopes: ''});
  const service ={version: 'v3', auth});
  const labelModification = {
    'labelId': 'LABEL_ID',
    'removeLabel': True,
  const labelModificationRequest = {
    'labelModifications': [labelModification],
  try {
    const updateResponse = await service.files.modifyLabels({
      fileId: 'FILE_ID',
      resource: labelModificationRequest,
    return updateResponse;
  } catch (err) {
    // TODO (developer) - Handle error
    throw err;