Hanzo
OpenapiPlatform

Replaces an app's environment variables.

Replaces an app's environment variables. It writes the app's whole environment set and answers the updated application.

PUT /v1/platform/projects/{project}/apps/{app}/env

Addresshttps://api.hanzo.ai/v1/platform/projects/{project}/apps/{app}/env
MethodPUT
Operationput_platform_projects_by_project_apps_by_app_env
AuthAuthorization: Bearer $HANZO_API_KEY

Replaces an app's environment variables.

It writes the app's whole environment set and answers the updated application. This is the one post-create write path for env, and it REPLACES rather than merges: a variable absent from the body is gone, and a secret dropped from the set leaves the app's Secret on its next deploy.

Keys must match ^[A-Za-z_][A-Za-z0-9_]*$. A value marked secret: true is sealed into KMS and blanked in the database, so plaintext is never persisted — and the write fails 503 if KMS is unavailable rather than storing one in the clear.

The rule worth knowing: this does not restart anything. Once the app has been deployed the secret sync is re-declared immediately so the operator re-materialises the Secret, but RUNNING pods keep the environment they started with until their next deploy or restart. Requires a validated principal; 403 without one.

Request

8 fields, body application/json (required).

FieldInTypeRequiredDescription
projectpathstringyesProject is the project the application lives under, from the path.
apppathstringyesApp is the application's slug, from the path.
appbodystringApp is the application's slug, from the path.
envbodyEnvVarJSON[]Env is the app's whole environment set, REPLACING what it had.
env[].keybodystringKey is the variable's name in the container, which must match ^[A-Za-z_][A-Za-z0-9_]*$.
env[].secretbodybooleanSecret says the value lives in KMS and never in the database.
env[].valuebodystringValue is the plaintext, and it is WRITE-ONLY once the entry is secret: a sealed value reads back as "", and sending "" again KEEPS what is sealed rather than…
projectbodystringProject is the project the application lives under, from the path.

Response

StatusBodyMeaning
200appViewok

200 body — 34 fields.

FieldInTypeAlwaysDescription
buildTypebodystringBuildType is how a git app builds: pack, the zero-config default that detects the project, or dockerfile.
createdAtbodyintegerCreatedAt is when the app was created, unix seconds.
currentDeploymentIdbodystringCurrentDeploymentID is the deployment that is live — the pointer a deploy advances monotonically by version, so it never regresses to an older one.
descriptionbodystringDescription is free text about what the app is.
dockerfilebodystringDockerfile is the path inside the repo to build from, for buildType dockerfile.
domainsbodystring[]Domains are the ingress hosts rendered into the app's CR, its own <slug>.<org>.<sites host> first.
envbodyEnvVarJSON[]Env is the app's environment variables, with every SECRET value masked to "" — the plaintext is in KMS and this surface never echoes it.
env[].keybodystringKey is the variable's name in the container, which must match ^[A-Za-z_][A-Za-z0-9_]*$.
env[].secretbodybooleanSecret says the value lives in KMS and never in the database.
env[].valuebodystringValue is the plaintext, and it is WRITE-ONLY once the entry is secret: a sealed value reads back as "", and sending "" again KEEPS what is sealed rather than…
environmentbodystringEnvironment is the deploy target this app names, production when none was given.
healthbodystringHealth rolls ready-vs-desired replicas up to a colour: green (all ready), yellow (some ready, or deliberately scaled to zero), red (none), or "" when the…
idbodystringID is the server-minted application id (app_…).
imagebodyimageView
image.repositorybodystringRepository is the image path without a tag (ghcr.io/acme/api). Required for source image, which runs it as-is.
image.tagbodystringTag is the tag to run: what the create declared, then RE-STAMPED on every transition to live with the tag that actually went live.
namebodystringName is the display name.
namespacebodystringNamespace is where the app's cluster objects live, tenant-<org>.
orgbodystringOrg is the tenant that owns the app.
phasebodystringPhase is the operator's own status.phase for the app's Service CR, read from the cluster on this request.
portbodyintegerPort is the container port traffic is sent to.
projectIdbodystringProjectID is the IAM project the app lives under, and it is that project's NAME — the (org,name) key IAM identifies it by, which is also what the :project
replicasbodyintegerReplicas is how many copies the CR declares.
repobodygitSource
repo.branchbodystringBranch is the branch a push-to-deploy build tracks, main when the create named none — a push to any other branch, and every tag push, builds nothing here.
repo.providerbodystringProvider is derived from the URL — github, gitlab, bitbucket, or git for anything else.
repo.urlbodystringURL is the clone URL a git app builds from, stored as sent once the build path's allowlist accepted it (validateRepoURL).
secretSyncbodystringSecretSync is how far the app's secret env has got into the cluster: ""|pending|syncing|ready|failed (secrets.go).
secretSyncDetailbodystringSecretSyncDetail is the honest reason when the sync is not ready — a missing CRD, an RBAC grant, a per-tenant credential.
slugbodystringSlug is the app's identity in the cluster: the operator CR's name, the first label of its default host, and the :app path segment.
sourcebodystringSource is what the app deploys FROM: git, which builds Repo, or image, which runs Image as it is.
statusbodystringStatus is the lifecycle THIS store records: draft (created, nothing in the cluster yet), building, deploying, live, stopped or error.
storageGbbodyintegerStorageGB is the persistent volume size in GiB.
updatedAtbodyintegerUpdatedAt is when it last changed, unix seconds.

Failure carries the platform error shape — see Errors.

Examples

hanzo platform projects apps env <project> <app>

Platform API · All Hanzo APIs · Interactive reference

How is this guide?

On this page