Create record

Records that the caller's org deployed a project built from a source repository, which is the edge that makes an author's work earn royalty.

POST /v1/author/deploys/record

Addresshttps://api.hanzo.ai/v1/author/deploys/record
MethodPOST
Operationpost_author_deploys_record
AuthAuthorization: Bearer $HANZO_API_KEY

Records that the caller's org deployed a project built from a source repository, which is the edge that makes an author's work earn royalty.

It is deliberately NOT an error for a deploy to attribute to nobody: a project built from no repository, or from one no author has verified, answers {"recorded": false, "reason"} so a deploy pipeline can fire this on every deploy without branching. Attribution resolves per-repository first, then owner-wide, so a repository with its own claim always earns for its own author.

A deploy of a Hanzo-maintained template attributes to the platform treasury, and a self-deploy (the author's own org deploying its own repository) is recorded for provenance but excluded from accrual. The edge is idempotent per repository+project+org.

Answers 201 when it recorded a new edge and 200 otherwise.

Request

2 fields, body application/json (required).

FieldInTypeRequiredDescription
projectbodystring—Project is the deployed project's id.
repoUrlbodystring—RepoURL is the source repository the project was built from.

Response

StatusBodyMeaning
200author.deployRecordok
defaultproblem-detailsrefused

200 body — 6 fields.

FieldInTypeAlwaysDescription
createdbodyboolean—Created reports whether this call recorded a new attribution edge (201) or found an existing one (200).
createdAtbodyinteger (int64)—CreatedAt is when the edge was first recorded, in unix seconds.
deployIdbodystring—DeployID is the attribution edge's handle.
reasonbodystring—Reason says why nothing was attributed.
recordedbodyboolean—Recorded reports whether the deploy was attributed to an author at all.
selfbodyboolean—Self reports that the deploying org IS the author's org.

Failure carries the platform error shape — see Errors.

Examples

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

const api = new AuthorApi(new Configuration({ accessToken: process.env.HANZO_API_KEY }));
const { data } = await api.postAuthorDeploysRecord({ project: "<project>", repoUrl: "<repoUrl>" });
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_deploys_record(project="<project>", repo_url="<repoUrl>")
cfg := hanzoai.NewConfiguration()
cfg.AddDefaultHeader("Authorization", "Bearer "+os.Getenv("HANZO_API_KEY"))
client := hanzoai.NewAPIClient(cfg)

resp, _, err := client.AuthorAPI.PostAuthorDeploysRecord(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_deploys_record(&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).postAuthorDeploysRecord();
curl -X POST https://api.hanzo.ai/v1/author/deploys/record \
  -H "Authorization: Bearer $HANZO_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
       "project": "<project>",
       "repoUrl": "<repoUrl>"
     }'

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?