NewWacht Bench is live — AI-assisted development for Wacht

getWorkspace()

Returns the expanded workspace details payload, including organization link, roles, and segments.

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 getWorkspace(workspaceId: string) {  const client = await wachtClient();  return client.workspaces.getWorkspace(workspaceId);}

Signature

function getWorkspace(  workspaceId: string,): Promise<WorkspaceDetails>

Parameters

workspaceId?: string | undefined;
Stable workspace id to load.

Return value

id?: string | undefined;
Stable workspace identifier.
organization_id?: string | undefined;
Parent organization id.
name?: string | undefined;
Workspace display name.
description?: string | undefined;
Workspace description text.
public_metadata?: Record<string, unknown> | undefined;
Public workspace metadata.
plan?: string | undefined;
Example public plan field.
owner?: string | undefined;
Example public owner field.
private_metadata?: Record<string, unknown> | undefined;
Private workspace metadata.
internal_notes?: string | undefined;
Example internal note field.
billing_id?: string | undefined;
Example internal billing identifier.
roles?: WorkspaceRole[] | undefined;
Workspace roles available in this workspace.
segments?: Segment[] | undefined;
Segments currently attached to this workspace.

Behavior

  • Returns expanded workspace details by workspace id.
  • Use this when you need role and segment context for one workspace.

On this page