# OutlineApi.set()

```ts
set(nodes: OutlineNode[], options?: SignedDocumentOptions): Promise<void>
```

Replace the whole tree. Keeps only titles, pages and nesting: each bookmark's zoom, color, style, other actions and open state are lost — use `add`, `delete` and `setTitle` for single edits, which change one bookmark and nothing else. Needs the `edit-pages` feature.

- Kind: method
- Since: 1.0.0

| Parameter | Type | Description |
| --- | --- | --- |
| `nodes` | `OutlineNode[]` | The whole tree: `{ title, pageIndex, children }` each. |
| `options?` | `SignedDocumentOptions` | `{ invalidateSignatures? }`. |

Returns `Promise<void>`

Throws:

- `FEATURE_NOT_LICENSED` — the license lacks `edit-pages`.
- `PAGE_ERROR` — the change could not be written.
- `DOCUMENT_CLOSED` — the document has been closed.
- `INVALID_STATE` — a certified document, unless `options.invalidateSignatures` (no certification level allows bookmark changes); or a progressive document still downloading.

```ts
await doc.outline.set([
  { title: 'Cover', pageIndex: 0, children: [] },
  { title: 'Terms', pageIndex: 4, children: [{ title: 'Payment', pageIndex: 5, children: [] }] },
]);
```

Part of [OutlineApi](https://kernstra.com/docs/web-sdk/api/doc-outline) in the Kernstra Web SDK 1.0.0 API reference.

Web page: https://kernstra.com/docs/web-sdk/api/doc-outline/set
