API reference
Assistant: Spreadsheets
Your spreadsheets, as the app's grid opens them: read a spreadsheet, its tabs and their cells (as typed and as shown, formulas computed), type cells, insert and delete rows and columns, add, rename, move and delete tabs, read a range and append rows. List them, make and delete them under `/assistant/documents`. 10 endpoints. Add your API key in the authentication panel to send test requests from this page.
Read a spreadsheet
/api/external/v1/assistant/sheets/{sheetId}A spreadsheet as the grid opens it: id, title, version (one more with every change), locale and timeZone (how typed numbers and dates are read), url (where the app opens it), tabs (id, name, the used rows and columns of each), limits and tracks it is attached to.
Errors: 404 SHEETS_NOT_FOUND.
Parameters
sheetIdstringpathRequiredThe spreadsheet's id, ks_...
Responses
200OK
Rename a spreadsheet
/api/external/v1/assistant/sheets/{sheetId}title (required, at most 200 characters). Answers the spreadsheet. Needs Tracks on your plan.
Errors: 400 MISSING_FIELD, SHEETS_INVALID; 404 SHEETS_NOT_FOUND; 409 PLAN_FEATURE.
Parameters
sheetIdstringpathRequiredThe spreadsheet's id, ks_...
Request body application/json
object
Responses
200OK
Append rows
/api/external/v1/assistant/sheets/{sheetId}/rowsAdds rows (required: a list of rows, each a list of cell values) after the last used row of a tab (tab: its name; default the first tab). A value starting with = is a formula. Answers tab, range (where the rows went, in A1 notation), rows and cells written. Needs Tracks on your plan.
Limits: at most 2000 rows a call, 60 columns a row, 5000 characters a cell, 5000 rows a tab.
Errors: 400 MISSING_FIELD, SHEETS_INVALID; 404 SHEETS_NOT_FOUND; 409 PLAN_FEATURE, SHEETS_TRANSIENT.
Parameters
sheetIdstringpathRequiredThe spreadsheet's id, ks_...
Request body application/json
object
Responses
200OK
Add a tab
/api/external/v1/assistant/sheets/{sheetId}/tabsA new, empty tab at the end (name optional: "Sheet N" without one). Answers the spreadsheet with it (201). Needs Tracks on your plan; at most 20 tabs.
Errors: 400 SHEETS_INVALID (a name taken, too many tabs); 404 SHEETS_NOT_FOUND; 409 PLAN_FEATURE.
Parameters
sheetIdstringpathRequiredThe spreadsheet's id, ks_...
Request body application/json
object
Responses
200OK
Read a tab's cells
/api/external/v1/assistant/sheets/{sheetId}/tabs/{tabId}One tab whole: sheetId, id, name, version, the used rows and columns, raw (each cell as typed: a value or a formula, row by row), values (each cell as shown), frozenRows, widths (column index to pixels) and charts.
Errors: 404 SHEETS_NOT_FOUND (also for a tab that is not there).
Parameters
sheetIdstringpathRequiredThe spreadsheet's id, ks_...
tabIdstring (uuid)pathRequired
Responses
200OK
Rename, move or lay out a tab
/api/external/v1/assistant/sheets/{sheetId}/tabs/{tabId}Changes what is sent: name, position (0 is first), frozenRows (0 or 1: a header row that stays), widths (column index to pixels, 40 to 800; 0 puts a column back to the usual width). Formulas that name the tab follow a new name. Answers the spreadsheet. Needs Tracks on your plan.
Errors: 400 SHEETS_INVALID (a name taken); 404 SHEETS_NOT_FOUND; 409 PLAN_FEATURE.
Parameters
sheetIdstringpathRequiredThe spreadsheet's id, ks_...
tabIdstring (uuid)pathRequired
Request body application/json
object
Responses
200OK
Delete a tab
/api/external/v1/assistant/sheets/{sheetId}/tabs/{tabId}Deletes the tab and its cells. Answers 204. Needs Tracks on your plan.
Errors: 400 SHEETS_INVALID (the last tab stays); 404 SHEETS_NOT_FOUND; 409 PLAN_FEATURE.
Parameters
sheetIdstringpathRequiredThe spreadsheet's id, ks_...
tabIdstring (uuid)pathRequired
Responses
200OK
Type cells
/api/external/v1/assistant/sheets/{sheetId}/tabs/{tabId}/cellsTypes each of cells (required): row and col (0-based) and value as a person types it in the grid - a number, a date or a text read in the spreadsheet's locale, = for a formula, null to empty the cell. Other cells stay. Answers the tab as it now is. Needs Tracks on your plan.
Limits: at most 20000 cells a call, 5000 characters a cell.
Errors: 400 MISSING_FIELD, SHEETS_INVALID (a cell without row or col); 404 SHEETS_NOT_FOUND; 409 PLAN_FEATURE.
Parameters
sheetIdstringpathRequiredThe spreadsheet's id, ks_...
tabIdstring (uuid)pathRequired
Request body application/json
object
Responses
200OK
Insert or delete rows or columns
/api/external/v1/assistant/sheets/{sheetId}/tabs/{tabId}/structureop (required): INSERT_ROWS, DELETE_ROWS, INSERT_COLUMNS or DELETE_COLUMNS, from index (required, 0-based) for count (default 1). Every formula of the spreadsheet that points there moves with them. Answers the tab as it now is. Needs Tracks on your plan.
Errors: 400 SHEETS_INVALID (an unknown op, no index, past the limits); 404 SHEETS_NOT_FOUND; 409 PLAN_FEATURE.
Parameters
sheetIdstringpathRequiredThe spreadsheet's id, ks_...
tabIdstring (uuid)pathRequired
Request body application/json
object
Responses
200OK
Read a range as shown
/api/external/v1/assistant/sheets/{sheetId}/valuesThe cells of a range as they show (formulas computed, numbers and dates formatted), row by row, as values, with tab, range (the range read, in A1 notation), totalRows and truncated (more rows than maxRows were there). Empty cells at the end of a row and empty rows at the end are left out.
tab is a tab's name (default: the first tab); range an A1 range such as A1:D20 or B:B (default: the whole used area); maxRows at most 1000 (the default).
Errors: 400 SHEETS_INVALID (a range that is none); 404 SHEETS_NOT_FOUND (also for a tab that is not there).
Parameters
sheetIdstringpathRequiredThe spreadsheet's id, ks_...
tabstringqueryThe tab's name; default the first tab.
rangestringqueryAn A1 range, e.g. A1:D20; default the used area.
maxRowsinteger (int32)queryAt most this many rows (default and most: 1000).
Responses
200OK