Google Sheets API
  1. spreadsheets
Google Sheets API
  • spreadsheets
    • /v4/spreadsheets
      POST
    • /v4/spreadsheets/{spreadsheetId}
      GET
    • /v4/spreadsheets/{spreadsheetId}/developerMetadata/{metadataId}
      GET
    • /v4/spreadsheets/{spreadsheetId}/developerMetadata:search
      POST
    • /v4/spreadsheets/{spreadsheetId}/sheets/{sheetId}:copyTo
      POST
    • /v4/spreadsheets/{spreadsheetId}/values/{range}
      GET
    • /v4/spreadsheets/{spreadsheetId}/values/{range}
      PUT
    • /v4/spreadsheets/{spreadsheetId}/values/{range}:append
      POST
    • /v4/spreadsheets/{spreadsheetId}/values/{range}:clear
      POST
    • /v4/spreadsheets/{spreadsheetId}/values:batchClear
      POST
    • /v4/spreadsheets/{spreadsheetId}/values:batchClearByDataFilter
      POST
    • /v4/spreadsheets/{spreadsheetId}/values:batchGet
      GET
    • /v4/spreadsheets/{spreadsheetId}/values:batchGetByDataFilter
      POST
    • /v4/spreadsheets/{spreadsheetId}/values:batchUpdate
      POST
    • /v4/spreadsheets/{spreadsheetId}/values:batchUpdateByDataFilter
      POST
    • /v4/spreadsheets/{spreadsheetId}:batchUpdate
      POST
    • /v4/spreadsheets/{spreadsheetId}:getByDataFilter
      POST
  1. spreadsheets

/v4/spreadsheets/{spreadsheetId}/sheets/{sheetId}:copyTo

POST
/v4/spreadsheets/{spreadsheetId}/sheets/{sheetId}:copyTo
spreadsheets
Copies a single sheet from a spreadsheet to another spreadsheet. Returns the properties of the newly created sheet.
Request Request Example
Shell
JavaScript
Java
Swift
curl --location --request POST 'https://sheets.googleapis.com//v4/spreadsheets//sheets/:copyTo' \
--header 'Content-Type: application/json' \
--data-raw '{
    "destinationSpreadsheetId": "string"
}'
Response Response Example
{
    "dataSourceSheetProperties": {
        "columns": [
            {
                "formula": "string",
                "reference": {
                    "name": "string"
                }
            }
        ],
        "dataExecutionStatus": {},
        "dataSourceId": "string"
    },
    "gridProperties": {
        "columnCount": 0,
        "columnGroupControlAfter": true,
        "frozenColumnCount": 0,
        "frozenRowCount": 0,
        "hideGridlines": true,
        "rowCount": 0,
        "rowGroupControlAfter": true
    },
    "hidden": true,
    "index": 0,
    "rightToLeft": true,
    "sheetId": 0,
    "sheetType": "SHEET_TYPE_UNSPECIFIED",
    "tabColor": {},
    "tabColorStyle": {
        "rgbColor": {},
        "themeColor": "THEME_COLOR_TYPE_UNSPECIFIED"
    },
    "title": "string"
}

Request

Path Params
spreadsheetId
string 
required
The ID of the spreadsheet containing the sheet to copy.
sheetId
integer 
required
The ID of the sheet to copy.
Body Params application/json
The request to copy a sheet across spreadsheets.
destinationSpreadsheetId
string 
optional
The ID of the spreadsheet to copy the sheet to.
Examples

Responses

🟢200Successful response
application/json
Body
Properties of a sheet.
dataSourceSheetProperties
object (DataSourceSheetProperties) 
optional
Output only. If present, the field contains DATA_SOURCE sheet specific properties.
columns
array[object (DataSourceColumn) {2}] 
optional
The columns displayed on the sheet, corresponding to the values in RowData.
dataExecutionStatus
object 
optional
dataSourceId
string 
optional
ID of the DataSource the sheet is connected to.
gridProperties
object (GridProperties) 
optional
Additional properties of the sheet if this sheet is a grid. (If the sheet is an object sheet, containing a chart or image, then this field will be absent.) When writing it is an error to set any grid properties on non-grid sheets. If this sheet is a DATA_SOURCE sheet, this field is output only but contains the properties that reflect how a data source sheet is rendered in the UI, e.g. row_count.
columnCount
integer <int32>
optional
The number of columns in the grid.
columnGroupControlAfter
boolean 
optional
True if the column grouping control toggle is shown after the group.
frozenColumnCount
integer <int32>
optional
The number of columns that are frozen in the grid.
frozenRowCount
integer <int32>
optional
The number of rows that are frozen in the grid.
hideGridlines
boolean 
optional
True if the grid isn't showing gridlines in the UI.
rowCount
integer <int32>
optional
The number of rows in the grid.
rowGroupControlAfter
boolean 
optional
True if the row grouping control toggle is shown after the group.
hidden
boolean 
optional
True if the sheet is hidden in the UI, false if it's visible.
index
integer <int32>
optional
The index of the sheet within the spreadsheet. When adding or updating sheet properties, if this field is excluded then the sheet is added or moved to the end of the sheet list. When updating sheet indices or inserting sheets, movement is considered in "before the move" indexes. For example, if there were 3 sheets (S1, S2, S3) in order to move S1 ahead of S2 the index would have to be set to 2. A sheet index update request is ignored if the requested index is identical to the sheets current index or if the requested new index is equal to the current sheet index + 1.
rightToLeft
boolean 
optional
True if the sheet is an RTL sheet instead of an LTR sheet.
sheetId
integer <int32>
optional
The ID of the sheet. Must be non-negative. This field cannot be changed once set.
sheetType
enum<string> 
optional
The type of sheet. Defaults to GRID. This field cannot be changed once set.
Allowed values:
SHEET_TYPE_UNSPECIFIEDGRIDOBJECTDATA_SOURCE
tabColor
object 
optional
tabColorStyle
object (ColorStyle) 
optional
The color of the tab in the UI. If tab_color is also set, this field takes precedence.
rgbColor
object 
optional
themeColor
enum<string> 
optional
Theme color.
Allowed values:
THEME_COLOR_TYPE_UNSPECIFIEDTEXTBACKGROUNDACCENT1ACCENT2ACCENT3ACCENT4ACCENT5ACCENT6LINK
title
string 
optional
The name of the sheet.
Previous
/v4/spreadsheets/{spreadsheetId}/developerMetadata:search
Next
/v4/spreadsheets/{spreadsheetId}/values/{range}
Built with