Enable provisions the caller org's tunnel account and returns the credential…
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
| Address | https://api.hanzo.ai/v1/share/enable |
| Method | POST |
| Operation | post_share_enable |
| Auth | Authorization: Bearer $HANZO_API_KEY |
Enable 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 the MCP door's describe for post_share_enable, which answers from the running route.
Response
| Status | Body | Meaning |
|---|---|---|
200 | enableResp | ok |
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.
Examples
hanzo share enableimport { Configuration, ShareApi } from 'hanzoai';
const api = new ShareApi(new Configuration({ accessToken: process.env.HANZO_API_KEY }));
const { data } = await api.postShareEnable();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()cfg := cloud.NewConfiguration()
cfg.AddDefaultHeader("Authorization", "Bearer "+os.Getenv("HANZO_API_KEY"))
client := cloud.NewAPIClient(cfg)
resp, _, err := client.ShareAPI.PostShareEnable(context.Background()).Execute()
if err != nil {
return err
}use hanzo_cloud::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?;import ai.hanzo.cloud.ApiClient;
import ai.hanzo.cloud.api.ShareApi;
ApiClient client = new ApiClient();
client.setRequestInterceptor(b -> b.header("Authorization", "Bearer " + System.getenv("HANZO_API_KEY")));
var result = new ShareApi(client).postShareEnable();curl -X POST https://api.hanzo.ai/v1/share/enable \
-H "Authorization: Bearer $HANZO_API_KEY"The door reaches share through the share tool, which names its 2 operations with its own verbs — this one among them, under a name only the door declares. describe explains any of them:
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": "get_share"
}
}
}'How is this guide?