Create template

Creates a starter kit PRIVATE to the caller's org and answers 201 with the stored kit.

POST /v1/template

Addresshttps://api.hanzo.ai/v1/template
MethodPOST
Operationpost_template
AuthAuthorization: Bearer $HANZO_API_KEY

Creates a starter kit PRIVATE to the caller's org and answers 201 with the stored kit. The owner is stamped by the server, so a body "org" is never trusted; publishing over a public-catalog slug is 409, so a slug still names exactly one kit.

Request

16 fields, body application/json (required).

FieldInTypeRequiredDescription
categorybodystring—Category groups the kit in the gallery browser.
demobodystring—Demo is the deployed site itself, when there is one.
descriptionbodystring—Description is the browse-card blurb, max 4096 characters.
featuresbodystring[]—Features are the highlights the card lists, at most 32.
frameworkbodystring—Framework is the stack the kit is built on ("Next.js 14").
previewbodystring—Preview is the still image the browse card renders, max 4096 characters.
slugbodystring—Slug is the kit's identity — lowercase alphanumeric with dashes, max 40.
sourcebodystring—Source is the repository the kit is forked from, max 4096 characters.
titlebodystring—Title is the display name.
useCasebodystring—UseCase is what the kit is for, in a phrase.
variantsbodytemplate.Variant[]—Variants are the shapes this kit ships in, at most 32; the fork picks one.
variants[].frameworkbodystring—only when it differs from the template's
variants[].idbodystring—selector, unique within the template ("react", "grid-3-fluid")
variants[].kindbodystring—the axis it varies: format | page | theme
variants[].labelbodystring—human label for the picker
variants[].sourcebodystring—the repository this shape is forked from; the synthesized default shape carries the template's own

Response

StatusBodyMeaning
201template.StarterKitcreated
defaultproblem-detailsrefused

201 body — 19 fields.

FieldInTypeAlwaysDescription
categorybodystring—groups the kit in the gallery browser ("Portfolio", "SaaS")
demobodystring—live demo (<slug>.hanzo.app), when deployed
descriptionbodystring—the browse-card blurb
featuresbodystring[]—the highlights the card lists, at most 32
frameworkbodystring—the stack the kit is built on ("Next.js 14.2 + TS")
orgbodystring—owner of a PRIVATE template; empty in the public catalog
previewbodystring—the still image the browse card renders
ratingbodynumber (double)—Rating is public-gallery curation, on the same terms as Tier: catalog-only, never accepted from a request, absent on a customer's own kit.
slugbodystring—the kit's identity — lowercase alphanumeric with dashes, max 40
sourcebodystring—the repository the kit is forked from
tierbodyinteger (int64)—Tier is public-gallery curation, carried verbatim from the embedded catalog.
titlebodystring—display name
useCasebodystring—what the kit is for, in a phrase
variantsbodytemplate.Variant[]—the shapes this template ships in
variants[].frameworkbodystring—only when it differs from the template's
variants[].idbodystring—selector, unique within the template ("react", "grid-3-fluid")
variants[].kindbodystring—the axis it varies: format | page | theme
variants[].labelbodystring—human label for the picker
variants[].sourcebodystring—the repository this shape is forked from; the synthesized default shape carries the template's own

Failure carries the platform error shape — see Errors.

Examples

hanzo template create
import { Configuration, TemplateApi } from 'hanzoai';

const api = new TemplateApi(new Configuration({ accessToken: process.env.HANZO_API_KEY }));
const { data } = await api.postTemplate({ category: "<category>", demo: "<demo>" });
from hanzoai.cloud import ApiClient, Configuration
from hanzoai.cloud.api import TemplateApi

client = ApiClient(Configuration(access_token=os.environ["HANZO_API_KEY"]))
result = TemplateApi(client).post_template(category="<category>", demo="<demo>")
cfg := hanzoai.NewConfiguration()
cfg.AddDefaultHeader("Authorization", "Bearer "+os.Getenv("HANZO_API_KEY"))
client := hanzoai.NewAPIClient(cfg)

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

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

let result = template_api::post_template(&cfg, Default::default()).await?;
import ai.hanzo.cloud.ApiClient;
import ai.hanzo.cloud.api.TemplateApi;

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

var result = new TemplateApi(client).postTemplate();
curl -X POST https://api.hanzo.ai/v1/template \
  -H "Authorization: Bearer $HANZO_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
       "category": "<category>",
       "demo": "<demo>"
     }'

MCP reaches template through the template 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_templates"
         }
       }
     }'

Template API · All Hanzo APIs · Interactive reference

Was this page useful?