Containers API
Deploy, redeploy, and operate container workloads
A container is a deployable workload on Hanzo PaaS. There are two ways to act on one:
- the canonical
/v1container surface — a machine-driven, zero-downtime redeploy (rolling restart) of a running workload, authenticated with a service token; - the
/apibuild pipeline — the Dokploy-derived tRPC procedures (application.*) that register sources and run builds, authenticated with an API key.
Under the hood a container maps to an application row whose appName is the live workload's name.
Redeploy a running container (/v1)
curl -fsS -X POST \
"https://platform.hanzo.ai/v1/org/$ORG_ID/project/$PROJECT_ID/env/$ENV_ID/container/$CONTAINER_ID/redeploy" \
-H "Authorization: Bearer $PAAS_SERVICE_TOKEN"{ "ok": true }This re-pulls the image and recreates pods with a rolling update — no new build. The service token comes from Hanzo KMS.
Build pipeline procedures (/api)
Each procedure is an HTTP POST to https://platform.hanzo.ai/api/<procedure> with x-api-key.
| Procedure | Purpose |
|---|---|
application.create | Register a new application (does not deploy) |
application.one | Get application details |
application.all | List applications in a project |
application.update | Update configuration |
application.deploy | Build & deploy (manual deployment) |
application.redeploy | Rebuild an existing application |
application.start · application.stop · application.reload | Lifecycle operations |
application.remove | Delete the application |
Create an application
name and environmentId are required; appName is generated if omitted.
curl -fsS -X POST https://platform.hanzo.ai/api/application.create \
-H "x-api-key: $PLATFORM_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"name": "web",
"environmentId": "'$ENV_ID'",
"description": "Public web app"
}'Attach a Docker image source with application.saveDockerProvider (or a Git source with application.saveGithubProvider), then deploy.
Deploy & redeploy
# Build and deploy
curl -fsS -X POST https://platform.hanzo.ai/api/application.deploy \
-H "x-api-key: $PLATFORM_API_KEY" \
-H "Content-Type: application/json" \
-d '{ "applicationId": "'$APP_ID'" }'
# Rebuild an existing application
curl -fsS -X POST https://platform.hanzo.ai/api/application.redeploy \
-H "x-api-key: $PLATFORM_API_KEY" \
-H "Content-Type: application/json" \
-d '{ "applicationId": "'$APP_ID'", "title": "ship v1.3.0" }'application.deploy and application.redeploy enqueue a build job and return after it is scheduled. Deployments roll out with a zero-downtime strategy by default.
Lifecycle
# Stop / start / restart-in-place
curl -fsS -X POST https://platform.hanzo.ai/api/application.stop -H "x-api-key: $PLATFORM_API_KEY" -d '{"applicationId":"'$APP_ID'"}'
curl -fsS -X POST https://platform.hanzo.ai/api/application.start -H "x-api-key: $PLATFORM_API_KEY" -d '{"applicationId":"'$APP_ID'"}'
curl -fsS -X POST https://platform.hanzo.ai/api/application.reload -H "x-api-key: $PLATFORM_API_KEY" -d '{"applicationId":"'$APP_ID'","appName":"'$APP_NAME'"}'Inspect & observe
Use the observe surface to see declared vs running vs latest image tags and drift:
curl -fsS "https://platform.hanzo.ai/v1/apps?org=hanzo" \
-H "Authorization: Bearer $PLATFORM_SERVICE_TOKEN"Application status values
| Status | Description |
|---|---|
idle | Registered, not running |
running | Deployed and serving |
done | Last deployment completed |
error | A deployment or replica failed |
application.remove stops all instances and removes associated domains and volumes. This cannot be undone.
How is this guide?
Last updated on