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

# Spaces

> Manage spaces programmatically within your Arize AX organization using the TypeScript SDK.

<Note>
  The `spaces` functions are currently in **BETA**. The API may change without notice. A one-time warning is emitted on first use.
</Note>

## List Spaces

```typescript theme={null}
import { listSpaces } from "@arizeai/ax-client";

const { data: spaces, pagination } = await listSpaces({
  organizationId: "your_organization_id",  // optional
  name: "platform",  // substring filter on space name (optional)
  limit: 10,
});
```

## Create a Space

```typescript theme={null}
import { createSpace } from "@arizeai/ax-client";

const space = await createSpace({
  organizationId: "your_organization_id",
  name: "your_space_name",
  description: "optional description",
});
```

## Get a Space

```typescript theme={null}
import { getSpace } from "@arizeai/ax-client";

// By space ID
const space = await getSpace({ space: "your_space_id" });

// By space name
const space = await getSpace({ space: "my-space" });
```

## Update a Space

```typescript theme={null}
import { updateSpace } from "@arizeai/ax-client";

const space = await updateSpace({
  space: "my-space",  // space name or ID
  name: "updated_space_name",
  description: "updated description",  // optional
});
```

## Delete a Space

<Warning>This operation is irreversible. Deleting a space permanently removes all resources that belong to it (models, monitors, dashboards, datasets, custom metrics, etc.).</Warning>

```typescript theme={null}
import { deleteSpace } from "@arizeai/ax-client";

await deleteSpace({ space: "my-space" });  // space name or ID
```

## Add a User to a Space

Uses upsert semantics — if the user is already a member, their role is updated. The user must already be a member of the space's parent organization. Requires space admin role or `ROLE_BINDING_CREATE` permission.

```typescript theme={null}
import { addSpaceUser } from "@arizeai/ax-client";

const membership = await addSpaceUser({
  spaceId: "your_space_id",
  userId: "your_user_id",
  role: { type: "predefined", name: "member" },
});
```

## Remove a User from a Space

Removes the user's space membership and all RBAC role bindings on the space. Requires space admin role or `ROLE_BINDING_DELETE` permission.

```typescript theme={null}
import { removeSpaceUser } from "@arizeai/ax-client";

await removeSpaceUser({
  spaceId: "your_space_id",
  userId: "your_user_id",
});
```
