Hanzo
OpenapiReferral

Returns the caller's referral code, share link and the referrals they have made.

Returns the caller's referral code, share link and the referrals they have made.

GET /v1/referral

Addresshttps://api.hanzo.ai/v1/referral
MethodGET
Operationget_referral
AuthAuthorization: Bearer $HANZO_API_KEY

Returns the caller's referral code, share link and the referrals they have made.

The code is a stable, deterministic function of the org, so the link in this response is the same one every time. Each row carries the referee and the status of that attribution.

IT IS A PURE READ. It advances no referral, grants nothing and deposits nothing — a GET reports state, it never changes it. Qualification is the admin sweep's job (POST /v1/admin/referral/sweep). The one row this handler can write is the caller's OWN code-directory entry (EnsureCode), which materialises a value deriveCode already computes deterministically from the org id so the code has an O(1) reverse lookup; it carries no money, no referral state and no other tenant.

Request

GET /v1/referral takes no parameters and no body — the credential is the whole request.

Response

StatusBodyMeaning
200myReferralsok

200 body — 12 fields.

FieldInTypeAlwaysDescription
codebodystringCode is the org's STABLE referral code — a deterministic function of the org id, so it never changes and never has to be stored to be reproduced.
countsbodystatusCounts
counts.qualifiedbodyintegerQualified is how many referees have made metered spend.
counts.signupbodyintegerSignup is how many referees have signed up but not yet spent.
counts.totalbodyintegerTotal is every referral this org has made.
linkbodystringLink is the shareable signup link carrying the code, on the brand's own host.
referralsbodymyReferralView[]Referrals is one row per org that signed up with this code.
referrals[].createdAtbodyintegerCreatedAt is when the referral was recorded, as a Unix timestamp.
referrals[].idbodystringID is the referral's handle.
referrals[].qualifiedAtbodyintegerQualifiedAt is when the referee first made metered spend, as a Unix timestamp; 0 while the referral is still pending.
referrals[].refereebodystringReferee is the org that signed up with my code.
referrals[].statusbodystringStatus is the referral's lifecycle state: "signup" until the referee makes metered spend, then "qualified".

Failure carries the platform error shape — see Errors.

Examples

hanzo referrals get

Referral API · All Hanzo APIs · Interactive reference

How is this guide?

On this page