Deploys a caller-supplied file manifest — the deploy_site capability an agent…
Deploys a caller-supplied file manifest — the deploy_site capability an agent calls — and answers with where it went live.
POST /v1/projects/sites/deploy
| Address | https://api.hanzo.ai/v1/projects/sites/deploy |
| Method | POST |
| Operation | post_projects_sites_deploy |
| Auth | Authorization: Bearer $HANZO_API_KEY |
Deploys a caller-supplied file manifest — the deploy_site capability an agent calls — and answers with where it went live.
files is a list of {path, content} pairs, the same shape the brief build
emits, and it runs through the SAME guards: index.html required at the root,
absolute and traversal paths rejected, per-file and total size capped, and a
mobile viewport meta tag injected into every HTML document that lacks one — so
a hand-built site is exactly as safe and as responsive as a generated one.
slug and name are optional; a slug is derived from the name or minted.
It writes into the SAME org-scoped store as /v1/projects, ensuring a project
(framework static) for the resolved slug and recording a deployment. The
hosting gate runs before the upload and the debit lands once, after the site
is live — a failed upload is never billed. Answers 503 when object storage is
unconfigured.
Scope: a validated principal is required (403 without one) and the site is published into THAT principal's org.
Request
5 fields, body application/json (required).
| Field | In | Type | Required | Description |
|---|---|---|---|---|
files | body | projectsFile[] | — | Files is the whole site, inline — every file it consists of. |
files[].content | body | string | — | Content is the file's whole text, inline. There is no upload step and no reference to fetch: a site is sent as its bytes, and each file and the site as a whole… |
files[].path | body | string | — | Path is where the file lands in the site, RELATIVE to its root — so "index.html" is the page served at /. |
name | body | string | — | Name is the site's display name. |
slug | body | string | — | Slug is the handle and public host label to publish under. |
Response
| Status | Body | Meaning |
|---|---|---|
200 | projectsSiteDeploy | ok |
200 body — 6 fields.
| Field | In | Type | Always | Description |
|---|---|---|---|---|
deploymentId | body | string | — | DeploymentID is the deployment this publish recorded, for the history. |
files | body | string[] | — | Files are the site-relative paths that were uploaded, sorted. |
name | body | string | — | Name is the project's display name. |
slug | body | string | — | Slug is the project the site was published into, created on the fly when the slug was free. |
status | body | string | — | Status is the deployment status, "live" on success. |
url | body | string | — | URL is the canonical live URL, https://<slug>.<apex> — empty when the subdomain belongs to another tenant and this site has none. |
Failure carries the platform error shape — see Errors.
Examples
hanzo has no subcommand for this operation — the CLI serves only what cloud's live route table confirms. Use HTTP or an SDK.
import { Configuration, ProjectsApi } from 'hanzoai';
const api = new ProjectsApi(new Configuration({ accessToken: process.env.HANZO_API_KEY }));
const { data } = await api.postProjectsSitesDeploy({ files: [{"content":"<content>","path":"<path>"}], name: "<name>" });from hanzoai.cloud import ApiClient, Configuration
from hanzoai.cloud.api import ProjectsApi
client = ApiClient(Configuration(access_token=os.environ["HANZO_API_KEY"]))
result = ProjectsApi(client).post_projects_sites_deploy(files=[{"content":"<content>","path":"<path>"}], name="<name>")cfg := cloud.NewConfiguration()
cfg.AddDefaultHeader("Authorization", "Bearer "+os.Getenv("HANZO_API_KEY"))
client := cloud.NewAPIClient(cfg)
resp, _, err := client.ProjectsAPI.PostProjectsSitesDeploy(context.Background()).Execute()
if err != nil {
return err
}use hanzo_cloud::apis::{configuration::Configuration, projects_api};
let mut cfg = Configuration::new();
cfg.bearer_access_token = std::env::var("HANZO_API_KEY").ok();
let result = projects_api::post_projects_sites_deploy(&cfg, Default::default()).await?;import ai.hanzo.cloud.ApiClient;
import ai.hanzo.cloud.api.ProjectsApi;
ApiClient client = new ApiClient();
client.setRequestInterceptor(b -> b.header("Authorization", "Bearer " + System.getenv("HANZO_API_KEY")));
var result = new ProjectsApi(client).postProjectsSitesDeploy();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/projects/sites/deploy \
-H "Authorization: Bearer $HANZO_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"files": [
{
"content": "<content>",
"path": "<path>"
}
],
"name": "<name>"
}'The door reaches projects through the projects tool, which names its 48 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_projects"
}
}
}'How is this guide?