Creates a starter kit PRIVATE to the caller's org and answers 201 with the…
Creates a starter kit PRIVATE to the caller's org and answers 201 with the stored kit.
POST /v1/template
| Address | https://api.hanzo.ai/v1/template |
| Method | POST |
| Operation | post_template |
| Auth | Authorization: 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).
| Field | In | Type | Required | Description |
|---|---|---|---|---|
category | body | string | — | Category groups the kit in the gallery browser. |
demo | body | string | — | Demo is the deployed site itself, when there is one. |
description | body | string | — | Description is the browse-card blurb, max 4096 characters. |
features | body | string[] | — | Features are the highlights the card lists, at most 32. |
framework | body | string | — | Framework is the stack the kit is built on ("Next.js 14"). |
preview | body | string | — | Preview is the still image the browse card renders, max 4096 characters. |
slug | body | string | — | Slug is the kit's identity — lowercase alphanumeric with dashes, max 40. |
source | body | string | — | Source is the repository the kit is forked from, max 4096 characters. |
title | body | string | — | Title is the display name. |
useCase | body | string | — | UseCase is what the kit is for, in a phrase. |
variants | body | Variant[] | — | Variants are the shapes this kit ships in, at most 32; the fork picks one. |
variants[].framework | body | string | — | only when it differs from the template's |
variants[].id | body | string | — | selector, unique within the template ("react", "grid-3-fluid") |
variants[].kind | body | string | — | the axis it varies: format | page | theme |
variants[].label | body | string | — | human label for the picker |
variants[].source | body | string | — | the repository this shape is forked from; the synthesized default shape carries the template's own |
Response
| Status | Body | Meaning |
|---|---|---|
201 | StarterKit | created |
201 body — 19 fields.
| Field | In | Type | Always | Description |
|---|---|---|---|---|
category | body | string | — | groups the kit in the gallery browser ("Portfolio", "SaaS") |
demo | body | string | — | live demo (<slug>.hanzo.app), when deployed |
description | body | string | — | the browse-card blurb |
features | body | string[] | — | the highlights the card lists, at most 32 |
framework | body | string | — | the stack the kit is built on ("Next.js 14.2 + TS") |
org | body | string | — | owner of a PRIVATE template; empty in the public catalog |
preview | body | string | — | the still image the browse card renders |
rating | body | number | — | 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. |
slug | body | string | — | the kit's identity — lowercase alphanumeric with dashes, max 40 |
source | body | string | — | the repository the kit is forked from |
tier | body | integer | — | Tier is public-gallery curation, carried verbatim from the embedded catalog. |
title | body | string | — | display name |
useCase | body | string | — | what the kit is for, in a phrase |
variants | body | Variant[] | — | the shapes this template ships in |
variants[].framework | body | string | — | only when it differs from the template's |
variants[].id | body | string | — | selector, unique within the template ("react", "grid-3-fluid") |
variants[].kind | body | string | — | the axis it varies: format | page | theme |
variants[].label | body | string | — | human label for the picker |
variants[].source | body | string | — | 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 templates createimport { 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 := cloud.NewConfiguration()
cfg.AddDefaultHeader("Authorization", "Bearer "+os.Getenv("HANZO_API_KEY"))
client := cloud.NewAPIClient(cfg)
resp, _, err := client.TemplateAPI.PostTemplate(context.Background()).Execute()
if err != nil {
return err
}use hanzo_cloud::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.setRequestInterceptor(b -> b.header("Authorization", "Bearer " + System.getenv("HANZO_API_KEY")));
var result = new TemplateApi(client).postTemplate();The method above is the one at the current release of the document. [email protected] (npm) and [email protected] (PyPI) were generated from an earlier release, where this operation carried a different id, so it spells the method differently — regenerating the clients is what makes the two agree. SDKs →
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>"
}'The door reaches template through the templates tool, which names its 5 operations with its own verbs — this one among them, under a name only the door 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"
}
}
}'How is this guide?