younifyd
Menu

Drive.files.modify Labels

Modifies the set of labels on a file.

POST/files/{fileId}/modifyLabels

Use it in a workflow

  1. Add a step and choose the Google Drive connector.
  2. Pick the Drive.files.modify Labels action (under files).
  3. Fill in the fields below, then reference the result from later steps as {{driveFilesModifyLabels.response.data}}.

Request

Path parameters

fileIdstringrequired

The ID of the file for which the labels are modified.

Query parameters

altstring

Data format for the response.

One ofjson

fieldsstring

Selector specifying which fields to include in a partial response.

keystring

API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.

oauth_tokenstring

OAuth 2.0 token for the current user.

prettyPrintboolean

Returns response with indentations and line breaks.

quotaUserstring

An opaque string that represents a user for quota purposes. Must not exceed 40 characters.

userIpstring

Deprecated. Please use quotaUser instead.

Request body

Enter the body as JSON in the step's Body field.

kindstring

This is always drive#modifyLabelsRequest

Default "drive#modifyLabelsRequest"

labelModificationsarray<object>

The list of modifications to apply to the labels on the file.

fieldModificationsarray<object>8 fields

The list of modifications to this label's fields.

kindstring

This is always drive#labelModification.

Default "drive#labelModification"

labelIdstring

The ID of the label to modify.

removeLabelboolean

If true, the label will be removed from the file.

json
{
  "kind": "drive#modifyLabelsRequest",
  "labelModifications": [
    {
      "fieldModifications": [
        {
          "fieldId": "string",
          "kind": "drive#labelFieldModification",
          "setDateValues": [
            "2025-01-01"
          ],
          "setIntegerValues": [
            "string"
          ],
          "setSelectionValues": [
            "string"
          ],
          "setTextValues": [
            "string"
          ],
          "setUserValues": [
            "string"
          ],
          "unsetValues": false
        }
      ],
      "kind": "drive#labelModification",
      "labelId": "string",
      "removeLabel": false
    }
  ]
}

Response

Returns 200 with an object. Read it in later steps with {{driveFilesModifyLabels.response.data.<field>}}.

kindstring

This is always drive#modifyLabelsResponse

Default "drive#modifyLabelsResponse"

modifiedLabelsarray<object>

The list of labels which were added or updated by the request.

fieldsobject

A map of the label's fields keyed by the field ID.

idstring

The ID of the label.

kindstring

This is always drive#label

Default "drive#label"

revisionIdstring

The revision ID of the label.

json
{
  "kind": "drive#modifyLabelsResponse",
  "modifiedLabels": [
    {
      "fields": {},
      "id": "string",
      "kind": "drive#label",
      "revisionId": "string"
    }
  ]
}

Need more? See the Google Drive guide for connection setup and behaviour shared by every action.