Workspaces hooks
Hand-written shim. Generated CRUD via ./workspaces.gen. The hooks below cover (a) the org-scoped handle lookup that composes two requests (`useGetWorkspaceByHandle`) and (b) the email-settings sub-resource (`useGetWorkspaceEmail`, `useUpdateWorkspaceEmail`) which the manifest pipeline doesn't model yet.
Hooks
useCreateWorkspace mutation
Create a workspace.
useCreateWorkspace(options?: MutationOpts<Workspace, CreateWorkspaceParams>)Types: Workspace · CreateWorkspaceParams
useDeleteWorkspace mutation
Soft-delete a workspace.
useDeleteWorkspace(options?: MutationOpts<SuccessResponse, string>)Types: SuccessResponse
useGetWorkspaceByHandle query
Resolve a workspace by its (org-scoped) handle. Used by path-based URL
routing (/<orghandle>/<wshandle>/…).
Composes two requests: org by handle → workspace by org-id+handle. Both
underlying queries are gated on (a) the matching handle being non-empty
and (b) the caller's enabled option, so consumers like the global
header can call this from non-workspace routes without firing 404s.
useGetWorkspaceByHandle(orgHandle: string, wsHandle: string, options?: QueryOpts<Workspace>)Types: Workspace
useGetWorkspaceEmail query
Fetch workspace email settings (address, enabled, config).
useGetWorkspaceEmail(workspaceId: string, options?: QueryOpts<WorkspaceEmailSettings>)Types: WorkspaceEmailSettings
const { data: email } = useGetWorkspaceEmail("wsp_abc123");useListWorkspaces query
List workspaces.
useListWorkspaces(params?: Omit<ListWorkspacesParams, | > & { filter?: WorkspaceFilter; orderBy?: WorkspaceOrderBy[]; } & WorkspaceShorthands, options?: QueryOpts<Page<Workspace>>)Types: ListWorkspacesParams · WorkspaceFilter · WorkspaceOrderBy · WorkspaceShorthands · Page · Workspace
usePurgeWorkspace composite
Permanently delete a soft-deleted workspace.
usePurgeWorkspace(options?: MutationOpts<SuccessResponse, PurgeWorkspaceParams>)Types: SuccessResponse · PurgeWorkspaceParams
useRestoreWorkspace composite
Restore a soft-deleted workspace.
useRestoreWorkspace(options?: MutationOpts<Workspace, string>)Types: Workspace
useRetrieveWorkspace query
Get a workspace by ID.
useRetrieveWorkspace(id: string, options?: QueryOpts<Workspace>)Types: Workspace
useUpdateWorkspace mutation
Update a workspace.
useUpdateWorkspace(options?: MutationOpts<Workspace, UpdateWorkspaceParams>)Types: Workspace · UpdateWorkspaceParams
useUpdateWorkspaceEmail mutation
Update workspace email settings. Auto-invalidates email cache on success.
useUpdateWorkspaceEmail(options?: MutationOpts<WorkspaceEmailSettings, UpdateWorkspaceEmailSettingsParams>)Types: WorkspaceEmailSettings · UpdateWorkspaceEmailSettingsParams
const update = useUpdateWorkspaceEmail();
update.mutate({ workspaceId: "wsp_abc123", enabled: true });