Projects & Environments
A project groups one or more environments (typically dev, staging, prod) under a shared product or team. An environment binds a project to a deployment space (a registered Kubernetes cluster) and a namespace, plus a registry for pushing built images.
Hierarchy
Where these routes live
environments/{envID}/stats, environments/{envID}/cluster-discovery) are served by the deployer and called out below.Projects
/projectsCreate a project. (config)
curl -X POST https://zopnight.com/api/projects \
-H "Authorization: Bearer <token>" \
-H "Content-Type: application/json" \
-d '{ "name": "checkout" }'/projectsList projects. (config)
/projects/statsBatch stats (env count, service count, status buckets, last deploy) for every project the caller can see — used to render the dashboard cards in a single round-trip. (config)
/projects/{projectID}Get a single project. (config)
/projects/{projectID}Rename a project. (config)
/projects/{projectID}Soft-delete a project. All child environments and deployments must be removed first. (config)
Environments
Environments live under a project. Each environment binds:
- A deployment space (the registered cluster).
- A
namespaceon that space's cluster. - An optional registry integration plus URL for built images (typically the cloud account's native registry — ECR / Artifact Registry / ACR).
/projects/{projectID}/environmentsCreate an environment under a project. (config)
curl -X POST https://zopnight.com/api/projects/prj_acme/environments \
-H "Authorization: Bearer <token>" \
-H "Content-Type: application/json" \
-d '{
"name": "prod-us-east",
"spaceId": "spc_abc",
"namespace": "checkout-prod",
"registryIntegrationId": "int_ecr_001",
"registryUrl": "123456789012.dkr.ecr.us-east-1.amazonaws.com/checkout"
}'/projects/{projectID}/environmentsList environments under a project. (config)
/projects/{projectID}/environments/{envID}Get an environment in nested-path form (used by the canvas). (config)
/projects/{projectID}/environments/{envID}Update an environment (name, space, namespace, registry). (config)
/projects/{projectID}/environments/{envID}Soft-delete an environment. All deployments must be removed first. (config)
Flat lookup
For deep-link URLs and integrations that hold an env ID without its project, the catalog exposes a flat lookup:
/environments/{envID}Get an environment by ID without knowing its project. (config)
Live runtime queries
The two endpoints below run against the env's target cluster in real-time (kubeconfig-minted from the cloud account credentials). They live on the deployer because that's where cluster credentials are materialised.
/environments/{envID}/statsQuick stats for the environment (deployment count, current state, total CPU/RAM requested). (deployer)
{
"data": {
"deploymentCount": 6,
"runningCount": 5,
"failedCount": 0,
"cpuRequestedCores": 12,
"memoryRequestedGB": 24
}
}/environments/{envID}/cluster-discoveryLive cluster discovery: ingress controllers and cert managers actually present on the namespace's cluster. Used to populate the ingress dropdown without showing stale options when an admin removes a controller. (deployer)
Topology & the Canvas
The Architecture canvas is rendered client-side from the same catalog endpoints above — there is no aggregated server-side topology endpoint on the public API. The client lists projects, environments, deployments, and service connections, groups them into the project → environment → deployment hierarchy, and renders the edges using the stored canvasPosition on each deployment.