Deploy sites — POST /v1/project/sites/deploy

Deploys a caller-supplied file manifest — the deploy_site capability an agent calls — and answers with where it went live.

POST /v1/project/sites/deploy

Addresshttps://api.hanzo.ai/v1/project/sites/deploy
MethodPOST
Operationpost_project_sites_deploy
AuthAuthorization: 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/project, ensuring a project (framework static) for the resolved slug and recording a deployment. It is free: the site is billed for the storage its org holds past the free tier, and the storage gate runs before the upload, refusing (402) an org past the tier that cannot pay a month of what it holds. Answers 503 when object storage is unconfigured.

Scope: a validated principal is required (401 without one) and the site is published into THAT principal's org.

Request

5 fields, body application/json (required).

FieldInTypeRequiredDescription
filesbodyproject.projectsFile[]—Files is the whole site, inline — every file it consists of.
files[].contentbodystring—Content is the file's whole text, inline.
files[].pathbodystring—Path is where the file lands in the site, RELATIVE to its root — so "index.html" is the page served at /.
namebodystring—Name is the site's display name.
slugbodystring—Slug is the handle and public host label to publish under.

Response

StatusBodyMeaning
200project.projectsSiteDeployok
defaultproblem-detailsrefused

200 body — 6 fields.

FieldInTypeAlwaysDescription
deploymentIdbodystring—DeploymentID is the deployment this publish recorded, for the history.
filesbodystring[]—Files are the site-relative paths that were uploaded, sorted.
namebodystring—Name is the project's display name.
slugbodystring—Slug is the project the site was published into, created on the fly when the slug was free.
statusbodystring—Status is the deployment status, "live" on success.
urlbodystring—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 project sites deploy
import { Configuration, ProjectApi } from 'hanzoai';

const api = new ProjectApi(new Configuration({ accessToken: process.env.HANZO_API_KEY }));
const { data } = await api.postProjectSitesDeploy({ files: [{"content":"<content>","path":"<path>"}], name: "<name>" });
from hanzoai.cloud import ApiClient, Configuration
from hanzoai.cloud.api import ProjectApi

client = ApiClient(Configuration(access_token=os.environ["HANZO_API_KEY"]))
result = ProjectApi(client).post_project_sites_deploy(files=[{"content":"<content>","path":"<path>"}], name="<name>")
cfg := hanzoai.NewConfiguration()
cfg.AddDefaultHeader("Authorization", "Bearer "+os.Getenv("HANZO_API_KEY"))
client := hanzoai.NewAPIClient(cfg)

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

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

let result = project_api::post_project_sites_deploy(&cfg, Default::default()).await?;
import ai.hanzo.cloud.ApiClient;
import ai.hanzo.cloud.api.ProjectApi;

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

var result = new ProjectApi(client).postProjectSitesDeploy();
curl -X POST https://api.hanzo.ai/v1/project/sites/deploy \
  -H "Authorization: Bearer $HANZO_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
       "files": [
         {
           "content": "<content>",
           "path": "<path>"
         }
       ],
       "name": "<name>"
     }'

Tool project, op post_project_sites_deploy — POST the JSON-RPC envelope to https://api.hanzo.ai/v1/mcp.

curl -X POST https://api.hanzo.ai/v1/mcp \
  -H "Authorization: Bearer $HANZO_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
       "jsonrpc": "2.0",
       "id": 1,
       "method": "tools/call",
       "params": {
         "name": "project",
         "arguments": {
           "op": "post_project_sites_deploy",
           "input": {
             "files": [
               {
                 "content": "<content>",
                 "path": "<path>"
               }
             ],
             "name": "<name>"
           }
         }
       }
     }'

Project API · All Hanzo APIs · Interactive reference

Was this page useful?