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

# Workspaces

> client.workspaces — create and manage workspaces

```typescript theme={null}
const workspace = await airstore.workspaces.create({ name: 'my-workspace' })
```

Workspaces are the top-level container for connections, source views, members, and the virtual filesystem.

***

## create()

Create a new workspace.

```typescript theme={null}
const workspace = await airstore.workspaces.create({ name: 'acme-eng' })
```

**Parameters**

| Parameter | Type     | Required | Description                    |
| --------- | -------- | -------- | ------------------------------ |
| `name`    | `string` | Yes      | Display name for the workspace |

**Returns** `Promise<Workspace>`

| Field         | Type                  | Description                                 |
| ------------- | --------------------- | ------------------------------------------- |
| `external_id` | `string`              | Unique workspace identifier (UUID)          |
| `name`        | `string`              | Display name                                |
| `tenant_id`   | `string \| undefined` | Tenant ID, set when created by an org token |
| `created_at`  | `string`              | ISO 8601 timestamp                          |
| `updated_at`  | `string`              | ISO 8601 timestamp                          |

***

## list()

List workspaces accessible to the current token.

```typescript theme={null}
const workspaces = await airstore.workspaces.list()
```

Organization tokens see all workspaces in their tenant. Workspace tokens see only their workspace.

**Returns** `Promise<Workspace[]>`

***

## retrieve()

Get a single workspace by ID.

```typescript theme={null}
const workspace = await airstore.workspaces.retrieve('ws_abc123')
```

**Parameters**

| Parameter | Type     | Required | Description           |
| --------- | -------- | -------- | --------------------- |
| `id`      | `string` | Yes      | Workspace external ID |

**Returns** `Promise<Workspace>`

**Throws** `NotFoundError` if the workspace doesn't exist.

***

## del()

Delete a workspace and all its data.

```typescript theme={null}
await airstore.workspaces.del('ws_abc123')
```

<Warning>
  This permanently deletes all connections, source views, members, and tokens in the workspace.
</Warning>

**Parameters**

| Parameter | Type     | Required | Description           |
| --------- | -------- | -------- | --------------------- |
| `id`      | `string` | Yes      | Workspace external ID |

**Returns** `Promise<void>`
