# Space

URL: https://docs.hanzo.ai/docs/openapi/space

> Where work lives: drives, folders and the files in them.

Also for this capability: **API** · [CLI](https://docs.hanzo.ai/docs/cli/space) · [MCP](https://docs.hanzo.ai/docs/mcp-tools/space) · [SDKs](https://docs.hanzo.ai/docs/sdks)

Where work lives: drives, folders and the files in them.

> [All API references →](https://docs.hanzo.ai/docs/openapi) · [Get started →](https://docs.hanzo.ai/docs/guides)

|                |                                        |
| -------------- | -------------------------------------- |
| **Base URL**   | `https://api.hanzo.ai`                 |
| **Operations** | 7                                      |
| **Auth**       | `Authorization: Bearer $HANZO_API_KEY` |

## Specification

Specification pending — no HIP in [hanzoai/hips](https://github.com/hanzoai/hips) declares `capability: space` yet. What this capability serves is below, from the API document; what it is — the store it owns, how it meters, what it publishes — is written as a HIP under HIP-0139.

## Four surfaces

| Surface  | Reaches this capability as                    | Coverage                                                                  |
| -------- | --------------------------------------------- | ------------------------------------------------------------------------- |
| **REST** | `space` at its own prefix                     | 7 operations                                                              |
| **CLI**  | `hanzo space …`                               | 7 of 7                                                                    |
| **SDK**  | `SpaceApi` in every published client          | 7 methods                                                                 |
| **MCP**  | tool `space` on `https://api.hanzo.ai/v1/mcp` | 7 operations, 1 under the document's own id — ask `describe` for the rest |

## Quickstart

```bash
export HANZO_API_KEY=sk-...   # console.hanzo.ai → API keys
```

Then the first call — a read that needs nothing but the key. `GET /v1/space/health`, operation `get_space_health`:

**CLI**

```bash
hanzo space health
```

**SDK**

**.ts**

```ts
import { Configuration, SpaceApi } from 'hanzoai';

const api = new SpaceApi(new Configuration({ accessToken: process.env.HANZO_API_KEY }));
const { data } = await api.getSpaceHealth();
```

**.py**

```python
from hanzoai.cloud import ApiClient, Configuration
from hanzoai.cloud.api import SpaceApi

client = ApiClient(Configuration(access_token=os.environ["HANZO_API_KEY"]))
result = SpaceApi(client).get_space_health()
```

**.go**

```go
cfg := hanzoai.NewConfiguration()
cfg.AddDefaultHeader("Authorization", "Bearer "+os.Getenv("HANZO_API_KEY"))
client := hanzoai.NewAPIClient(cfg)

resp, _, err := client.SpaceAPI.GetSpaceHealth(context.Background()).Execute()
if err != nil {
	return err
}
```

**.rs**

```rust
use hanzo_client::apis::{configuration::Configuration, space_api};

let mut cfg = Configuration::new();
cfg.bearer_access_token = std::env::var("HANZO_API_KEY").ok();

let result = space_api::get_space_health(&cfg, Default::default()).await?;
```

**.java**

```java
import ai.hanzo.cloud.ApiClient;
import ai.hanzo.cloud.api.SpaceApi;

ApiClient client = new ApiClient();
client.setBearerToken(System.getenv("HANZO_API_KEY"));

var result = new SpaceApi(client).getSpaceHealth();
```

**HTTP**

```bash
curl https://api.hanzo.ai/v1/space/health \
  -H "Authorization: Bearer $HANZO_API_KEY"
```

**MCP**

Tool `space`, op `get_space_health` — POST the JSON-RPC envelope to `https://api.hanzo.ai/v1/mcp`.

```bash
curl -X POST https://api.hanzo.ai/v1/mcp \
  -H "Authorization: Bearer $HANZO_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
       "jsonrpc": "2.0",
       "id": 1,
       "method": "tools/call",
       "params": {
         "name": "space",
         "arguments": {
           "op": "get_space_health",
           "input": {}
         }
       }
     }'
```

Answers `200` with `object` — ok.

## Endpoints

| Endpoint                                                                                                                          | What it does                                                        |
| --------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------- |
| [`GET /v1/space/{space}/drives/{drive}/files`](https://docs.hanzo.ai/docs/openapi/space/get-space-by-space-drives-by-drive-files) | Lists one folder level of a drive.                                  |
| [`DELETE /v1/space/{space}/drives/{drive}`](https://docs.hanzo.ai/docs/openapi/space/delete-space-by-space-drives-by-drive)       | Removes an EMPTY drive and answers 204.                             |
| [`GET /v1/space/{space}/drives`](https://docs.hanzo.ai/docs/openapi/space/get-space-by-space-drives)                              | Lists a space's drives.                                             |
| [`POST /v1/space/{space}/drives`](https://docs.hanzo.ai/docs/openapi/space/post-space-by-space-drives)                            | Makes a new drive in a space and answers 201 with it.               |
| [`GET /v1/space/health`](https://docs.hanzo.ai/docs/openapi/space/get-space-health)                                               | Reports whether this deployment can serve spaces, drives and files. |
| [`GET /v1/space/spaces`](https://docs.hanzo.ai/docs/openapi/space/get-space-spaces)                                               | Lists the caller org's own spaces.                                  |
| [`POST /v1/space/spaces`](https://docs.hanzo.ai/docs/openapi/space/post-space-spaces)                                             | Makes a new space for the caller's org and answers 201 with it.     |

---

[All Hanzo APIs](https://docs.hanzo.ai/docs/openapi) · [Interactive reference](https://docs.hanzo.ai/docs/openapi/reference)
