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

# Workspaces Methods

> HoneyHive TypeScript Control Plane SDK Workspaces namespace reference

#### create

> **create**(`request`: [`CreateWorkspaceRequest`](/v2/control-plane-sdk-reference/typescript/ref/workspaces/CreateWorkspaceRequest)): `Promise`\<[`CreateWorkspaceResponse`](/v2/control-plane-sdk-reference/typescript/ref/workspaces/CreateWorkspaceResponse)>

Create a workspace

Create a workspace in a virtual data plane. The parent virtual data plane is identified by
the `virtual_dataplane_id` path parameter alone; the `x-hh-dataplane-id` header does not
participate. Your organization's virtual data plane ids are listed on the API keys page of
your organization settings in the HoneyHive app. Most organizations have exactly one.

The new workspace contains no projects. Create one with
`POST /v1/workspaces/{workspace_id}/projects` if you need it, because a workspace with no
projects has nowhere to log events.

The optional `workspace_creator` field names the user (by email) who receives the
workspace-creator membership on the new workspace. The named user must already be a member
of the virtual data plane. When omitted, the workspace is created without any membership.
The field is only accepted on API-key-initiated requests. User-initiated creation always
makes the calling user the creator, so sending the field returns a 400.

The roles that membership carries come from your organization's role configuration. An
organization that grants no role on workspace creation is a supported case: the request
still succeeds and the named user receives no access. A 200 response is not by itself
confirmation that the named user was granted anything.

A `workspace_creator` who is already signed in does not see the new workspace immediately.
A session captures its scope tree and permission grants when it is created, so a membership
granted afterwards is not reflected in it. Creating the workspace marks that user's sessions
for refresh, and the refresh takes effect on their next request to the control plane, so an
idle browser tab may need a page reload.

#### delete

> **delete**(`request`: [`DeleteWorkspaceRequest`](/v2/control-plane-sdk-reference/typescript/ref/workspaces/DeleteWorkspaceRequest)): `Promise`\<[`DeleteWorkspaceResponse`](/v2/control-plane-sdk-reference/typescript/ref/workspaces/DeleteWorkspaceResponse)>

Delete a workspace

Delete a workspace. The workspace is soft-deleted (archived) and no longer appears in reads;
the response returns the archived workspace. The workspace is identified by the
`workspace_id` path parameter alone; the `x-hh-workspace-id` header does not participate.

**Deleting a workspace also archives every project inside it**, so the events, datasets,
and evaluations in those projects are no longer reachable. Because that reaches well
beyond the resource named in the URL, a workspace that still has active projects is
rejected with a 409 unless the request sets `dangerously_delete_child_scopes=true`.
Projects that were already archived do not count, so a workspace emptied one project at a
time deletes without the flag.

The response describes only the workspace. It does not enumerate the projects archived
alongside it, so read them first if you need that list.

#### get

> **get**(`request`: [`GetWorkspaceRequest`](/v2/control-plane-sdk-reference/typescript/ref/workspaces/GetWorkspaceRequest)): `Promise`\<[`GetWorkspaceResponse`](/v2/control-plane-sdk-reference/typescript/ref/workspaces/GetWorkspaceResponse)>

Get a workspace

Retrieve a single workspace by id. The workspace is identified by the `workspace_id` path
parameter alone; the `x-hh-workspace-id` header does not participate.

The returned `name` is the workspace's display name. The globally unique slug the workspace
was assigned at creation is an internal detail and is not part of this contract.

#### update

> **update**(`request`: [`UpdateWorkspaceRequest`](/v2/control-plane-sdk-reference/typescript/ref/workspaces/UpdateWorkspaceRequest)): `Promise`\<[`UpdateWorkspaceResponse`](/v2/control-plane-sdk-reference/typescript/ref/workspaces/UpdateWorkspaceResponse)>

Update a workspace

Update a workspace's display name and/or description. The workspace is identified by the
`workspace_id` path parameter alone; the `x-hh-workspace-id` header does not participate.
Only fields included in the request body are modified.

The workspace's internal slug is not part of this contract and cannot be changed here.


## Related topics

- [Projects Methods](/v2/control-plane-sdk-reference/typescript/ref/projects/index.md)
- [Virtual Dataplanes Methods](/v2/control-plane-sdk-reference/typescript/ref/virtual-dataplanes/index.md)
- [Workspaces](/v2/cli-reference/ref/workspaces.md)
