# PagesApi.move()

```ts
move(from: number, to: number, options?: SignedDocumentOptions): Promise<void>
```

Moves a page to a new index. Needs the `edit-pages` feature.

- Kind: method
- Since: 1.0.0

| Parameter | Type | Description |
| --- | --- | --- |
| `from` | `number` | Current zero-based index. |
| `to` | `number` | The index it should occupy afterwards. |
| `options?` | `SignedDocumentOptions` | `{ invalidateSignatures? }`. |

Returns `Promise<void>`

Throws:

- `INVALID_ARGUMENT` — a page index or the destination out of range.
- `PAGE_ERROR` — the page could not be moved, or the page tree is nested too deeply.
- `FEATURE_NOT_LICENSED` — the license lacks `edit-pages`.
- `DOCUMENT_CLOSED` — the document has been closed.
- `INVALID_STATE` — a certified document whose certification forbids it, unless `options.invalidateSignatures`; or a progressive document still downloading.

```ts
await doc.pages.move(3, 0); // make page 4 the cover
```

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

Web page: https://kernstra.com/docs/web-sdk/api/doc-pages/move
