The Google Sheets client lets you interact with Google Sheets spreadsheets. It uses OAuth for authentication, so you connect your Google account once and Major handles token management. For full API details, see the Google Sheets API documentation.Documentation Index
Fetch the complete documentation index at: https://docs.major.build/llms.txt
Use this file to discover all available pages before exploring further.
Setup
- Go to Organization Settings > Connectors
- Click Add Connector and select Google Sheets
- Choose the access scope:
- Read only — Can read spreadsheet data
- Read and write — Can read and modify spreadsheet data
- Click Connect to Google to authorize access
- Select the spreadsheet you want to connect
major resource manage (CLI) or the web editor. Major generates a client in src/clients/.
Usage
Import the generated client and use the helper methods:Reading values
range— The A1 notation range to read (e.g.,Sheet1!A1:D10)operationName— A name for logging and debuggingoptions— Optional settings likevalueRenderOption
FORMATTED_VALUE— Values as they appear in the UI (with formatting)UNFORMATTED_VALUE— Raw values without formattingFORMULA— Formulas instead of calculated values
Appending rows
range— The range to append to (rows are added after existing data)values— 2D array of values to appendoperationName— A name for logging and debuggingoptions— Optional settings likevalueInputOption
USER_ENTERED— Values are parsed as if typed by a user (dates, numbers, formulas)RAW— Values are stored exactly as provided
Updating values
range— The range to updatevalues— 2D array of new valuesoperationName— A name for logging and debuggingoptions— Optional settings
Batch reading
Read multiple ranges in a single request:Low-level API
For operations not covered by helper methods, useinvoke() directly:
Supported API paths
| Method | Path | Description |
|---|---|---|
| GET | /values/{range} | Read a range |
| PUT | /values/{range} | Update a range |
| POST | /values/{range}:append | Append rows |
| GET | /values:batchGet | Batch read multiple ranges |
| POST | /values:batchUpdate | Batch update multiple ranges |
| POST | /:batchUpdate | Batch update (formatting, etc.) |
The spreadsheet ID is configured in the resource and does not need to be included in API paths.
Error handling
Common errors
| Error | Cause |
|---|---|
| 401 Unauthorized | OAuth not completed—reconnect the resource |
| 400 Bad Request | Invalid range or API path |
| 403 Forbidden | Write operation on a read-only resource |
| 404 Not Found | Spreadsheet or sheet not found |
Scope and permissions
When creating the resource, you choose between:- Read only —
GETrequests only - Read and write — Full read/write access