Returns the caller's own public-listing preference and their org's, each with…
Returns the caller's own public-listing preference and their org's, each with whether the caller may change it.
GET /v1/leaderboard/optin
| Address | https://api.hanzo.ai/v1/leaderboard/optin |
| Method | GET |
| Operation | get_leaderboard_optin |
| Auth | Authorization: Bearer $HANZO_API_KEY |
Returns the caller's own public-listing preference and their org's, each with whether the caller may change it. Public listing is opt-in and private by default, so a fresh caller reads listed=false for both.
Request
GET /v1/leaderboard/optin takes no parameters and no body — the credential is the whole request.
Response
| Status | Body | Meaning |
|---|---|---|
200 | optinView | ok |
200 body — 8 fields.
| Field | In | Type | Always | Description |
|---|---|---|---|---|
org | body | orgOptinView | — | |
org.canManage | body | boolean | — | CanManage is true only for an admin of this org (or a platform SuperAdmin) — the callers whose write of the org preference will be accepted. |
org.display | body | string | — | Display is the name shown for the org on that board. |
org.listed | body | boolean | — | Listed is true when the org has opted onto the cross-org global board. |
user | body | userOptinView | — | |
user.canSet | body | boolean | — | CanSet is false when the caller's ledger identity cannot be resolved (no user name on the principal). |
user.handle | body | string | — | Handle is the display name on the caller's listed row. |
user.listed | body | boolean | — | Listed is true when the caller's board row is published under Handle to other viewers. |
Failure carries the platform error shape — see Errors.
Examples
hanzo has no subcommand for this operation — the CLI serves only what cloud's live route table confirms. Use HTTP or an SDK.
import { Configuration, LeaderboardApi } from 'hanzoai';
const api = new LeaderboardApi(new Configuration({ accessToken: process.env.HANZO_API_KEY }));
const { data } = await api.getLeaderboardOptin();from hanzoai.cloud import ApiClient, Configuration
from hanzoai.cloud.api import LeaderboardApi
client = ApiClient(Configuration(access_token=os.environ["HANZO_API_KEY"]))
result = LeaderboardApi(client).get_leaderboard_optin()cfg := cloud.NewConfiguration()
cfg.AddDefaultHeader("Authorization", "Bearer "+os.Getenv("HANZO_API_KEY"))
client := cloud.NewAPIClient(cfg)
resp, _, err := client.LeaderboardAPI.GetLeaderboardOptin(context.Background()).Execute()
if err != nil {
return err
}use hanzo_cloud::apis::{configuration::Configuration, leaderboard_api};
let mut cfg = Configuration::new();
cfg.bearer_access_token = std::env::var("HANZO_API_KEY").ok();
let result = leaderboard_api::get_leaderboard_optin(&cfg, Default::default()).await?;import ai.hanzo.cloud.ApiClient;
import ai.hanzo.cloud.api.LeaderboardApi;
ApiClient client = new ApiClient();
client.setRequestInterceptor(b -> b.header("Authorization", "Bearer " + System.getenv("HANZO_API_KEY")));
var result = new LeaderboardApi(client).getLeaderboardOptin();The method above is the one at the current release of the document. [email protected] (npm) and [email protected] (PyPI) were generated from an earlier release, where this operation carried a different id, so it spells the method differently — regenerating the clients is what makes the two agree. SDKs →
curl https://api.hanzo.ai/v1/leaderboard/optin \
-H "Authorization: Bearer $HANZO_API_KEY"The door reaches leaderboard through the leaderboard tool, which names its 6 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_usage_activity"
}
}
}'How is this guide?