---
title: WorkspacesClient
sidebar_label: WorkspacesClient
sidebar_position: 1
---

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

<!-- Generated by scripts/generate_sdk_reference.py. Do not edit directly. -->

# WorkspacesClient

```python
from lium.sdk import WorkspacesClient
```

Defined in `lium.sdk.workspaces`.

```python
WorkspacesClient(lium: lium.sdk.client.Lium)
```

## Properties

| Name | Type | Description |
| --- | --- | --- |
| `session_token` | Optional[str] |  |

## Methods

| Method | Description |
| --- | --- |
| [`enabled`](#enabled) | Whether the server has workspaces switched on: GET /users/me carries workspace. |
| [`current`](#current) | The workspace this client's API key acts in, or None on a server without workspaces. |
| [`require_enabled`](#require_enabled) |  |
| [`login`](#login) | Sign in with e-mail and password (POST /users/login) and keep the token on this client. |
| [`list`](#list) |  |
| [`get`](#get) |  |
| [`members`](#members) |  |
| [`resolve`](#resolve) | A workspace by name (case-insensitive) or id among those this client can see. |
| [`create`](#create) |  |
| [`invite`](#invite) | POST /workspaces/\{id\}/invitations: the address gets a link, an account or not (DAH-3031). |
| [`remove_member`](#remove_member) |  |
| [`transfer_billing`](#transfer_billing) |  |
| [`delete`](#delete) |  |
| [`list_keys`](#list_keys) |  |
| [`create_key`](#create_key) | POST /keys in the named workspace: the key is bound to it for good (DAH-2986). |

### enabled

```python
def enabled() -> bool:
```

Whether the server has workspaces switched on: ``GET /users/me`` carries ``workspace``.

### current

```python
def current() -> Optional[lium.sdk.models.WorkspaceInfo]:
```

The workspace this client's API key acts in, or None on a server without workspaces.

### require_enabled

```python
def require_enabled() -> lium.sdk.models.WorkspaceInfo:
```

### login

```python
def login(email: str, password: str) -> str:
```

Sign in with e-mail and password (``POST /users/login``) and keep the token on this client.

### list

```python
def list() -> List[lium.sdk.models.WorkspaceInfo]:
```

### get

```python
def get(workspace_id: str) -> lium.sdk.models.WorkspaceInfo:
```

### members

```python
def members(workspace_id: str) -> List[lium.sdk.models.WorkspaceMember]:
```

### resolve

```python
def resolve(name_or_id: str) -> lium.sdk.models.WorkspaceInfo:
```

A workspace by name (case-insensitive) or id among those this client can see.

Names are not unique on the server: two visible workspaces with that name is an error that
names both ids. On a server without workspaces this says so (`NOT_ENABLED`) instead of
reading a route that is not there.

### create

```python
def create(name: str) -> lium.sdk.models.WorkspaceInfo:
```

### invite

```python
def invite(workspace_id: str, email: str, role: str = 'member') -> Dict[str, Any]:
```

``POST /workspaces/\{id\}/invitations``: the address gets a link, an account or not (DAH-3031).

### remove_member

```python
def remove_member(workspace_id: str, user_id: str) -> Dict[str, Any]:
```

### transfer_billing

```python
def transfer_billing(workspace_id: str, user_id: str) -> lium.sdk.models.WorkspaceInfo:
```

### delete

```python
def delete(workspace_id: str) -> Dict[str, Any]:
```

### list_keys

```python
def list_keys(workspace_id: str) -> List[Dict[str, Any]]:
```

### create_key

```python
def create_key(name: str, workspace_id: str) -> Dict[str, Any]:
```

``POST /keys`` in the named workspace: the key is bound to it for good (DAH-2986).
