# Enable share

URL: https://docs.hanzo.ai/docs/openapi/share/post-share-enable

> Provisions the caller org's tunnel account and returns the credential the `hanzo share` CLI needs to run a tunnel.

`POST /v1/share/enable`

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

|               |                                        |
| ------------- | -------------------------------------- |
| **Address**   | `https://api.hanzo.ai/v1/share/enable` |
| **Method**    | `POST`                                 |
| **Operation** | `post_share_enable`                    |
| **Auth**      | `Authorization: Bearer $HANZO_API_KEY` |

Provisions the caller org's tunnel account and returns the credential the
`hanzo share` CLI needs to run a tunnel. It is idempotent: the account is keyed
deterministically off the VALIDATED org, so a repeat call hands back the same
account rather than creating a second one, and a caller can only ever provision
their OWN org's account. 503 when the deployment has no share controller
configured; 502 when that controller is unreachable.

## Request

The document declares no body for `POST /v1/share/enable`. The handler is typed in cloud but its shape is not yet emitted, so the fields are not listed here — ask MCP's `describe` for `post_share_enable`, which answers from the running route.

## Response

| Status    | Body             | Meaning |
| --------- | ---------------- | ------- |
| `200`     | share.enableResp | ok      |
| `default` | problem-details  | refused |

`200` body — 4 fields.

| Field          | In   | Type   | Always | Description                                                                                                     |
| -------------- | ---- | ------ | ------ | --------------------------------------------------------------------------------------------------------------- |
| `accountToken` | body | string | —      | AccountToken is the org's own tunnel-account credential.                                                        |
| `controller`   | body | string | —      | Controller is the public controller endpoint the CLI enables against.                                           |
| `namespace`    | body | string | —      | Namespace is the public frontend a share is published into, when the deployment names one.                      |
| `urlTemplate`  | body | string | —      | URLTemplate is the shape a share token expands to, so the CLI can print the resulting URL without asking again. |

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

## Examples

**CLI**

```bash
hanzo share enable
```

**SDK**

**.ts**

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

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

**.py**

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

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

**.go**

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

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

**.rs**

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

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

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

**.java**

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

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

var result = new ShareApi(client).postShareEnable();
```

**HTTP**

```bash
curl -X POST https://api.hanzo.ai/v1/share/enable \
  -H "Authorization: Bearer $HANZO_API_KEY"
```

**MCP**

MCP reaches **share** through the `share` tool, which names its 2 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_shares"
         }
       }
     }'
```

---

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