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

# Fetch many workspaces

> Leaf fetcher for the caller's direct-membership + owned workspaces

## Overview

`useFetchManyWorkspaces` returns a callable that fetches one page of the caller's **direct-membership + owned** workspaces. The actor is derived from the bearer token — no `actingUserId` is sent. For a managed paginated list with load-more, prefer [`useFetchManyWorkspacesWrapper`](/v8/hooks/workspaces/use-fetch-many-workspaces-wrapper).

## Usage Example

```tsx theme={null}
import { useFetchManyWorkspaces } from "@sublay/react-js";

function useMyWorkspaces() {
  const fetchManyWorkspaces = useFetchManyWorkspaces();

  return async () => {
    const { data, pagination } = await fetchManyWorkspaces({
      page: 1,
      limit: 20,
      include: ["memberCount"],
    });
    return data;
  };
}
```

## Parameters

The callable takes an optional params object:

<ParamField path="page" type="number">Page number.</ParamField>
<ParamField path="limit" type="number">Page size.</ParamField>
<ParamField path="include" type="string | string[]">Include flags. `memberCount` adds each row's **direct** member count, resolved in one grouped query over the returned page rather than one request per workspace; omit it and the field is absent from each row. An array is joined with commas.</ParamField>

## Returns

Returns a `PaginatedResponse<Workspace>` (`{ data, pagination }`).

## Related

* [List Workspaces API](/v8/api-reference/workspaces/fetch-workspaces)


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