create_sheet
Add a spreadsheet to a space: a real Excel-style workbook (formulas, formats, charts, tables) that people edit live. Start it from tabs of rows, or from a file (an .xlsx, .xlsm, .xls, .xlsb, .ods, .csv or .tsv workbook, by public URL or base64) with everything in it. Shape it with the sheet_* tools and check it (check_sheet). Read guide topic "sheets" first.
Parameters
space_idstringrequiredtitlestringrequiredtabsobject[]Show child attributes
namestringrequiredrows((string | number | boolean | null)[])[]fileobjectShow child attributes
namestringrequiredurlstringbase64stringsheet_execute_command
Run ANY spreadsheet engine command by id with JSON params — every ribbon/menu action is a command. Find ids and parameter docs with sheet_list_commands. Examples: {"command":"cell.set","params":{"cell":"B2","input":"=SUM(A1:A9)"}}; {"command":"home.bold","params":{"range":"A1:C1"}}; {"command":"sheet.insert"}; {"command":"data.removeDuplicates","params":{"range":"A1:C20"}}. Most commands act on the current selection when range is omitted. Programmatic calls never open dialogs: missing required params give an error. Acts on the spreadsheet item_id, on the tab named by tab (default: the first) unless the range names one ("'Q1 Budget'!B4:D9"). Everyone with the sheet open sees the change at once.
Parameters
item_idstringrequiredtabstringselectionstringcommandstringrequiredparamsobjectparams field of sheet_list_commands); omit or {} for defaultssheet_list_commands
List spreadsheet engine commands: id, label, ribbon path, shortcut, a parameter description (params) and whether it can run right now. Use it to discover what sheet_execute_command can do (e.g. search "sort", "border", "chart", "sheet"). Acts on the spreadsheet item_id, on the tab named by tab (default: the first) unless the range names one ("'Q1 Budget'!B4:D9").
Parameters
item_idstringrequiredtabstringselectionstringsearchstringsheet_inspect_workbook
Summary of the active workbook: title, path, dirty flag, sheets (name, used range, cell count, tables, charts, merges, filters, freeze panes), defined names, current selection and active cell, calculation mode and undo/redo history. Acts on the spreadsheet item_id, on the tab named by tab (default: the first) unless the range names one ("'Q1 Budget'!B4:D9").
Parameters
item_idstringrequiredtabstringselectionstringsheet_read_range
Read cell values from a range as rows (2-D array). Numbers/booleans/strings are returned as JSON values, empty cells as null, errors as {"error":"#DIV/0!"}. Without range, reads the sheet's used range. formulas:true returns formula text ("=SUM(B2:B4)") for formula cells; formatted:true returns the displayed text ("$1,234.00", "12%"). Acts on the spreadsheet item_id, on the tab named by tab (default: the first) unless the range names one ("'Q1 Budget'!B4:D9").
Parameters
item_idstringrequiredtabstringselectionstringformattedbooleanformulasbooleanrangestringsheetstringsheet_write_range
Write a 2-D array of values starting at the top-left cell of range (rows of cells). Numbers, booleans, null (clears) and strings are accepted; strings starting with = are formulas ("=SUM(B2:B4)"), other strings are parsed like typed input ("12%", "1/2/2024", "$5"). One undo step. Example: {"range":"A1","values":[["Item","Cost"],["Rent",1200]]}. Acts on the spreadsheet item_id, on the tab named by tab (default: the first) unless the range names one ("'Q1 Budget'!B4:D9"). Everyone with the sheet open sees the change at once.
Parameters
item_idstringrequiredtabstringselectionstringrangestringrequiredvalues((string | number | boolean | null)[])[]requiredsheet_set_cell
Enter one cell exactly as if typed: a number, text, or a formula starting with = ("=AVERAGE(B2:B9)"). Dependent cells recalculate. Returns the command result; use sheet_get_cell to read the computed value. Acts on the spreadsheet item_id, on the tab named by tab (default: the first) unless the range names one ("'Q1 Budget'!B4:D9"). Everyone with the sheet open sees the change at once.
Parameters
item_idstringrequiredtabstringselectionstringcellstringrequiredinputstring | number | booleanrequiredsheet_get_cell
Details of one cell: computed value and type, formula, display text, raw input, spill range, style, merge, comment and hyperlink. Acts on the spreadsheet item_id, on the tab named by tab (default: the first) unless the range names one ("'Q1 Budget'!B4:D9").
Parameters
item_idstringrequiredtabstringselectionstringcellstringrequiredsheet_evaluate_formula
Evaluate a formula against the active sheet WITHOUT changing any cell, e.g. "=SUM(B2:B10)/COUNT(B2:B10)" or "=VLOOKUP("x",A:B,2,FALSE)". cell sets the formula's position for relative references and ROW()/COLUMN(). Use English function names and , between arguments; a formula that couldn't be entered in a cell is an error saying why. Acts on the spreadsheet item_id, on the tab named by tab (default: the first) unless the range names one ("'Q1 Budget'!B4:D9").
Parameters
item_idstringrequiredtabstringselectionstringcellstringformulastringrequiredsheet_format_range
Apply several formats to a range in one call: bold, italic, underline, font name/size, font color, fill color, number format, horizontal alignment, wrap, borders. Colors are "#RRGGBB" (fontColor also "auto", fillColor also "none"). numberFormat is a name (General, Number, Currency, Accounting, Comma, Percentage, Short Date, Long Date, Time, Fraction, Scientific, Text) or a format code ("#,##0.00", "0%", "yyyy-mm-dd"). Each property runs one command; the result lists them. Acts on the spreadsheet item_id, on the tab named by tab (default: the first) unless the range names one ("'Q1 Budget'!B4:D9"). Everyone with the sheet open sees the change at once.
Parameters
item_idstringrequiredtabstringselectionstringboldbooleanbordersstring | objectShow child attributes
colorstringpresetstringrequiredbottom, top, left, right, none, all, outside, thickOutside, thickBottom, doubleBottom, topBottom, topThickBottom, topDoubleBottom, insideHorizontal, insideVertical, inside, diagonalDown, diagonalUp.stylestringfillColorstringfontColorstringfontNamestringfontSizenumberhorizontalAlignstringleft, center, right, justify.italicbooleannumberFormatstringrangestringrequiredunderlinebooleanwrapTextbooleansheet_insert_chart
Insert a chart from a data range (first row/column used as series names and categories, like Excel). Returns the chart id. Acts on the spreadsheet item_id, on the tab named by tab (default: the first) unless the range names one ("'Q1 Budget'!B4:D9"). Everyone with the sheet open sees the change at once.
Parameters
item_idstringrequiredtabstringselectionstringatstringrangestringrequiredsubtypestringclustered, stacked, stacked100, markers.titlestringtypestringrequiredcolumn, bar, line, pie, doughnut, area, scatter, bubble, radar, combo, histogram, waterfall, funnel, treemap, sunburst, boxWhisker, stock.sheet_create_table
Format a range as an Excel table (structured references, banded rows, filter buttons). The first row is the header by default. Acts on the spreadsheet item_id, on the tab named by tab (default: the first) unless the range names one ("'Q1 Budget'!B4:D9"). Everyone with the sheet open sees the change at once.
Parameters
item_idstringrequiredtabstringselectionstringheaderbooleannamestringrangestringrequiredstylestringsheet_sort_range
Sort a range by one or more columns. keys: [{"column":"B","order":"desc"}, …] or just ["B"]. Without range the current region around the selection is sorted; header detection follows Excel unless header is given. Acts on the spreadsheet item_id, on the tab named by tab (default: the first) unless the range names one ("'Q1 Budget'!B4:D9"). Everyone with the sheet open sees the change at once.
Parameters
item_idstringrequiredtabstringselectionstringheaderbooleankeys(string | object)[]requiredShow child attributes
columnstringrequiredorderstringasc, desc.rangestringsheet_filter
Filter rows by a column (turns on AutoFilter on the current region, or range, when needed). Give values (keep rows whose cell text is one of them), custom ({op:">", value:"10", op2?, value2?, and?}), top ({count, bottom?, percent?}), or clear:true to remove this column's filter. Acts on the spreadsheet item_id, on the tab named by tab (default: the first) unless the range names one ("'Q1 Budget'!B4:D9"). Everyone with the sheet open sees the change at once.
Parameters
item_idstringrequiredtabstringselectionstringblanksbooleanclearbooleancolumnstringrequiredcustomobjectrangestringtopobjectvalues(string | number | boolean)[]sheet_list_functions
List worksheet functions: name, category, signature and description. Filter with search (name or description) or category. Acts on the spreadsheet item_id, on the tab named by tab (default: the first) unless the range names one ("'Q1 Budget'!B4:D9").
Parameters
item_idstringrequiredtabstringselectionstringcategorystringsearchstringsheet_run_commands
Run several spreadsheet engine commands in order in one call (each as sheet_execute_command runs it), e.g. edit.copy then edit.pasteSpecial, or a block of formatting and structure. Nothing anyone else does lands in between. Stops at the first command that fails and says which; the ones before it stay done (sheet_undo takes back the whole run).
Parameters
item_idstringrequiredtabstringcommandsobject[]requiredShow child attributes
commandstringrequiredparamsobjecttabstringselectionstringsheet_undo
Take back your own latest change to the spreadsheet (one tool call, or one sheet_run_commands run); call again for the one before. Only while nobody has changed the sheet since: it never takes back a person's or another agent's work. Everyone with the sheet open sees it go back.
Parameters
item_idstringrequiredcheck_sheet
Check a workbook the way a careful reader would: formula errors (#DIV/0!, #REF!, …) with the formula behind them, numbers stored as text, numbers too wide for their column (####), text cut off by a filled cell beside it (measured with the fonts the sheet is drawn in), long tables without a frozen header, empty tabs. Run it before you hand a sheet over.
Parameters
item_idstringrequiredrender_sheet
See a tab as people see it in Artifacts: a screenshot of the sheet drawn by the spreadsheet engine (values, formats, column widths, frozen panes, charts, pictures), scrolled so range is in view. Look after you change layout, colours or charts; check_sheet finds what a picture hides (formula errors, numbers stored as text).
Parameters
item_idstringrequiredtabstringrangestringwidthintegerheightintegerexport_sheet
Links to download the spreadsheet as an Excel workbook (.xlsx) or one tab as CSV. Fetch them with your Artifacts key (Authorization: Bearer).
Parameters
item_idstringrequired