Skip to content

Google: Updates a file's metadata, content, or both When calling this method, only populate fields in the request that you want to modify When updating fields, some fields might be changed automatically, such as `modified Date` This method supports patch semantics This method supports an * upload* URI and accepts uploaded media with the following characteristics: - *Maximum file size:* 5,120 GB - *Accepted Media MIME types:* `* *` (Specify a valid MIME type, rather than the literal `* *` value The literal `* *` is only used to indicate that any valid MIME type can be uploaded For more information, see Google Workspace and Google Drive supported MIME types (https: developers google com workspace drive api guides mime-types) ) For more information on uploading files, see Upload file data (https: developers google com workspace drive api guides manage-uploads) — request body — query

Updates a file's metadata, content, or both. When calling this method, only populate fields in the request that you want to modify. When updating fields, some fields might be changed automatically, such as `modifiedDate`. This method supports patch semantics. This method supports an */upload* URI and accepts uploaded media with the following characteristics: - *Maximum file size:* 5,120 GB - *Accepted Media MIME types:* `*/*` (Specify a valid MIME type, rather than the literal `*/*` value. The literal `*/*` is only used to indicate that any valid MIME type can be uploaded. For more information, see [Google Workspace and Google Drive supported MIME types](https://developers.google.com/workspace/drive/api/guides/mime-types).) For more information on uploading files, see [Upload file data](https://developers.google.com/workspace/drive/api/guides/manage-uploads).: request body, field query. Complete fields and constraints for contract 2026-10-27.

API reference · Contract 2026-10-27

SDK schema: Updates a file's metadata, content, or both. When calling this method, only populate fields in the request that you want to modify. When updating fields, some fields might be changed automatically, such as `modifiedDate`. This method supports patch semantics. This method supports an */upload* URI and accepts uploaded media with the following characteristics: - *Maximum file size:* 5,120 GB - *Accepted Media MIME types:* `* *` (Specify a valid MIME type, rather than the literal `* *` value The literal `* *` is only used to indicate that any valid MIME type can be uploaded For more information, see Google Workspace and Google Drive supported MIME types (https: developers google com workspace drive api guides mime-types) ) For more information on uploading files, see Upload file data (https: developers google com workspace drive api guides manage-uploads) — request body — query

FieldTypePresenceDescription and constraints
$objectRootAdditional keys: not allowed
fieldsstringOptionalSelector specifying which fields to include in a partial response.
prettyPrintbooleanOptionalReturns response with indentations and line breaks.
Default: true
quotaUserstringOptionalAvailable to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.
addParentsstringOptionalA comma-separated list of parent IDs to add.
enforceSingleParentbooleanOptionalDeprecated: Adding files to multiple folders is no longer supported. Use shortcuts instead.
Default: false
includeLabelsstringOptionalA comma-separated list of IDs of labels to include in the `labelInfo` part of the response.
includePermissionsForViewstringOptionalSpecifies which additional view’s permissions to include in the response. Only `published` is supported.
keepRevisionForeverbooleanOptionalWhether 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.
Default: false
ocrLanguagestringOptionalA language hint for OCR processing during image import (ISO 639-1 code).
removeParentsstringOptionalA comma-separated list of parent IDs to remove.
supportsAllDrivesbooleanOptionalWhether the requesting application supports both My Drives and shared drives.
Default: false
supportsTeamDrivesbooleanOptionalDeprecated: Use `supportsAllDrives` instead.
Default: false
useContentAsIndexableTextbooleanOptionalWhether to use the uploaded content as indexable text.
Default: false

Report an issue with this page

Necessary

Required for sign-in, security, authorization, and remembering your choices.

Always active

Analytics

Helps us understand which product and documentation features are useful.

Performance diagnostics

Uses performance tracing and privacy-masked session replay to diagnose problems.

You can change these choices at any time from Cookie settings.