> ## 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.

# Whiteboards

> Read a whiteboard's shapes and draw on it.

`GET` returns the board's shapes back to front: each shape's `id`, `kind`
(`geo`, `note`, `text`, `arrow`, `draw`, `line`, `image`, `frame`…), position,
size, `text` and `color`, and for an arrow bound to shapes, the `fromId` and
`toId` it connects. Shapes drawn by hand read back too; the API places notes,
text, geometric shapes and arrows.

`PATCH` takes a list of `operations`, applied in order and **all or nothing**,
and lands live for anyone with the board open.

| Operation | Does |
| - | - |
| `add_shape` | Place a `note`, `text` or `geo` shape (`rectangle`, `ellipse`, `diamond`…) |
| `update_shape` | Move, resize, recolour or relabel a shape |
| `connect` | Draw an arrow between two shapes, bound so it follows them |
| `delete_shape` | Delete a shape, anything inside it, and arrows bound to it |
| `clear` | Delete every shape |

Colours are tldraw's palette: `black`, `grey`, `violet`, `light-violet`,
`blue`, `light-blue`, `yellow`, `orange`, `green`, `light-green`, `red`,
`light-red`, `white`.

```ts SDK theme={null}
const {shapes} = await custral.whiteboards.edit("page_3Ab9xK2mQ7", {
  operations: [
    {kind: "add_shape", shape: {kind: "geo", x: 0, y: 0, w: 200, h: 100, text: "Lead"}},
    {kind: "add_shape", shape: {kind: "geo", x: 400, y: 0, w: 200, h: 100, text: "Customer"}},
  ],
});
await custral.whiteboards.edit("page_3Ab9xK2mQ7", {
  operations: [{kind: "connect", fromId: shapes[0].id, toId: shapes[1].id, text: "converts"}],
});
```

> [!NOTE]
>
> Reading needs `documents:read`; editing needs `documents:write` and Can edit on the page. Stella and MCP clients can
> add, move and connect shapes but not delete them.


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