> ## Documentation Index
> Fetch the complete documentation index at: https://docs.custral.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Spreadsheets

> Read a spreadsheet's values and write to it.

`GET` returns each tab's `title`, its values as `rows` (A1 is `rows[0][0]`,
trimmed to the last used row and column), and every formula by cell in
`formulas`. A formula cell's value in `rows` is its computed result.

`PATCH` takes a list of `operations`, applied in order and **all or nothing**,
and lands live for anyone with the sheet open. `sheet` is a tab title; leave it
out for the first tab.

| Operation | Does |
| - | - |
| `set_values` | Write a block of values with its top-left at `cell` (`B2`) |
| `append_rows` | Add rows below the last row that holds a value |
| `clear_range` | Empty a range (`A2:D20`); formatting stays |
| `add_sheet` | Add a tab |
| `rename_sheet` | Rename a tab |

A cell is text, a number, `true`/`false`, `null` (empty), or a formula written
as `{"formula": "=SUM(B2:B9)", "value": 4200}`. `value` is what the cell shows
until the sheet recalculates, so send it when you know it. A bare `"=…"` string
is refused, because it would show as a blank cell.

```ts SDK theme={null}
await custral.spreadsheets.edit("page_3Ab9xK2mQ7", {
  operations: [{kind: "append_rows", values: [["Acme", 1200, {formula: "=B2*12", value: 14400}]]}],
});
```

> [!NOTE]
>
> Reading needs `documents:read`; editing needs `documents:write` and Can edit on the page.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.