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
mimeType=application/vnd.google-apps.spreadsheet to create a new Google Sheet./api/access/drive/sheets/{fileId}Bearer TokenGet Spreadsheet Metadata
Returns the spreadsheet title, sheet tab names, and dimensions.
Required Operation
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." } /api/access/drive/sheets/{fileId}/valuesBearer TokenRead Cell Values
Read cell values from a specified range in A1 notation.
Query Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| range | string | Yes | Cell range in A1 notation (e.g., Sheet1!A1:C10, Sheet1, A1:B5) |
Required Operation
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." } /api/access/drive/sheets/{fileId}/valuesBearer TokenWrite Cell Values
Write cell values to a specified range, overwriting existing content.
Request Body (JSON)
| Field | Type | Required | Description |
|---|---|---|---|
| range | string | Yes | Target range in A1 notation (e.g., Sheet1!A1:C3) |
| values | array[][] | Yes | 2D array of cell values |
| valueInputOption | string | No | USER_ENTERED (default — formulas evaluated) or RAW (literal values) |
Required Operation & Limits
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" } /api/access/drive/sheets/{fileId}/values:appendBearer TokenAppend Rows
Append rows after the last row containing data in the specified range. Existing data is not overwritten.
Request Body (JSON)
| Field | Type | Required | Description |
|---|---|---|---|
| range | string | Yes | Range to detect the table (e.g., Sheet1!A:C or Sheet1) |
| values | array[][] | Yes | Rows to append (2D array) |
| valueInputOption | string | No | USER_ENTERED (default) or RAW |
Auto-Detect Table End
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
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" }