Method: spreadsheets.sheets.copyTo
Copies a single sheet from a spreadsheet to another spreadsheet. Returns the properties of the newly created sheet.
HTTP request
POST https://sheets.googleapis.com/v4/spreadsheets/{spreadsheetId}/sheets/{sheetId}:copyTo
The URL uses gRPC Transcoding syntax.
Path parameters
Parameters |
spreadsheetId |
string
The ID of the spreadsheet containing the sheet to copy.
|
sheetId |
integer
The ID of the sheet to copy.
|
Request body
The request body contains data with the following structure:
JSON representation |
{
"destinationSpreadsheetId": string
} |
Fields |
destinationSpreadsheetId |
string
The ID of the spreadsheet to copy the sheet to.
|
Response body
If successful, the response body contains an instance of SheetProperties
.
Authorization scopes
Requires one of the following OAuth scopes:
https://www.googleapis.com/auth/drive
https://www.googleapis.com/auth/drive.file
https://www.googleapis.com/auth/spreadsheets
For more information, see the Authorization guide.
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2024-09-04 UTC.
[null,null,["Last updated 2024-09-04 UTC."],[[["Copies a single sheet from one Google Spreadsheet to another, returning the properties of the new sheet."],["Requires specifying the source spreadsheet and sheet IDs, along with the destination spreadsheet ID."],["Utilizes an HTTP POST request to `https://sheets.googleapis.com/v4/spreadsheets/{spreadsheetId}/sheets/{sheetId}:copyTo`."],["Needs authorization with specific OAuth scopes like `https://www.googleapis.com/auth/drive` or `https://www.googleapis.com/auth/spreadsheets`."]]],["This content describes how to copy a sheet from one spreadsheet to another using an HTTP POST request to the Google Sheets API. The request URL requires the source `spreadsheetId` and `sheetId`. The request body needs a `destinationSpreadsheetId`. Upon success, the API returns the new sheet's properties. Authorization requires one of three specific OAuth scopes: `drive`, `drive.file`, or `spreadsheets`. The `try it!` section is a resource to help understand how the API works.\n"]]