Connect author

Enrols the caller's org in the author program at status "connected" and returns its enrolment, including the verify code the file method needs.

POST /v1/author/connect

Addresshttps://api.hanzo.ai/v1/author/connect
MethodPOST
Operationpost_author_connect
AuthAuthorization: Bearer $HANZO_API_KEY

Enrols the caller's org in the author program at status "connected" and returns its enrolment, including the verify code the file method needs. It is IDEMPOTENT: a second call returns the same enrolment rather than a conflict.

The forge login is taken from IAM's LINKED account for the provider when there is one — that is identity proof, not a claim — and only otherwise from the login in the body, which then has to be proven per repository. Connecting does not admit an org to earning: a platform reviewer approves that separately.

Answers 201 when it enrolled the org and 200 when it found an existing enrolment.

Request

3 fields, body application/json (required).

FieldInTypeRequiredDescription
githubLoginbodystring—GithubLogin is the account to link.
loginbodystring—Login is the provider-neutral alias for GithubLogin, preferred when both are sent.
providerbodystring—Provider is the forge to enrol with: github (the default) or gitlab.

Response

StatusBodyMeaning
200author.enrolmentok
defaultproblem-detailsrefused

200 body — 9 fields.

FieldInTypeAlwaysDescription
createdbodyboolean—Created reports whether this call enrolled the org (201) or found an existing enrolment (200).
githubLoginbodystring—GithubLogin is the linked forge account.
idbodystring—ID is the author record's server-minted handle, "aut_"-prefixed.
shareBpsbodyinteger (int64)—ShareBps is this author's royalty share in basis points of the spend their deployed work generates.
statusbodystring—Status is connected, approved or suspended.
verifiedbodyboolean—Verified reports whether any repository or owner claim has been proven yet.
verifyCodebodystring—VerifyCode is this author's stable proof token — the value a repository's verify file must carry.
verifyFilebodystring—VerifyFile is the repo-root file the file method reads, on the default branch.
verifySnippetbodystring—VerifySnippet is that file's exact contents, ready to commit.

Failure carries the platform error shape — see Errors.

Examples

hanzo author connect
import { Configuration, AuthorApi } from 'hanzoai';

const api = new AuthorApi(new Configuration({ accessToken: process.env.HANZO_API_KEY }));
const { data } = await api.postAuthorConnect({ githubLogin: "<githubLogin>", login: "<login>" });
from hanzoai.cloud import ApiClient, Configuration
from hanzoai.cloud.api import AuthorApi

client = ApiClient(Configuration(access_token=os.environ["HANZO_API_KEY"]))
result = AuthorApi(client).post_author_connect(github_login="<githubLogin>", login="<login>")
cfg := hanzoai.NewConfiguration()
cfg.AddDefaultHeader("Authorization", "Bearer "+os.Getenv("HANZO_API_KEY"))
client := hanzoai.NewAPIClient(cfg)

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

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

let result = author_api::post_author_connect(&cfg, Default::default()).await?;
import ai.hanzo.cloud.ApiClient;
import ai.hanzo.cloud.api.AuthorApi;

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

var result = new AuthorApi(client).postAuthorConnect();
curl -X POST https://api.hanzo.ai/v1/author/connect \
  -H "Authorization: Bearer $HANZO_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
       "githubLogin": "<githubLogin>",
       "login": "<login>"
     }'

MCP reaches author through the author tool, which names its 5 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_authors"
         }
       }
     }'

Author API · All Hanzo APIs · Interactive reference

Was this page useful?