# Create pools

URL: https://docs.hanzo.ai/docs/openapi/git/post-git-pools

> Records the capacity an org has, and answers with the secret a runner daemon presents to enter it.

`POST /v1/git/pools`

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

|               |                                        |
| ------------- | -------------------------------------- |
| **Address**   | `https://api.hanzo.ai/v1/git/pools`    |
| **Method**    | `POST`                                 |
| **Operation** | `post_git_pools`                       |
| **Auth**      | `Authorization: Bearer $HANZO_API_KEY` |

Records the capacity an org has, and answers with the secret a
runner daemon presents to enter it.

Declaring is the ONLY way capacity comes to exist: a daemon cannot register
against a pool nobody declared, because the secret it would have to present
does not exist until this runs. Re-declaring an existing pool replaces its
labels and mints a fresh secret; runners already inside it keep working.

## Request

2 fields, body `application/json` (required).

| Field    | In   | Type      | Required | Description                                                   |
| -------- | ---- | --------- | -------- | ------------------------------------------------------------- |
| `labels` | body | string\[] | —        | Labels are what a workflow's `runs-on:` selects this pool by. |
| `name`   | body | string    | —        | Name is the pool's handle in this org, e.g. "evo" or "spark". |

## Response

| Status    | Body             | Meaning |
| --------- | ---------------- | ------- |
| `201`     | git.poolDeclared | created |
| `default` | problem-details  | refused |

`201` body — 6 fields.

| Field            | In   | Type            | Always | Description                                                   |
| ---------------- | ---- | --------------- | ------ | ------------------------------------------------------------- |
| `pool`           | body | git.poolView    | —      |                                                               |
| `pool.createdAt` | body | integer (int64) | —      | CreatedAt is when the pool was declared, in unix seconds.     |
| `pool.labels`    | body | string\[]       | —      | Labels are what a workflow's `runs-on:` selects this pool by. |
| `pool.name`      | body | string          | —      | Name is the pool's handle in this org.                        |
| `pool.runners`   | body | integer (int64) | —      | Runners is how many daemons have entered the pool.            |
| `secret`         | body | string          | —      | Secret is what a runner daemon presents to enter the pool.    |

Failure carries the platform error shape — see [Errors](https://docs.hanzo.ai/docs/errors).

## Examples

**CLI**

```bash
hanzo git pools create
```

**SDK**

**.ts**

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

const api = new GitApi(new Configuration({ accessToken: process.env.HANZO_API_KEY }));
const { data } = await api.postGitPools({ labels: ["<labels>"], name: "<name>" });
```

**.py**

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

client = ApiClient(Configuration(access_token=os.environ["HANZO_API_KEY"]))
result = GitApi(client).post_git_pools(labels=["<labels>"], name="<name>")
```

**.go**

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

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

**.rs**

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

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

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

**.java**

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

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

var result = new GitApi(client).postGitPools();
```

**HTTP**

```bash
curl -X POST https://api.hanzo.ai/v1/git/pools \
  -H "Authorization: Bearer $HANZO_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
       "labels": [
         "<labels>"
       ],
       "name": "<name>"
     }'
```

**MCP**

MCP reaches **git** through the `git` tool, which names its 38 operations with its own verbs — this one among them, under a name only MCP declares. `describe` explains any of them:

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

---

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