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

# Admin client: workspaces

> Create, list, read, update and delete Paradime workspaces from Python with paradime.admin.workspaces, the workspaces client of the Administration API.

`paradime.admin.workspaces` creates, reads, changes and deletes workspaces. For the GraphQL operations, see [Workspaces](https://docs.paradime.io/developers/graphql-api/admin-api/workspaces).

> [!NOTE]
>
> **Prerequisites**
>
> * Reading workspaces and their settings works on every plan. Creating, updating, and deleting a workspace is part of the Enterprise plan. On other plans, these calls raise `AdminPlanUpgradeRequiredException`.
> * To create, update or delete a workspace, use a company API key with the **Workspace admin** capability group. Only company API keys can have this group.
> * To list workspaces or read their settings, the key needs **Workspace admin** or **Workspace metadata viewer**.
> * The admin client of the `paradime-io` package. See [Admin client](https://docs.paradime.io/developers/python-sdk/modules/admin/index).

The examples on this page use this client:

```python theme={"system"}
from paradime import Paradime

paradime = Paradime(api_endpoint="API_ENDPOINT", api_secret="prdm_cmp_...")
```

## Get a workspace

Reads a workspace and its settings.

**uid** `Optional[str]` (default: None)

The workspace's uid. Leave it out for the workspace that the API key targets: a workspace key's own workspace, or the `workspace_uid` of the client.

**Returns** `Optional[AdminWorkspace]`

The workspace, or `None` when the server returned none. A uid that the key can't reach raises `AdminNotFoundException`.

```python theme={"system"}
workspace = paradime.admin.workspaces.get("WORKSPACE_UID")
print(workspace.name, workspace.dbt_version, workspace.supported_dbt_versions)
```

## List workspaces

Iterates over the workspaces that the API key can reach, ordered by uid. A company API key reaches every workspace that it was granted.

**page\_size** `int` (default: 100)

How many workspaces to read per request, at most 500.

**Returns** `Iterator[AdminWorkspace]`

The workspaces, read one page at a time.

```python theme={"system"}
for workspace in paradime.admin.workspaces.list():
    print(workspace.uid, workspace.name, workspace.created_at)
```

## Create a workspace

Creates a workspace and lets the calling company API key reach it. Needs a company API key.

The new workspace has no members: invite its first admin with [`users.create`](https://docs.paradime.io/developers/python-sdk/modules/admin/users#invite-a-user). It comes with two environments: a default Bolt environment named Production, and a default agent environment named Agent that defers to it. Their slugs are generated: read them with [`environments.list`](https://docs.paradime.io/developers/python-sdk/modules/admin/environments#list-environments).

Sending the same name again returns the existing workspace. When that workspace runs another dbt™ version than the `dbt_version` you send, or the API key can't reach it, the call raises `AdminConflictException`. When the company has used every workspace its plan allows, the call raises `AdminPlanUpgradeRequiredException`.

**name** `str` *required*

The workspace's name, unique among the company's workspaces. The check ignores case.

**dbt\_version** `Optional[str]` (default: None)

The dbt™ version to run. The latest version by default.

**Returns** `AdminWorkspace`

The new workspace, or the existing one.

```python theme={"system"}
workspace = paradime.admin.workspaces.create("analytics")
print(workspace.uid)
```

## Update a workspace

Changes a workspace's settings. Needs a company API key. A setting you leave out keeps its value. `None` clears `default_branch` and `schedule_deployment_branch`. `name`, `dbt_version` and `dbt_partial_parsing` can't be `None`.

**workspace\_uid** `str` *required*

The uid of the workspace to change.

**name** `str`

A new name, unique among the company's workspaces.

**dbt\_version** `str`

The dbt™ version to run, one of the workspace's `supported_dbt_versions`. The change restarts the workspace's editors and redeploys its Bolt schedules.

**dbt\_partial\_parsing** `bool`

Whether dbt™ uses partial parsing.

**default\_branch** `Optional[str]`

The git branch that Paradime treats as the repository's default. `None` clears it. The change reparses the Bolt schedules.

**schedule\_deployment\_branch** `Optional[str]`

The git branch that Bolt schedules deploy from. `None` deploys from the default branch. The change reparses the Bolt schedules.

**Returns** `AdminWorkspace`

The workspace, with its new settings.

```python theme={"system"}
workspace = paradime.admin.workspaces.update(
    "WORKSPACE_UID",
    default_branch="main",
    schedule_deployment_branch="main",
)
```

## Delete a workspace

Deletes a workspace. Needs a company API key. Deleting it again is not an error. The company's last workspace can't be deleted: that call raises `AdminConflictException`.

**workspace\_uid** `str` *required*

The uid of the workspace to delete.

**Returns** `AdminWorkspace`

The deleted workspace. Its settings read as `None`.

```python theme={"system"}
deleted = paradime.admin.workspaces.delete("WORKSPACE_UID")
print(f"Deleted {deleted.name}")
```

## Types

Import the model from `paradime.apis.admin.workspaces.types`.

**AdminWorkspace** `model`

**fields**

**uid** `str`

The workspace's uid.

**name** `str`

The workspace's name.

**created\_at** `Optional[datetime]`

When the workspace was created.

**dbt\_version** `Optional[str]`

The dbt™ version the workspace runs.

**supported\_dbt\_versions** `Optional[List[str]]`

The dbt™ versions that `update` accepts.

**dbt\_partial\_parsing** `Optional[bool]`

Whether dbt™ partial parsing is on.

**default\_branch** `Optional[str]`

The branch Paradime treats as the default. `None` when unset.

**schedule\_deployment\_branch** `Optional[str]`

The branch Bolt schedules deploy from. `None` for the default branch.


## Related topics

- [Admin client](https://docs.paradime.io/developers/python-sdk/modules/admin/index.md)
- [Admin client: users](https://docs.paradime.io/developers/python-sdk/modules/admin/users.md)
- [Admin client: usage](https://docs.paradime.io/developers/python-sdk/modules/admin/usage.md)
- [Admin client: environments](https://docs.paradime.io/developers/python-sdk/modules/admin/environments.md)
- [Admin client: notifications](https://docs.paradime.io/developers/python-sdk/modules/admin/notifications.md)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.