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;
workspaceId?: string | undefined;Stable workspace id to load.
Return value
›id?: string | undefined;
id?: string | undefined;Stable workspace identifier.
›organization_id?: string | undefined;
organization_id?: string | undefined;Parent organization id.
›name?: string | undefined;
name?: string | undefined;Workspace display name.
›description?: string | undefined;
description?: string | undefined;Workspace description text.
›public_metadata?: Record<string, unknown> | undefined;
public_metadata?: Record<string, unknown> | undefined;Public workspace metadata.
›plan?: string | undefined;
plan?: string | undefined;Example public plan field.
›owner?: string | undefined;
owner?: string | undefined;Example public owner field.
›private_metadata?: Record<string, unknown> | undefined;
private_metadata?: Record<string, unknown> | undefined;Private workspace metadata.
›internal_notes?: string | undefined;
internal_notes?: string | undefined;Example internal note field.
›billing_id?: string | undefined;
billing_id?: string | undefined;Example internal billing identifier.
›roles?: WorkspaceRole[] | undefined;
roles?: WorkspaceRole[] | undefined;Workspace roles available in this workspace.
›segments?: Segment[] | undefined;
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.