PUT /projects/{project_id}/environments/{env_id}/settings
Changed onRequest
- Base URL/api (relative, and the document was published on a file host, not at the API’s origin)
- AuthHTTP bearer
Path parameters
Project ID or slug
Environment ID or slug
Request body
Anti-affinity: spread replicas across different nodes. When enabled, the scheduler avoids placing two replicas of the same environment on the same node. Defaults to true.
Per-environment CAPTCHA attack-mode override (tri-state):
- absent → leave the current override unchanged
- JSON null → clear the override (inherit the project-level setting)
- true/false → override the project setting for this environment
Kept for consoles that predate Shield modes: true sets the Shield mode to attack, false leaves attack, null inherits both. When shield_mode is also sent, shield_mode wins.
Enable/disable automatic deployments for this environment
Absent preserves the tracked branch; null explicitly clears it.
Where a source deployment's image is built.
The control plane is the default and the historical behaviour. Node moves the build — the most CPU- and memory-hungry step of a deployment — onto a worker node so it stops competing with the proxy, the database and running workloads on the control plane. A node labelled temps.sh/role=builder is preferred; otherwise the node the deployment is placed on builds it.
Node is a preference, not a requirement: when no worker can take the build (none joined, none of the right architecture, or a multi-architecture build) the build runs on the control plane and the build log says why. A static site may build on a worker of any architecture, since its output is read from that node and never runs.
Maximum (limit) CPU in microcores. Send JSON null to clear → "no limit". Absent leaves the current value unchanged.
Minimum (request) CPU in microcores. Send JSON null to clear (no request). Absent leaves the current value unchanged.
Build one image per architecture the eligible nodes run (overrides the project-level setting). Off by default: cross-architecture builds are emulated on the control plane and substantially slower, so they are opted into per environment rather than triggered by cluster topology.
Port exposed by the container (overrides project-level port for this environment)
Priority order for port resolution:
- Image EXPOSE directive (auto-detected from built image)
- This environment-level exposed_port (overrides project setting)
- Project-level exposed_port (fallback)
- Default: 3000
Per-environment HTTP→HTTPS redirect override (tri-state):
- absent → leave the current override unchanged
- JSON null → clear the override (inherit the proxy default, which redirects only when the host has an active TLS certificate)
- true → always redirect plain HTTP to HTTPS for this environment, even when no local certificate exists (TLS terminated upstream)
- false → never redirect this environment, even when a certificate does exist
Requests under /.well-known/acme-challenge/ are never redirected regardless of this setting, so ACME HTTP-01 validation always completes.
Seconds of inactivity before stopping containers (60-86400). Default: 300.
Override the proxy's cap on concurrent in-flight requests to this environment's upstream (0 = unlimited). Absent leaves the current value unchanged. Send JSON null to clear the override (inherit the project/global default). See issue #646.
Maximum (limit) memory in MB. Send JSON null to clear → "no limit". Absent leaves the current value unchanged.
Minimum (request) memory in MB. Send JSON null to clear (no request). Absent leaves the current value unchanged.
Enable on-demand mode (scale-to-zero). Containers are stopped after idle_timeout_seconds of no traffic and started on the next request.
A credential. Write-only: it is never returned, and the AI assistant supplies it through a secret slot instead of typing it into the conversation.
Enable/disable performance metrics collection
When true, git pushes do NOT auto-deploy to this environment. Deployments must be promoted from another environment.
Override the proxy's timeout for regular (non-streaming) HTTP requests to this environment, in seconds (0 = no timeout, or 1-86400). Always clamped to the operator's global hard ceiling regardless of what's set here. Absent leaves the current value unchanged. Send JSON null to clear the override (inherit the project/global default).
Enable/disable session recording
Paths Shield never challenges here (ADR 066 D7), replacing the stored list: /api/* exempts everything under /api/, anything else one exact path; at most 64. Omit to leave them unchanged.
How an environment acts on verdicts (D1).
Override the proxy's idle timeout for Server-Sent Events streams to this environment, in seconds (0 = no timeout, or 1-86400). Always clamped to the operator's global hard ceiling. Absent leaves the current value unchanged. Send JSON null to clear the override.
Override how long, in seconds (1-3600), this environment's previous deployment gets to finish in-flight requests after SIGTERM, once a new deployment is live, before it is killed. Absent leaves the current value unchanged. Send JSON null to clear the override (inherit the project value, else 10 seconds).
Optional list of node IDs to deploy to (overrides project-level setting). Send an empty list to clear the environment-level override.
Max seconds to wait for containers to start on wake (5-120). Default: 30.
Override the proxy's idle timeout for WebSocket connections to this environment, in seconds (0 = no timeout, or 1-86400). Always clamped to the operator's global hard ceiling. Absent leaves the current value unchanged. Send JSON null to clear the override.
Example request
{
"exposed_port": 8080
}Response
Environment settings updated successfully
Per-environment CAPTCHA attack-mode override. null means inherit the project-level attack_mode; true/false explicitly enable/disable the challenge for this environment. Always serialized (NOT skipped) so the UI can distinguish null from false.
Estimated time (ISO 8601, UTC) when the environment will go to sleep based on last activity + idle timeout. NULL when sleeping or on-demand disabled.
Per-environment HTTP→HTTPS redirect override. null means inherit the proxy default (redirect only when the host has an active TLS certificate); true always redirects plain HTTP for this environment, false never does. Always serialized (NOT skipped) so the UI can distinguish null from false.
Indicates if this is a preview environment (auto-created per branch) For preview environments, 'branch' contains the feature branch name
Last proxied request time (ISO 8601, UTC) for on-demand environments. NULL when on-demand is disabled or no traffic has been received yet.
Set when the settings can't be honoured as written: anti-affinity is on, but there are fewer eligible nodes than replicas, so some replicas will share a node. Deploys still go ahead. Reported when reading one environment and when saving its settings, not in lists.
When true, git pushes do NOT auto-deploy to this environment. Deployments must be promoted from another environment.
Paths Shield never challenges in this environment (ADR 066 D7): /api/* exempts everything under /api/, any other entry one exact path.
How an environment acts on verdicts (D1).
When true, the environment's containers are currently stopped due to inactivity (on-demand mode) and will start on the next request.
The host label stored for this environment (e.g. myproject-production). This is the prefix that is combined with the platform's preview domain at request time to produce main_url. Edit this via the rename-subdomain endpoint, not the full URL.
Changes
- breaking
the
created_atresponse's property type changed fromintegertostring, and format fromint64todate-timefor status - breaking
the
estimated_sleep_atresponse's property type changed fromintegernulltostringnull, and format fromint64todate-timefor status - breaking
the
last_activity_atresponse's property type changed fromintegernulltostringnull, and format fromint64todate-timefor status
1 more change in this revision
- breaking