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
| Address | https://api.hanzo.ai/v1/author/connect |
| Method | POST |
| Operation | post_author_connect |
| Auth | Authorization: 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).
| Field | In | Type | Required | Description |
|---|---|---|---|---|
githubLogin | body | string | — | GithubLogin is the account to link. |
login | body | string | — | Login is the provider-neutral alias for GithubLogin, preferred when both are sent. |
provider | body | string | — | Provider is the forge to enrol with: github (the default) or gitlab. |
Response
| Status | Body | Meaning |
|---|---|---|
200 | enrolment | ok |
200 body — 9 fields.
| Field | In | Type | Always | Description |
|---|---|---|---|---|
created | body | boolean | — | Created reports whether this call enrolled the org (201) or found an existing enrolment (200). |
githubLogin | body | string | — | GithubLogin is the linked forge account. |
id | body | string | — | ID is the author record's server-minted handle, "aut_"-prefixed. |
shareBps | body | integer | — | ShareBps is this author's royalty share in basis points of the spend their deployed work generates. |
status | body | string | — | Status is connected, approved or suspended. |
verified | body | boolean | — | Verified reports whether any repository or owner claim has been proven yet. |
verifyCode | body | string | — | VerifyCode is this author's stable proof token — the value a repository's verify file must carry. |
verifyFile | body | string | — | VerifyFile is the repo-root file the file method reads, on the default branch. |
verifySnippet | body | string | — | VerifySnippet is that file's exact contents, ready to commit. |
Failure carries the platform error shape — see Errors.
Examples
hanzo author connectimport { 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 := cloud.NewConfiguration()
cfg.AddDefaultHeader("Authorization", "Bearer "+os.Getenv("HANZO_API_KEY"))
client := cloud.NewAPIClient(cfg)
resp, _, err := client.AuthorAPI.PostAuthorConnect(context.Background()).Execute()
if err != nil {
return err
}use hanzo_cloud::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.setRequestInterceptor(b -> b.header("Authorization", "Bearer " + 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 authors tool, which names its 11 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_admin_authors"
}
}
}'How is this guide?