Skip to content

Google Sheets

Read spreadsheet metadata, read cell values, write cell values, and append rows to Google Sheets. The connected Google account must have a writable Drive scope for write/append operations.

Creating Google Sheets

Use the Upload File endpoint with mimeType=application/vnd.google-apps.spreadsheet to create a new Google Sheet.
GET/api/access/drive/sheets/{fileId}Bearer Token

Get Spreadsheet Metadata

Returns the spreadsheet title, sheet tab names, and dimensions.

Required Operation

Requires read_sheet_data permission.

Response 200 OK

{
"spreadsheetId": "1BxiMVs0XRA5nkz...",
"title": "Q1 Budget",
"sheets": [
{
"sheetId": 0,
"title": "Summary",
"rowCount": 100,
"columnCount": 26
},
{
"sheetId": 123456,
"title": "Expenses",
"rowCount": 500,
"columnCount": 10
}
],
"accessInfo": "Read-only drive access..."
}

Response 404 Not Found

{
"error": "Spreadsheet not found in Google Drive."
}
GET/api/access/drive/sheets/{fileId}/valuesBearer Token

Read Cell Values

Read cell values from a specified range in A1 notation.

Query Parameters

ParameterTypeRequiredDescription
rangestringYesCell range in A1 notation (e.g., Sheet1!A1:C10, Sheet1, A1:B5)

Required Operation

Requires read_sheet_data permission. Range must contain only alphanumeric characters, spaces, !, :, ., ' (max 200 characters).

Response 200 OK

{
"range": "Sheet1!A1:C3",
"values": [
["Name", "Email", "Score"],
["Alice", "alice@example.com", 95],
["Bob", "bob@example.com", 87]
],
"accessInfo": "Read-only drive access..."
}

Values are returned as formatted strings by default. Numbers, booleans, and nulls are preserved with their native types.

Response 400 Bad Request

{
"error": "INVALID_RANGE",
"message": "Invalid sheet range. Use formats like 'Sheet1!A1:C10' or 'Sheet1'."
}

Response 404 Not Found

{
"error": "Spreadsheet or range not found."
}
PUT/api/access/drive/sheets/{fileId}/valuesBearer Token

Write Cell Values

Write cell values to a specified range, overwriting existing content.

Request Body (JSON)

FieldTypeRequiredDescription
rangestringYesTarget range in A1 notation (e.g., Sheet1!A1:C3)
valuesarray[][]Yes2D array of cell values
valueInputOptionstringNoUSER_ENTERED (default — formulas evaluated) or RAW (literal values)

Required Operation & Limits

Requires write_sheet_data permission. Max request size: 5 MB. Max cells: 10,000 per request.
{
"range": "Sheet1!A1:C3",
"values": [
["Name", "Email", "Score"],
["Alice", "alice@example.com", 95],
["Bob", "bob@example.com", "=SUM(C2:C2)"]
],
"valueInputOption": "USER_ENTERED"
}

Response 403 Forbidden

{
"success": false,
"errorMessage": "Permission denied. The connected Google account does not have write access to this spreadsheet.",
"errorCode": "PERMISSION_DENIED"
}
POST/api/access/drive/sheets/{fileId}/values:appendBearer Token

Append Rows

Append rows after the last row containing data in the specified range. Existing data is not overwritten.

Request Body (JSON)

FieldTypeRequiredDescription
rangestringYesRange to detect the table (e.g., Sheet1!A:C or Sheet1)
valuesarray[][]YesRows to append (2D array)
valueInputOptionstringNoUSER_ENTERED (default) or RAW

Auto-Detect Table End

Use a column-only range like Sheet1!A:C to auto-detect where the data ends. The API finds the last row with data and inserts new rows below it.

Required Operation & Limits

Requires write_sheet_data permission. Max request size: 5 MB. Max rows: 5,000 per request.
{
"range": "Sheet1!A:C",
"values": [
["Charlie", "charlie@example.com", 92],
["Diana", "diana@example.com", 88]
],
"valueInputOption": "USER_ENTERED"
}

Response 403 Forbidden

{
"success": false,
"errorMessage": "Permission denied. The connected Google account does not have write access to this spreadsheet.",
"errorCode": "PERMISSION_DENIED"
}