OpenapiShare
Returns the tunnel shares the caller's org currently has open, across every…
Returns the tunnel shares the caller's org currently has open, across every environment that org has enabled.
GET /v1/share
| Address | https://api.hanzo.ai/v1/share |
| Method | GET |
| Operation | get_share |
| Auth | Authorization: Bearer $HANZO_API_KEY |
Returns the tunnel shares the caller's org currently has open, across every environment that org has enabled. It is a READ and it degrades honestly: an unconfigured deployment, an org that has not provisioned yet, and an unreachable controller all answer an EMPTY list at 200 rather than an error, so the console never error-toasts on load.
Request
GET /v1/share takes no parameters and no body — the credential is the whole request.
Response
| Status | Body | Meaning |
|---|---|---|
200 | sharesOut | ok |
200 body — 6 fields.
| Field | In | Type | Always | Description |
|---|---|---|---|---|
shares | body | shareView[] | — | Shares is the org's active shares — empty rather than absent when there are none, or when the controller cannot be reached. |
shares[].backend | body | string | — | Backend is the local endpoint the share proxies to. |
shares[].backendMode | body | string | — | BackendMode is how the tunnel serves the backend, e.g. |
shares[].createdAt | body | integer | — | CreatedAt is when the share was opened, unix seconds. |
shares[].token | body | string | — | Token is the share's own identifier, the leaf of its public URL. |
shares[].url | body | string | — | URL is the share's public address, rendered from the deployment's URL template. |
Failure carries the platform error shape — see Errors.
Examples
hanzo share getimport { Configuration, ShareApi } from 'hanzoai';
const api = new ShareApi(new Configuration({ accessToken: process.env.HANZO_API_KEY }));
const { data } = await api.getShare();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).get_share()cfg := cloud.NewConfiguration()
cfg.AddDefaultHeader("Authorization", "Bearer "+os.Getenv("HANZO_API_KEY"))
client := cloud.NewAPIClient(cfg)
resp, _, err := client.ShareAPI.GetShare(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::get_share(&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).getShare();curl https://api.hanzo.ai/v1/share \
-H "Authorization: Bearer $HANZO_API_KEY"Tool share, op get_share — POST the JSON-RPC envelope to https://api.hanzo.ai/v1/mcp.
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": "share",
"arguments": {
"op": "get_share",
"input": {}
}
}
}'How is this guide?