provider files POST /files/{fileId}/copy
@utdk/google/drive /files/{fileId}/copy
files.copy
Creates a copy of a file and applies any requested updates with patch semantics.
$.xgafv query
V1 error format.
enum: 1, 2
access_token query
OAuth access token.
string
alt query
Data format for response.
enum: json, media, proto
callback query
JSONP
string
fields query
Selector specifying which fields to include in a partial response.
string
key query
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.
string
oauth_token query
OAuth 2.0 token for the current user.
string
prettyPrint query
Returns response with indentations and line breaks.
boolean
quotaUser query
Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.
string
upload_protocol query
Upload protocol for media (e.g. "raw", "multipart").
string
uploadType query
Legacy upload protocol for media (e.g. "media", "multipart").
string
fileId path required
The ID of the file.
string
enforceSingleParent query
Deprecated. Copying files into multiple folders is no longer supported. Use shortcuts instead.
boolean
ignoreDefaultVisibility query
Whether to ignore the domain's default visibility settings for the created file. Domain administrators can choose to make all uploaded files visible to the domain by default; this parameter bypasses that behavior for the request. Permissions are still inherited from parent folders.
boolean
includeLabels query
A comma-separated list of IDs of labels to include in the `labelInfo` part of the response.
string
includePermissionsForView query
Specifies which additional view's permissions to include in the response. Only 'published' is supported.
string
keepRevisionForever query
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.
boolean
ocrLanguage query
A language hint for OCR processing during image import (ISO 639-1 code).
string
supportsAllDrives query
Whether the requesting application supports both My Drives and shared drives.
boolean
supportsTeamDrives query
Deprecated: Use `supportsAllDrives` instead.
boolean

Try it

Authentication
Configure credentials for Google Drive API
Gateway
The gateway proxies requests and injects credentials server-side. Configure credentials above, then enter your gateway URL.

Saved automatically to browser storage.

filesCopy
POST/files/{fileId}/copy
Creates a copy of a file and applies any requested updates with patch semantics.

Parameters

required

The ID of the file.

V1 error format.

OAuth access token.

Data format for response.

JSONP

Selector specifying which fields to include in a partial response.

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 2.0 token for the current user.

Returns response with indentations and line breaks.

Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.

Upload protocol for media (e.g. "raw", "multipart").

Legacy upload protocol for media (e.g. "media", "multipart").

Deprecated. Copying files into multiple folders is no longer supported. Use shortcuts instead.

Whether to ignore the domain's default visibility settings for the created file. Domain administrators can choose to make all uploaded files visible to the domain by default; this parameter bypasses that behavior for the request. Permissions are still inherited from parent folders.

A comma-separated list of IDs of labels to include in the `labelInfo` part of the response.

Specifies which additional view's permissions to include in the response. Only 'published' is supported.

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.

A language hint for OCR processing during image import (ISO 639-1 code).

Whether the requesting application supports both My Drives and shared drives.

Deprecated: Use `supportsAllDrives` instead.

Input

A collection of arbitrary key-value pairs which are private to the requesting app. Entries with null values are cleared in update and copy requests. These properties can only be retrieved using an authenticated request. An authenticated request uses an access token obtained with a OAuth 2 client ID. You cannot use an API key to retrieve private properties.

Output only. Capabilities the current user has on this file. Each capability corresponds to a fine-grained action that a user may take.

Additional information about the content of the file. These fields are never populated in responses.

Restrictions for accessing the content of the file. Only populated if such a restriction exists.

Whether the options to copy, print, or download this file, should be disabled for readers and commenters.

The time at which the file was created (RFC 3339 date-time).

A short description of the file.

Output only. ID of the shared drive the file resides in. Only populated for items in shared drives.

Output only. Whether the file has been explicitly trashed, as opposed to recursively trashed from a parent folder.

Output only. Links for exporting Docs Editors files to specific formats.

Output only. The final component of `fullFileExtension`. This is only available for files with binary content in Google Drive.

The color for a folder or a shortcut to a folder as an RGB hex string. The supported colors are published in the `folderColorPalette` field of the About resource. If an unsupported color is specified, the closest color in the palette is used instead.

Output only. The full file extension extracted from the `name` field. May contain multiple concatenated extensions, such as "tar.gz". This is only available for files with binary content in Google Drive. This is automatically updated when the `name` field changes, however it is not cleared if the new name does not contain a valid extension.

Output only. Whether there are permissions directly on this file. This field is only populated for items in shared drives.

Output only. Whether this file has a thumbnail. This does not indicate whether the requesting app has access to the thumbnail. To check access, look for the presence of the thumbnailLink field.

