> ## Documentation Index
> Fetch the complete documentation index at: https://docs.r28.ai/charter/llms.txt
> Use this file to discover all available pages before exploring further.

# files_update

> Change part of a file's metadata. Send only the fields being changed; the rest keep their stored values. To trash a file, set `trashed` to true. To move a file, use `addParents` and `removeParents` rather than `parents`.

<div className="tool-route"><span className="tool-row-method" data-method="PATCH">PATCH</span><code>{"https://www.googleapis.com/drive/v3/files/{fileId}"}</code></div>

```python gdrive_files_update.py theme={null}
from charter.packs import gdrive

result = await gdrive.files_update.ainvoke({"fileId": ..., "file": ...})
```

<Note>
  Requires `https://www.googleapis.com/auth/drive`. Costs 1 against the provider's own quota.
</Note>

## Path parameters

<div className="reference-table">
  | Field                                                          | Type     | Description         |
  | -------------------------------------------------------------- | -------- | ------------------- |
  | `fileId` <span className="required" title="required">\*</span> | `string` | The ID of the file. |
</div>

## Query parameters

<div className="reference-table">
  | Field                       | Type      | Description                                                                                                                                                                                                                                         |
  | --------------------------- | --------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
  | `addParents`                | `string`  | A comma-separated list of parent IDs to add.                                                                                                                                                                                                        |
  | `removeParents`             | `string`  | A comma-separated list of parent IDs to remove.                                                                                                                                                                                                     |
  | `keepRevisionForever`       | `boolean` | Whether to set the `keepForever` field in the new head revision. This is only applicable to files with binary content in Google Drive. Only 200 revisions for the file can be kept forever. If the limit is reached, try deleting pinned revisions. |
  | `ocrLanguage`               | `string`  | A language hint for OCR processing during image import (ISO 639-1 code).                                                                                                                                                                            |
  | `useContentAsIndexableText` | `boolean` | Whether to use the uploaded content as indexable text.                                                                                                                                                                                              |
  | `includePermissionsForView` | `string`  | Specifies which additional view's permissions to include in the response. Only `published` is supported.                                                                                                                                            |
  | `includeLabels`             | `string`  | A comma-separated list of IDs of labels to include in the `labelInfo` part of the response.                                                                                                                                                         |
  | `supportsAllDrives`         | `boolean` | Whether the requesting application supports both My Drives and shared drives.                                                                                                                                                                       |
</div>

## Body

<div className="reference-table">
  | Field                                                        | Type                                             | Description                                                                                                                                                                |
  | ------------------------------------------------------------ | ------------------------------------------------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
  | `file` <span className="required" title="required">\*</span> | [File](/charter/charter/packs/gdrive/files/objects#file) | The file resource. Only populate fields you want to modify; the rest keep their stored values. To move a file, use `addParents` and `removeParents` rather than `parents`. |
</div>
