NewWacht Bench is live — AI-assisted development for Wacht

listWorkspaces()

Returns paginated workspace list items and forwards pagination, search, and sorting query params.

Usage

The following example shows a basic usage of the backend client from @wacht/nextjs/server.

import { wachtClient } from '@wacht/nextjs/server';export async function listWorkspaces() {  const client = await wachtClient();  return client.workspaces.listWorkspaces({    limit: 20,    search: 'engineering',    sort_key: 'created_at',    sort_order: 'desc',  });}

Signature

function listWorkspaces(  options?: ListWorkspacesOptions,): Promise<PaginatedResponse<WorkspaceListItem>>

ListWorkspacesOptions

limit?: number | undefined;
Maximum workspaces to return.
offset?: number | undefined;
Number of workspaces to skip.
search?: string | undefined;
Search term forwarded to backend.
sort_key?: string | undefined;
Sort key forwarded to backend.
sort_order?: 'asc' | 'desc' | undefined;
Sort order for `sort_key`.

Return value

data?: WorkspaceListItem[] | undefined;
Workspace list rows.
total?: number | undefined;
Total number of workspaces matching the current query.
limit?: number | undefined;
Effective page size from backend response.
offset?: number | undefined;
Effective page offset from backend response.

Behavior

  • Lists workspaces accessible in the deployment context.
  • Supports pagination, search, and backend sort options.

On this page