Google Sheets -> Create Spreadsheet
Readonly
Action summary
Google Sheets -> Create Spreadsheet
Creates a new Google Spreadsheet using the Sheets API.
Inputs
| Name | Type | Required | Description |
|---|---|---|---|
| title | text | Yes | The title of the new spreadsheet. |
| access_token | text | Yes | Google OAuth2 Access Token for authentication. Install the template here |
Function Stack
- Build Properties
- Constructs the spreadsheet properties object (currently only
title).
- Constructs the spreadsheet properties object (currently only
- API Request
- Calls the Google Sheets API to create a new spreadsheet.
- Endpoint:
POST https://sheets.googleapis.com/v4/spreadsheets - Payload:
{ "properties": { "title": "My Spreadsheet" } } - Authenticates using the provided access token.
- Precondition
- Checks for a successful (status 200) response.
- Throws an error if the API response is not successful.
- Extract Spreadsheet ID
- Parses the API response for the new spreadsheet's ID.
- Extract Spreadsheet URL
- Parses the API response for the new spreadsheet's URL.
Response
Returns:
{
"spreadsheet_id": "1A2B3C4D5E",
"spreadsheet_url": "https://docs.google.com/spreadsheets/d/1A2B3C4D5E/edit"
}
Example Usage
Request
{
"title": "Team Roster",
"access_token": "ya29.a0AfH6SMB..."
}
Response
{
"spreadsheet_id": "1A2B3C4D5E",
"spreadsheet_url": "https://docs.google.com/spreadsheets/d/1A2B3C4D5E/edit"
}
Notes
- The spreadsheet title must be unique within your Google Drive.
- The access token must have permission to create spreadsheets.
References
Troubleshooting
- PERMISSION_DENIED: Check your access token and Google account permissions.
- INVALID_ARGUMENT: Ensure all required fields are provided and valid.
- For more help: Refer to the Google Sheets API documentation.
Version notes
2025-09-18 17:36:02
Current