Output only. The ID of the file's head revision. This is currently only available for files with binary content in Google Drive.

Output only. A static, unauthenticated link to the file's icon.

The ID of the file.

Output only. Additional metadata about image media, if available.

Output only. Whether the file was created or opened by the requesting app.

Output only. Identifies what kind of resource this is. Value: the fixed string `"drive#file"`.

Output only. An overview of the labels on the file.

Information about a Drive user.

Contains details about the link URLs that clients are using to refer to this item.

Output only. The MD5 checksum for the content of the file. This is only applicable to files with binary content in Google Drive.

The MIME type of the file. Google Drive attempts to automatically detect an appropriate value from uploaded content, if no value is provided. The value cannot be changed unless a new revision is uploaded. If a file is created with a Google Doc MIME type, the uploaded content is imported, if possible. The supported import formats are published in the About resource.

Output only. Whether the file has been modified by this user.

The last time the file was modified by the user (RFC 3339 date-time).

he last time the file was modified by anyone (RFC 3339 date-time). Note that setting modifiedTime will also update modifiedByMeTime for the user.

The name of the file. This is not necessarily unique within a folder. Note that for immutable items such as the top level folders of shared drives, My Drive root folder, and Application Data folder the name is constant.

The original filename of the uploaded content if available, or else the original value of the `name` field. This is only available for files with binary content in Google Drive.

Output only. Whether the user owns the file. Not populated for items in shared drives.

Output only. The owner of this file. Only certain legacy files may have more than one owner. This field isn't populated for items in shared drives.

The IDs of the parent folders which contain the file. If not specified as part of a create request, the file is placed directly in the user's My Drive folder. If not specified as part of a copy request, the file inherits any discoverable parents of the source file. Update requests must use the `addParents` and `removeParents` parameters to modify the parents list.

Output only. List of permission IDs for users with access to this file.

Output only. The full list of permissions for the file. This is only available if the requesting user can share the file. Not populated for items in shared drives.

A collection of arbitrary key-value pairs which are visible to all apps. Entries with null values are cleared in update and copy requests.

Output only. The number of storage quota bytes used by the file. This includes the head revision as well as previous revisions with `keepForever` enabled.

Output only. A key needed to access the item via a shared link.

Output only. The SHA1 checksum associated with this file, if available. This field is only populated for files with content stored in Google Drive; it is not populated for Docs Editors or shortcut files.

Output only. The SHA256 checksum associated with this file, if available. This field is only populated for files with content stored in Google Drive; it is not populated for Docs Editors or shortcut files.

Output only. Whether the file has been shared. Not populated for items in shared drives.

The time at which the file was shared with the user, if applicable (RFC 3339 date-time).

Information about a Drive user.

Shortcut file details. Only populated for shortcut files, which have the mimeType field set to `application/vnd.google-apps.shortcut`.

Output only. Size in bytes of blobs and first party editor files. Won't be populated for files that have no size, like shortcuts and folders.

Output only. The list of spaces which contain the file. The currently supported values are 'drive', 'appDataFolder' and 'photos'.

Whether the user has starred the file.

Deprecated: Output only. Use `driveId` instead.

Output only. A short-lived link to the file's thumbnail, if available. Typically lasts on the order of hours. Only populated when the requesting app can access the file's content. If the file isn't shared publicly, the URL returned in `Files.thumbnailLink` must be fetched using a credentialed request.

Output only. The thumbnail version for use in thumbnail cache invalidation.

Whether the file has been trashed, either explicitly or from a trashed parent folder. Only the owner may trash a file, and other users cannot see files in the owner's trash.

The time that the item was trashed (RFC 3339 date-time). Only populated for items in shared drives.

Information about a Drive user.

Output only. A monotonically increasing version number for the file. This reflects every change made to the file on the server, even those not visible to the user.

Output only. Additional metadata about video media. This may not be available immediately upon upload.

Output only. Whether the file has been viewed by this user.

The last time the file was viewed by the user (RFC 3339 date-time).

Deprecated: Use `copyRequiresWriterPermission` instead.

Output only. A link for downloading the content of the file in a browser. This is only available for files with binary content in Google Drive.

Output only. A link for opening the file in a relevant Google editor or viewer in a browser.

Whether users with only `writer` permission can modify the file's permissions. Not populated for items in shared drives.

Enter a gateway URL above to enable sending.

Code snippet
Updates live as you fill in the form above.

TypeScript

import google_drive from '@utdk/google/drive';

await google_drive.filesCopy({
  "kind": "drive#file"
})