---
title: "POST /files/{fileId}/modifyLabels"
method: POST
path: "/files/{fileId}/modifyLabels"
tags: ["files"]
---

# POST /files/{fileId}/modifyLabels

`POST /files/{fileId}/modifyLabels`

Modifies the set of labels applied to a file. For more information, see [Set a label field on a file](https://developers.google.com/workspace/drive/api/guides/set-label). Returns a list of the labels that were added or modified.

## Path parameters

- `fileId` string, required

## Request body

- ModifyLabelsRequest — A request to modify the set of labels on a file. This request may contain many modifications that will either all succeed or all fail atomically.
  - `labelModifications` LabelModification[] — The list of modifications to apply to the labels on the file.
    - `removeLabel` boolean — If true, the label will be removed from the file.
    - `kind` string — This is always `"drive#labelModification"`.
    - `labelId` string — The ID of the label to modify.
    - `fieldModifications` LabelFieldModification[] — The list of modifications to this label's fields.
      - `kind` string — This is always `"drive#labelFieldModification"`.
      - `fieldId` string — The ID of the field to be modified.
      - `setSelectionValues` string[] — Replaces a `selection` field with these new values.
      - `unsetValues` boolean — Unsets the values for this field.
      - `setIntegerValues` string[] — Replaces the value of an `integer` field with these new values.
      - `setDateValues` string[] — Replaces the value of a dateString Field with these new values. The string must be in the RFC 3339 full-date format: YYYY-MM-DD.
      - `setTextValues` string[] — Sets the value of a `text` field.
      - `setUserValues` string[] — Replaces a `user` field with these new values. The values must be a valid email addresses.
  - `kind` string — This is always `"drive#modifyLabelsRequest"`.

## Response `200`

Successful response

---

[API](https://skmtc.dev/google/apis/drive.md) · [All operations](https://skmtc.dev/google/apis/drive/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/google/drive/revisions/f3444ff3fae2/schema)
