Update a container in an environment
const url = 'https://dashboard.quantcdn.io/api/v3/organizations/test-org/applications/test-app/environments/test-env/containers/app';const options = { method: 'PUT', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"name":"example","imageReference":{"type":"internal","identifier":"example"},"cpu":1,"memory":1,"memoryReservation":1,"exposedPorts":[1],"mountPoints":[{"sourceVolume":"example","containerPath":"example","readOnly":false}],"environment":[{"name":"example","value":"example"}],"secrets":[{"name":"example","valueFrom":"example"}],"healthCheck":{"command":["example"],"interval":30,"timeout":5,"retries":3,"startPeriod":1},"dependsOn":[{"containerName":"example","condition":"START"}],"command":["example"],"entryPoint":["example"],"workingDirectory":"example","essential":true,"readonlyRootFilesystem":false,"user":"example","originProtection":false,"originProtectionConfig":{"enabled":true,"ipAllow":["example"],"redirectHost":"example"},"loadBalancerHealthCheck":{"path":"/_quant/health","intervalSeconds":60}}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request PUT \ --url https://dashboard.quantcdn.io/api/v3/organizations/test-org/applications/test-app/environments/test-env/containers/app \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "name": "example", "imageReference": { "type": "internal", "identifier": "example" }, "cpu": 1, "memory": 1, "memoryReservation": 1, "exposedPorts": [ 1 ], "mountPoints": [ { "sourceVolume": "example", "containerPath": "example", "readOnly": false } ], "environment": [ { "name": "example", "value": "example" } ], "secrets": [ { "name": "example", "valueFrom": "example" } ], "healthCheck": { "command": [ "example" ], "interval": 30, "timeout": 5, "retries": 3, "startPeriod": 1 }, "dependsOn": [ { "containerName": "example", "condition": "START" } ], "command": [ "example" ], "entryPoint": [ "example" ], "workingDirectory": "example", "essential": true, "readonlyRootFilesystem": false, "user": "example", "originProtection": false, "originProtectionConfig": { "enabled": true, "ipAllow": [ "example" ], "redirectHost": "example" }, "loadBalancerHealthCheck": { "path": "/_quant/health", "intervalSeconds": 60 } }'Updates one container in the environment’s compose definition and redeploys the environment. The fields in the request body replace the same fields of the container. Fields that the request body omits keep their current values. Other containers and the task-level settings do not change. To clear a field, send it as null. The container name in the body must match the name in the path: a container cannot be renamed. Container updates to one environment run one at a time. A compose change made at the same moment through another endpoint can still overwrite this update.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”The organisation ID
Example
test-orgThe application ID
Example
test-appThe environment ID
Example
test-envThe container name
Example
appRequest Bodyrequired
Section titled “Request Bodyrequired”object
Name of the container
object
Specifies whether the image is internal (Quant container registry) or external (e.g., Docker Hub)
The image identifier. For ‘internal’ type, this is the image tag. For ‘external’ type, this is the full image name.
Container-level CPU units
Container-level memory hard limit (MiB)
Container-level memory soft limit (MiB)
List of container ports to expose
object
The name of the logical volume
The path inside the container where the volume is mounted
Environment variables specific to this container
object
Environment variable name
Environment variable value
Secrets mapped to environment variables
object
The environment variable name to be set in the container
The key of the secret in the environment’s ‘app-secrets’ store
Container health check configuration
object
The command to run to determine if the container is healthy
Time period (seconds) between health checks
Time period (seconds) to wait for a health check to return
Number of times to retry a failed health check
Grace period (seconds) to ignore unhealthy checks after container starts
Container startup dependencies
object
The name of the container this container depends on
The condition to wait for on the dependency
Enable origin protection for all exposed ports on this container. Use originProtectionConfig for advanced options like IP allow lists.
Extended origin protection configuration with IP allow list support
object
Whether origin protection is enabled. Defaults to true if this config object is provided.
List of IP addresses or CIDR ranges that can bypass origin protection for direct access (e.g., VPN IPs)
Optional bare host (e.g. www.example.com). When set, requests denied by origin protection are 302-redirected to https://
Load balancer health check for the ports this container exposes. Null or omitted uses the platform default (GET / every 45 seconds). Each property is optional; an omitted or null property takes its default. The check passes when the response status is 2xx or one of 300, 301, 302, 304, 308, 400, 401, 403 and 404, so it confirms the container answers, not that the application is correct. A change applies to the load balancer when it is saved. Distinct from healthCheck, which is the container-level command check. Quant base images (app-apache-php and images built on it) serve /_quant/health as a static response without running the application or reading shared volumes: use it when rendering the home page is expensive. On a container update, the object replaces the stored one; null resets it to the default. Compose import maps the service labels quant.healthcheck.path and quant.healthcheck.interval to it.
object
Path the load balancer requests. Starts with /.
Example
/_quant/healthSeconds between checks.
Example
60Example
{ "path": "/_quant/health", "intervalSeconds": 60}Responses
Section titled “Responses”The updated container. The environment redeploys in the background.
object
Name of the container
object
Specifies whether the image is internal (Quant container registry) or external (e.g., Docker Hub)
The image identifier. For ‘internal’ type, this is the image tag. For ‘external’ type, this is the full image name.
Container-level CPU units
Container-level memory hard limit (MiB)
Container-level memory soft limit (MiB)
List of container ports to expose
object
The name of the logical volume
The path inside the container where the volume is mounted
Environment variables specific to this container
object
Environment variable name
Environment variable value
Secrets mapped to environment variables
object
The environment variable name to be set in the container
The key of the secret in the environment’s ‘app-secrets’ store
Container health check configuration
object
The command to run to determine if the container is healthy
Time period (seconds) between health checks
Time period (seconds) to wait for a health check to return
Number of times to retry a failed health check
Grace period (seconds) to ignore unhealthy checks after container starts
Container startup dependencies
object
The name of the container this container depends on
The condition to wait for on the dependency
Enable origin protection for all exposed ports on this container. Use originProtectionConfig for advanced options like IP allow lists.
Extended origin protection configuration with IP allow list support
object
Whether origin protection is enabled. Defaults to true if this config object is provided.
List of IP addresses or CIDR ranges that can bypass origin protection for direct access (e.g., VPN IPs)
Optional bare host (e.g. www.example.com). When set, requests denied by origin protection are 302-redirected to https://
Load balancer health check for the ports this container exposes. Null or omitted uses the platform default (GET / every 45 seconds). Each property is optional; an omitted or null property takes its default. The check passes when the response status is 2xx or one of 300, 301, 302, 304, 308, 400, 401, 403 and 404, so it confirms the container answers, not that the application is correct. A change applies to the load balancer when it is saved. Distinct from healthCheck, which is the container-level command check. Quant base images (app-apache-php and images built on it) serve /_quant/health as a static response without running the application or reading shared volumes: use it when rendering the home page is expensive. On a container update, the object replaces the stored one; null resets it to the default. Compose import maps the service labels quant.healthcheck.path and quant.healthcheck.interval to it.
object
Path the load balancer requests. Starts with /.
Seconds between checks.
Example
{ "imageReference": { "type": "internal" }, "mountPoints": [ { "readOnly": false } ], "healthCheck": { "interval": 30, "timeout": 5, "retries": 3 }, "dependsOn": [ { "condition": "START" } ], "essential": true, "readonlyRootFilesystem": false, "originProtection": false, "originProtectionConfig": { "enabled": true }, "loadBalancerHealthCheck": { "path": "/_quant/health", "intervalSeconds": 60 }}Quant Cloud refused the updated definition
object
Examplegenerated
{ "error": "example"}Permission or token scope missing
The environment has no container with this name
object
Examplegenerated
{ "error": "example"}Another container update for this environment is in progress
object
Examplegenerated
{ "error": "example"}Invalid container definition, or the body name does not match the path name
Quant Cloud did not accept the request
object
Examplegenerated
{ "error": "example"}