Update project

Changes a project's settings, and only the settings you send.

PATCH /v1/project/{slug}

Addresshttps://api.hanzo.ai/v1/project/{slug}
MethodPATCH
Operationpatch_project_by_slug
AuthAuthorization: Bearer $HANZO_API_KEY

Changes a project's settings, and only the settings you send.

Every field is optional and absent means "leave it": name may not be blanked, framework must stay a known build hint, and cacheControl is capped at 256 characters with no newlines (it becomes a response header). visibility flips public/private under the same rule as create — public is free, private needs a funded org. upstream and license are free-text credit for third-party work, and sending "" clears one. Changing anything reconciles the project's canonical git repo, so a visibility change reaches the source and not just the listing.

hidden/hiddenReason are platform MODERATION and are ignored unless the caller is a platform admin; they remove a project from the public catalogue without touching the publisher's own visibility choice, so un-hiding restores exactly what they asked for.

Scope: a validated principal is required (401 without one) and the project is resolved within that principal's org, so another tenant's slug is a 404.

Request

18 fields, body application/json (required).

FieldInTypeRequiredDescription
slugpathstringyesSlug is the project to update, from the path.
cacheControlbodystring—CacheControl replaces the Cache-Control policy the edge serves this site's HTML under.
descriptionbodystring—Description replaces the one-line summary.
dropLocalbodyboolean—DropLocal turns the drop of localhost events at ingest on or off.
frameworkbodystring—Framework replaces the build hint.
hiddenbodyboolean—Hidden is MODERATION, and the only admin-gated field on this body: it pulls a public project out of the catalogue from admin.hanzo.ai without editing the publisher's own visibility choice, so un-hiding restores exactly what they asked for.
hiddenReasonbodystring—HiddenReason records WHY moderation hid it, so the action can be explained and reviewed later.
internalNetworksbodystring[]—InternalNetworks replaces the site's own addresses: CIDRs or bare addresses, at most 64.
licensebodystring—License is the terms that upstream work carries, with the same clear-versus- leave rule.
namebodystring—Name replaces the display name.
repobodyobject—Repo relinks the git source.
repo.branchbodystring—
repo.urlbodystring—
slugbodystring—Slug is the project to update, from the path.
tagsbodyobject—Tags sets the site's browser tag config: platform slug → non-secret pixel id (e.g. {"ga4":"G-…","meta":"…"}).
tags.*bodystring—
upstreambodystring—Upstream credits the third-party work this project was published from, and is settable after the fact because the live demos are the ones that most need crediting.
visibilitybodystring—Visibility flips an existing project between "public" and "private".

Response

StatusBodyMeaning
200project.projectsProjectok
defaultproblem-detailsrefused

200 body — 32 fields.

FieldInTypeAlwaysDescription
analyticsbodyboolean—Analytics is whether the web-analytics beacon is injected into this site's pages.
bucketbodystring—Bucket is the object-store bucket the site's files are served out of.
cacheControlbodystring—CacheControl is the Cache-Control policy the edge serves this site's HTML under — how long a reader may hold a stale page before asking again.
createdAtbodyinteger (int64)—CreatedAt is when the project was created, as Unix seconds.
currentDeploymentIdbodystring—CurrentDeploymentID names the deployment currently serving, so a caller can ask what is live without scanning the history.
descriptionbodystring—Description is the one-line summary, which is copied onto forks of this project and shown on a gallery card.
dropLocalbodyboolean—DropLocal is whether events a developer's own machine sends (localhost, 127.0.0.1, *.local) are dropped at ingest.
forkedFrombodystring—ForkedFrom is the parent this project was forked from ("<org>/<slug>" of a published project, or a catalog template slug) — the attribution edge a gallery credits.
frameworkbodystring—Framework is a BUILD HINT from a closed set, defaulting to static.
hiddenbodyboolean—Hidden is PLATFORM MODERATION, and it is a different axis from visibility: it pulls a public project out of the catalogue without editing the publisher's own choice, so un-hiding restores exactly what they asked for.
hiddenReasonbodystring—HiddenReason is why moderation hid it.
idbodystring—ID is the project's internal identifier.
internalNetworksbodystring[]—InternalNetworks are the site's own addresses, as CIDRs ("203.0.113.0/24").
keybodystring—Key is the project's publishable ingest key, minted at create.
lastPurgeAtbodyinteger (int64)—LastPurgeAt is when the edge cache was last cleared, as Unix seconds, so a console can say how fresh what readers see actually is.
licensebodystring—License is the terms that upstream work carries.
liveUrlbodystring—LiveURL is where the site answers today.
namebodystring—Name is the project's display name, free text a person chose.
orgbodystring—Org is the organisation that owns the project, and therefore who pays for it and who may change it.
repobodyproject.projectsRepo—
repo.branchbodystring—Branch is the ref a push has to touch for this project to rebuild.
repo.providerbodystring—Provider is the forge the URL was recognised as — it decides which webhook and which credential reach the repository, and is DERIVED from the URL rather than chosen by the caller.
repo.urlbodystring—URL is the clone address of the repository this project builds from.
slugbodystring—Slug is the identifier that MATTERS: the handle every later call addresses, the S3 key segment the site's objects live under, and the label of the public host &lt;slug&gt;.hanzo.app.
spacebodystring—Space is the project's Base data space, which is where a deployed site's form, forum and data submissions land.
starredbodyboolean—Starred is THIS CALLER's star, not a property of the project — two people in the same org see different values for the same row, which is the whole point of it.
statusbodystring—Status is where the project stands — whether a build has ever succeeded and whether anything is serving right now.
tagsbodyobject—Tags is the site's browser tag config: platform slug → non-secret pixel id (GA measurement, Meta pixel, …) — what track.js injects and the server CAPI reads, per site.
tags.*bodystring—
updatedAtbodyinteger (int64)—UpdatedAt is when the project's own record last changed, as Unix seconds.
upstreambodystring—Upstream credits the third-party work this project was published from — a free-text line, because the honest answer is a name and a title that no enum could hold.
visibilitybodystring—Visibility is "public" or "private", and Hidden reports platform moderation.

Failure carries the platform error shape — see Errors.

Examples

hanzo project update <slug>
import { Configuration, ProjectApi } from 'hanzoai';

const api = new ProjectApi(new Configuration({ accessToken: process.env.HANZO_API_KEY }));
const { data } = await api.patchProjectBySlug({ slug: 'slug', cacheControl: "<cacheControl>", description: "<description>" });
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).patch_project_by_slug(slug='slug', cache_control="<cacheControl>", description="<description>")
cfg := hanzoai.NewConfiguration()
cfg.AddDefaultHeader("Authorization", "Bearer "+os.Getenv("HANZO_API_KEY"))
client := hanzoai.NewAPIClient(cfg)

resp, _, err := client.ProjectAPI.PatchProjectBySlug(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::patch_project_by_slug(&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).patchProjectBySlug();
curl -X PATCH https://api.hanzo.ai/v1/project/<slug> \
  -H "Authorization: Bearer $HANZO_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
       "cacheControl": "<cacheControl>",
       "description": "<description>"
     }'

Tool project, op patch_project_by_slug — 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": "patch_project_by_slug",
           "input": {
             "slug": "<slug>",
             "cacheControl": "<cacheControl>",
             "description": "<description>"
           }
         }
       }
     }'

Project API · All Hanzo APIs · Interactive reference

Was this page useful?