---
title: "Pages hooks"
description: "Hand-written shim. Generated CRUD via ./pages.gen. The hooks below cover
`move` (positional swap) and `resolve` (slug-path lookup) — neither fits
the manifest's standard CRUD kinds."
section: "Libraries"
group: "React hooks"
order: 439
---

## Hooks

### `useCreatePage` `mutation`

Create a page.

```ts
useCreatePage(options?: MutationOpts<PageEntity, CreatePageParams>)
```

**Types:** [PageEntity](/types/page-entity) · [CreatePageParams](/types/create-page-params)

### `useDeletePage` `mutation`

Soft-delete a page.

```ts
useDeletePage(options?: MutationOpts<SuccessResponse, string>)
```

**Types:** [SuccessResponse](/types/success-response)

### `useListPages` `query`

List pages.

```ts
useListPages(params?: Omit<ListPagesParams, | > & { filter?: PageFilter; orderBy?: PageOrderBy[]; } & PageShorthands, options?: QueryOpts<Page<PageEntity>>)
```

**Types:** [ListPagesParams](/types/list-pages-params) · [PageFilter](/types/page-filter) · [PageOrderBy](/types/page-order-by) · [PageShorthands](/types/page-shorthands) · [Page](/types/page) · [PageEntity](/types/page-entity)

### `useMovePage` `composite`

Move a page up or down within its siblings. Auto-invalidates page
queries so the tree reflects the new ordering.

```ts
useMovePage(options?: MutationOpts<Page, MovePageParams>)
```

**Types:** [Page](/types/page) · [MovePageParams](/types/move-page-params)

```ts
const move = useMovePage();
move.mutate({ id: "pag_abc", direction: "up" });
```

### `usePurgePage` `composite`

Permanently delete a soft-deleted page.

```ts
usePurgePage(options?: MutationOpts<SuccessResponse, PurgePageParams>)
```

**Types:** [SuccessResponse](/types/success-response) · [PurgePageParams](/types/purge-page-params)

### `useResolvePagePath` `composite`

Resolve a slash-separated slug path to a page row.

```ts
useResolvePagePath(params: ResolvePagePathParams | undefined, options?: QueryOpts<Page>)
```

**Types:** [ResolvePagePathParams](/types/resolve-page-path-params) · [Page](/types/page)

```ts
const { data: page } = useResolvePagePath({
  workspaceId: "wsp_abc",
  path: "runbooks/ingest/retry-policy",
});
```

### `useRestorePage` `composite`

Restore a soft-deleted page.

```ts
useRestorePage(options?: MutationOpts<PageEntity, string>)
```

**Types:** [PageEntity](/types/page-entity)

### `useRetrievePage` `query`

Get a page by ID.

```ts
useRetrievePage(id: string, options?: QueryOpts<PageEntity>)
```

**Types:** [PageEntity](/types/page-entity)

### `useUpdatePage` `mutation`

Update a page.

```ts
useUpdatePage(options?: MutationOpts<PageEntity, UpdatePageParams>)
```

**Types:** [PageEntity](/types/page-entity) · [UpdatePageParams](/types/update-page-params)
