Skip to content

Update a container in an environment

PUT
/api/v3/organizations/{organisation}/applications/{application}/environments/{environment}/containers/{container}
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.

organisation
required
string

The organisation ID

Example
test-org
application
required
string

The application ID

Example
test-app
environment
required
string

The environment ID

Example
test-env
container
required
string
/^[a-zA-Z0-9_-]+$/

The container name

Example
app
Media typeapplication/json
object
name
required

Name of the container

string
/^[a-zA-Z0-9_-]+$/
imageReference
required
object
type
required

Specifies whether the image is internal (Quant container registry) or external (e.g., Docker Hub)

string
Allowed values: internal external
identifier
required

The image identifier. For ‘internal’ type, this is the image tag. For ‘external’ type, this is the full image name.

string
cpu

Container-level CPU units

integer
nullable
memory

Container-level memory hard limit (MiB)

integer
nullable
memoryReservation

Container-level memory soft limit (MiB)

integer
nullable
exposedPorts

List of container ports to expose

Array<integer>
nullable
mountPoints
Array<object>
nullable
object
sourceVolume
required

The name of the logical volume

string
containerPath
required

The path inside the container where the volume is mounted

string
readOnly
boolean
environment

Environment variables specific to this container

Array<object>
nullable
object
name
required

Environment variable name

string
value
required

Environment variable value

string
secrets

Secrets mapped to environment variables

Array<object>
nullable
object
name
required

The environment variable name to be set in the container

string
valueFrom
required

The key of the secret in the environment’s ‘app-secrets’ store

string
healthCheck

Container health check configuration

object
command

The command to run to determine if the container is healthy

Array<string>
interval

Time period (seconds) between health checks

integer
default: 30 >= 5 <= 300
timeout

Time period (seconds) to wait for a health check to return

integer
default: 5 >= 2 <= 60
retries

Number of times to retry a failed health check

integer
default: 3 >= 1 <= 10
startPeriod

Grace period (seconds) to ignore unhealthy checks after container starts

integer
nullable <= 300
dependsOn

Container startup dependencies

Array<object>
nullable
object
containerName
required

The name of the container this container depends on

string
condition

The condition to wait for on the dependency

string
Allowed values: START HEALTHY COMPLETE SUCCESS
command
Array<string>
nullable
entryPoint
Array<string>
nullable
workingDirectory
string
nullable
essential
boolean
default: true nullable
readonlyRootFilesystem
boolean
nullable
user
string
nullable
originProtection

Enable origin protection for all exposed ports on this container. Use originProtectionConfig for advanced options like IP allow lists.

boolean
nullable
originProtectionConfig

Extended origin protection configuration with IP allow list support

object
enabled

Whether origin protection is enabled. Defaults to true if this config object is provided.

boolean
default: true
ipAllow

List of IP addresses or CIDR ranges that can bypass origin protection for direct access (e.g., VPN IPs)

Array<string>
nullable
redirectHost

Optional bare host (e.g. www.example.com). When set, requests denied by origin protection are 302-redirected to https:// with path and query preserved, instead of receiving a 403. Allowed IPs and valid-header (CDN) traffic are unaffected.

string
nullable
loadBalancerHealthCheck

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

Path the load balancer requests. Starts with /.

string
default: / nullable <= 1024 characters /^/[A-Za-z0-9._~\-/]*(\?[A-Za-z0-9._~\-=&]*)?$/
Example
/_quant/health
intervalSeconds

Seconds between checks.

integer
default: 45 nullable >= 15 <= 300
Example
60
Example
{
"path": "/_quant/health",
"intervalSeconds": 60
}

The updated container. The environment redeploys in the background.

Media typeapplication/json
object
name
required

Name of the container

string
/^[a-zA-Z0-9_-]+$/
imageReference
required
object
type
required

Specifies whether the image is internal (Quant container registry) or external (e.g., Docker Hub)

string
Allowed values: internal external
identifier
required

The image identifier. For ‘internal’ type, this is the image tag. For ‘external’ type, this is the full image name.

string
cpu

Container-level CPU units

integer
nullable
memory

Container-level memory hard limit (MiB)

integer
nullable
memoryReservation

Container-level memory soft limit (MiB)

integer
nullable
exposedPorts

List of container ports to expose

Array<integer>
nullable
mountPoints
Array<object>
nullable
object
sourceVolume
required

The name of the logical volume

string
containerPath
required

The path inside the container where the volume is mounted

string
readOnly
boolean
environment

Environment variables specific to this container

Array<object>
nullable
object
name
required

Environment variable name

string
value
required

Environment variable value

string
secrets

Secrets mapped to environment variables

Array<object>
nullable
object
name
required

The environment variable name to be set in the container

string
valueFrom
required

The key of the secret in the environment’s ‘app-secrets’ store

string
healthCheck

Container health check configuration

object
command

The command to run to determine if the container is healthy

Array<string>
interval

Time period (seconds) between health checks

integer
default: 30 >= 5 <= 300
timeout

Time period (seconds) to wait for a health check to return

integer
default: 5 >= 2 <= 60
retries

Number of times to retry a failed health check

integer
default: 3 >= 1 <= 10
startPeriod

Grace period (seconds) to ignore unhealthy checks after container starts

integer
nullable <= 300
dependsOn

Container startup dependencies

Array<object>
nullable
object
containerName
required

The name of the container this container depends on

string
condition

The condition to wait for on the dependency

string
Allowed values: START HEALTHY COMPLETE SUCCESS
command
Array<string>
nullable
entryPoint
Array<string>
nullable
workingDirectory
string
nullable
essential
boolean
default: true nullable
readonlyRootFilesystem
boolean
nullable
user
string
nullable
originProtection

Enable origin protection for all exposed ports on this container. Use originProtectionConfig for advanced options like IP allow lists.

boolean
nullable
originProtectionConfig

Extended origin protection configuration with IP allow list support

object
enabled

Whether origin protection is enabled. Defaults to true if this config object is provided.

boolean
default: true
ipAllow

List of IP addresses or CIDR ranges that can bypass origin protection for direct access (e.g., VPN IPs)

Array<string>
nullable
redirectHost

Optional bare host (e.g. www.example.com). When set, requests denied by origin protection are 302-redirected to https:// with path and query preserved, instead of receiving a 403. Allowed IPs and valid-header (CDN) traffic are unaffected.

string
nullable
loadBalancerHealthCheck

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

Path the load balancer requests. Starts with /.

string
default: / nullable <= 1024 characters /^/[A-Za-z0-9._~\-/]*(\?[A-Za-z0-9._~\-=&]*)?$/
intervalSeconds

Seconds between checks.

integer
default: 45 nullable >= 15 <= 300
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

Media typeapplication/json
object
error
string
Examplegenerated
{
"error": "example"
}

Permission or token scope missing

The environment has no container with this name

Media typeapplication/json
object
error
string
Examplegenerated
{
"error": "example"
}

Another container update for this environment is in progress

Media typeapplication/json
object
error
string
Examplegenerated
{
"error": "example"
}

Invalid container definition, or the body name does not match the path name

Quant Cloud did not accept the request

Media typeapplication/json
object
error
string
Examplegenerated
{
"error": "example"
}