Referral

Referral ATTRIBUTION: who referred whom, and whether that referee ever became a real customer.

Also for this capability: API · CLI · SDKs

Referral ATTRIBUTION: who referred whom, and whether that referee ever became a real customer.

Base URLhttps://api.hanzo.ai
Operations2
AuthAuthorization: Bearer $HANZO_API_KEY

Specification

Specification pending — no HIP in hanzoai/hips declares capability: referral yet. What this capability serves is below, from the API document; what it is — the store it owns, how it meters, what it publishes — is written as a HIP under HIP-0139.

Four surfaces

SurfaceReaches this capability asCoverage
RESTreferral at its own prefix2 operations
CLIhanzo referral …2 of 2
SDKReferralApi in every published client2 methods
MCPtool referral on https://api.hanzo.ai/v1/mcp2 operations, 0 under the document's own id — ask describe for the rest

Quickstart

export HANZO_API_KEY=sk-...   # console.hanzo.ai → API keys

Then the first call — a read that needs nothing but the key. GET /v1/referral, operation get_referral:

hanzo referral get
import { Configuration, ReferralApi } from 'hanzoai';

const api = new ReferralApi(new Configuration({ accessToken: process.env.HANZO_API_KEY }));
const { data } = await api.getReferral();
from hanzoai.cloud import ApiClient, Configuration
from hanzoai.cloud.api import ReferralApi

client = ApiClient(Configuration(access_token=os.environ["HANZO_API_KEY"]))
result = ReferralApi(client).get_referral()
cfg := hanzoai.NewConfiguration()
cfg.AddDefaultHeader("Authorization", "Bearer "+os.Getenv("HANZO_API_KEY"))
client := hanzoai.NewAPIClient(cfg)

resp, _, err := client.ReferralAPI.GetReferral(context.Background()).Execute()
if err != nil {
	return err
}
use hanzo_client::apis::{configuration::Configuration, referral_api};

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

let result = referral_api::get_referral(&cfg, Default::default()).await?;
import ai.hanzo.cloud.ApiClient;
import ai.hanzo.cloud.api.ReferralApi;

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

var result = new ReferralApi(client).getReferral();
curl https://api.hanzo.ai/v1/referral \
  -H "Authorization: Bearer $HANZO_API_KEY"

MCP reaches referral through the referral 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:

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_referrals"
         }
       }
     }'

Answers 200 with object — ok.

Endpoints

EndpointWhat it does
POST /v1/referral/claimRecords that the caller's org signed up through a referral code.
GET /v1/referralReturns the caller's referral code, share link and the referrals they have made.

All Hanzo APIs · Interactive reference

Was this page useful?