---
title: "Update application settings"
method: PUT
path: "/settings"
tags: ["Settings"]
---

# Update application settings

`PUT /settings`

## Request

- Base URL: `/api` (relative, and the document was published on a file host, not at the API’s origin)
- URL: `/api/settings`
- Auth: HTTP bearer

## Request body

- AppSettings: Application settings stored in the database All fields have sensible defaults for easy onboarding
  - `agent_sandbox` AgentSandboxSettings: Global agent sandbox settings. Controls whether agent runs are isolated inside Docker containers by default. Individual agents can override this.
    - `allowed_node_ids` integer[], nullable: Nodes allowed to run sandboxes (ADR-048). `None` (the default) = every node, including the control plane. `Some(ids)` = only those nodes; the control plane is id `0`. `Some([])` disables sandbox creation. Owned by `PUT /sandboxes/placement`; the generic settings update preserves the stored value.
    - `api_key_encrypted` string, nullable: DEPRECATED: use `providers[default_provider].credentials_encrypted` instead.
    - `auth_type` string: DEPRECATED: use `providers[default_provider].auth_type` instead.
    - `cpu_limit` number, double: CPU limit in cores for sandbox containers
    - `custom_image` string: Custom Docker image (only used when runtime is "custom"). Must have git and claude CLI installed.
    - `default_provider` string: Default AI provider for agents: "claude_cli", "opencode", or "codex_cli". Workspaces always use this provider — no per-session override.
    - `enabled` boolean: Sandbox is always enabled — the executor refuses to run any agent outside a sandboxed container. Field is retained so existing settings rows still deserialize, but it is ignored at runtime.
    - `max_cpu_limit` number, double, nullable: Highest `cpu_limit` (cores) a `POST /sandboxes` request may ask for. `cpu_limit` above only sets the default for requests that omit the field; this is the ceiling. `None` = the built-in ceiling (16 cores). A value above the built-in ceiling has no effect.
    - `max_memory_limit_mb` integer, nullable: Highest `memory_limit_mb` a `POST /sandboxes` request may ask for. `None` = the built-in ceiling (32768 MB). On the control plane the host's physical memory is an additional ceiling.
    - `max_pids_limit` integer, nullable: Highest `pids_limit` a `POST /sandboxes` request may ask for. `None` = the built-in ceiling (4096).
    - `max_sandboxes_per_user` integer, nullable: Most sandboxes (not destroyed) one user may have created through `POST /sandboxes` at a time; a create over the cap is refused. `None` = unlimited. AI application workspaces, agent runs and the sandboxes the platform creates for AI chat or autofix do not count and are not refused. Sandboxes created before this setting existed are not counted either.
    - `memory_limit_mb` integer: Memory limit in MB for sandbox containers
    - `network_mode` string: Network access level: "full" (unrestricted), "restricted" (Temps network only), "none" (no network)
    - `providers` object: Per-provider auth + config. Keyed by provider id (e.g. `claude_cli`, `codex_cli`, `opencode`). Adding a new provider only requires a new catalog entry on the Rust side — the JSON column stays migration-free.
    - `runtime` string: Runtime preset: "node", "bun", "python", "rust", "go", "full", or "custom"
    - `sandbox_backend` string, nullable: Default isolation backend for sandboxes: "docker" (default), "firecracker" (ADR-029; requires `temps firecracker setup`) or "microsandbox" (ADR-050, experimental; requires `temps microsandbox setup`). Only consulted when the selected microVM backend probes available — otherwise Docker is used.
  - `ai_chat_limits` AiChatLimitsSettings: Limits on a single AI chat turn. Operator-tunable because the right value depends on the model: a turn against a slow self-hosted model can legitimately take ten minutes, while a hosted one finishes in seconds and a shorter ceiling keeps costs predictable.
    - `turn_timeout_secs` integer: How long one turn may run before it is stopped and the partial answer returned, in seconds. The user is told the turn was cut short. Checked between steps, not mid-call: a model round already in flight finishes, so a turn can overrun by up to one round. Against a slow self-hosted model that is a minute or two. Aborting mid-stream would cut the answer off in the middle of a sentence and throw away work already paid for, which is worse than a late stop.
  - `ai_config` AiConfigSettings: Global AI configuration settings. Controls the default config repo containing `.claude/` directory (skills, MCP servers, plugins) that gets overlaid into every agent sandbox.
    - `config_repo` string: Global config repo URL in "owner/repo" format (e.g. "myorg/claude-config"). Cloned at agent run time and overlaid into the sandbox's `.claude/` directory.
    - `config_repo_allowlist` string[]: Repositories a project's agents may name as their own `config_repo`, besides the project's own repository. An entry is `owner/repo`, or an owner followed by a slash and an asterisk to allow every repository of that owner. The global config repo above is the administrator's own choice and does not need to be listed.
    - `config_repo_branch` string: Branch of the config repo to use.
  - `ai_workspace_file_limits` AiWorkspaceFileLimitsSettings: Transfer and preview limits for files in persistent AI workspaces. These are runtime settings because operators have different control plane memory budgets and commonly work with very different asset sizes.
    - `max_download_size_mb` integer
    - `max_file_size_mb` integer
    - `max_files_per_upload` integer
    - `max_image_preview_size_mb` integer
    - `max_text_preview_kb` integer
    - `max_upload_size_mb` integer
    - `max_workspace_entries` integer
    - `max_workspace_size_mb` integer
  - `analytics_retention` AnalyticsRetentionSettings: Retention windows for product analytics data and for the personal identifiers (visitors, client IP addresses) attached to it. Applied by a background job, not at save time, so a change takes effect within the job's interval.
    - `error_events_days` integer, nullable: Retain captured error events for this many days. `null` keeps them until the project is deleted. Error groups keep their counters.
    - `events_days` integer: Retain analytics events (page views, custom events) for this many days. Applied to the TimescaleDB events policy and, when configured, the ClickHouse events TTL. Reconciled hourly and after ClickHouse migrations. ClickHouse expiry follows asynchronous background merges.
    - `unreferenced_ip_days` integer, nullable: Delete a stored client IP address (and its derived location) once nothing references it and it has not been looked up for this many days. Never applied sooner than the proxy-log retention (`observability_retention.proxy_logs_days`): request logs kept outside PostgreSQL still point at the address. `null` keeps every address ever seen.
    - `visitor_days` integer, nullable: Delete visitors that have not been seen for this many days. Their session replays are deleted with them. With ClickHouse enabled, their project-scoped events are deleted from both databases; failures leave visitors for retry. With PostgreSQL only, events are detached and kept. Proxy logs and error events keep their own retention. This is not erasure of all visitor data. `null` keeps visitors indefinitely.
  - `anonymous_telemetry_enabled` boolean, nullable: Admin preference for anonymous product telemetry (the events sent to the Temps maintainers by `temps-product-telemetry`; unrelated to Temps Cloud mirroring in `cloud.telemetry_enabled` and to OpenTelemetry ingest). - `None` (default) — the operator has not chosen; the built-in default applies (see `temps_product_telemetry::DEFAULT_TELEMETRY_ENABLED`). - `Some(true)` / `Some(false)` — an admin turned it on/off from Settings › Telemetry. Applied at runtime without a restart. The `TEMPS_TELEMETRY=0` environment variable is a host-level kill switch that wins over this value unconditionally. The dedicated `PATCH /settings/telemetry` endpoint is the only write path: the generic settings save restores the stored value under the row lock, so an older client round-tripping the whole document cannot flip it.
  - `backup_executor` BackupExecutorSettings: Backup executor concurrency. Replaces `TEMPS_BACKUP_EXECUTOR_MAX_CONCURRENT`; applied at the next restart.
    - `max_concurrent` integer: Backup jobs run concurrently on this control plane.
  - `blob` BlobSettings: Managed Blob service (RustFS container) settings. Owned by `PATCH /blob/settings`; the generic settings update preserves the stored value.
    - `container_name` string: Docker container name of the Blob RustFS container. Empty means the per-instance default. A custom value must start with `rustfs-`.
  - `build_limits` BuildLimitsSettings: Build-time resource limits applied on the control plane to prevent `docker build` from saturating host CPU/RAM. Worker nodes are intentionally NOT subject to these limits (each worker is dedicated hardware that already has its own per-host headroom).
    - `build_cache_max_gb` integer: Upper bound for Docker's build cache, in gigabytes. The nightly cleanup removes the least recently used cache records that no build is using until the total is at or below this size. 0 disables the size cap (only `build_cache_max_unused_days` applies). Re-read on every nightly run. Applies to this host's Docker daemon; worker nodes use the default.
    - `build_cache_max_unused_days` integer: Build cache records unused for longer than this many days are removed by the nightly cleanup, whatever the total size. Valid range 1..=365.
    - `cpu_limit_cores` number, float: CPU cores allowed per build (float, e.g. 2.0 = 2 cores, 0.5 = half a core). 0 means "use the legacy 50%-of-host default". Applied only by Docker's legacy builder: BuildKit, the default since Docker 18.09, ignores the CPU and memory options of the image build API, so on BuildKit hosts this has no effect. Applies live to builds that start after the change; a running build keeps the cap it started with.
    - `max_concurrent` integer: Maximum number of `docker build` operations allowed to run at the same time on the control plane. Additional builds queue. Min 1. Applies live: raising it starts queued builds right away; lowering it lets running builds finish and holds new ones until they do.
    - `memory_limit_mb` integer: Memory allowed per build, in megabytes. 0 means "use the legacy 50%-of-host default". Same scope as `cpu_limit_cores`: applied only by the legacy builder, ignored by BuildKit, applied live to builds that start after the change. Values above 2047 MB are reduced to 2047 MB, the most the build API accepts through the client, with a warning in the server log.
  - `bunny_new_projects` boolean: Enable Bunny delivery by default only for projects created after this is set.
  - `clickhouse` ClickHouseSettings: How Temps talks to the instance's ClickHouse server (wire compression of query responses). Read once when the process starts, so a change is applied by the next restart; the Settings API reports the mode the running process actually uses next to the stored one.
    - `compression` 'lz4' | 'none': Wire compression for query responses. See [`ClickHouseCompression`].
  - `cloud` CloudSettings: Managed control-plane connection. Credentials are deliberately not stored here; they live in the owner-only cloud-link state file.
    - `backend_url` string: HTTPS origin used for enrollment and telemetry mirroring.
    - `backups_enabled` boolean: Explicit consent to export completed backup objects.
    - `console_access_enabled` boolean: Explicit operator consent to let Temps Cloud open this instance's console over the outbound relay, using managed OIDC authentication. Default off for every enrollment path. Linking, including unattended bootstrap, never enables console access; enable it explicitly in Settings > Temps Cloud or with `temps cloud console-access enable`.
    - `notifications_enabled` boolean: Explicit consent to send notifications through managed providers.
    - `telemetry_bulk_anomaly_factor` number, float, nullable: ADR-042 §6.3: how far a project's shipped bytes may exceed its pre-send estimate before the bulk activation stops that project. `None` — the default — resolves to [`DEFAULT_CLOUD_TELEMETRY_BULK_ANOMALY_FACTOR`]. The guard exists because an estimate that is wrong by an order of magnitude means a bug, and *a bug that costs money should stop* rather than run away with a customer's egress spend on a path that has no human confirm behind it. An operator setting on the singleton `settings` row rather than an environment variable, per CLAUDE.md: the right multiple depends on how heterogeneous that instance's spans actually are, which only the operator running it can know, and they must be able to widen it — or narrow it — without restarting the binary mid-activation. Below `1.0` every project would pause on its first chunk, and above [`MAX_CLOUD_TELEMETRY_BULK_ANOMALY_FACTOR`] the guard stops being a tuning knob and becomes an off switch. The settings write path rejects values outside that range, and the effective value is clamped on read besides; see [`CloudSettings::effective_bulk_anomaly_factor`]. The schema bounds below are documentation for a client; they are not what enforces this. The server validates the range on write.
    - `telemetry_bulk_rate_limit_spans_per_sec` integer, nullable: ADR-042 §3: optional throttle, in spans per second, on a **bulk Cloud telemetry activation** backfill. `None` — the default — is unthrottled, which is what "activate now" means and is right for an instance that is idle or being cut over deliberately. An operator running an activation against a live instance can set a ceiling so the backfill stops competing with their own read IO and with the Cloud ingest allowance. An operator setting on the singleton `settings` row rather than an environment variable, per CLAUDE.md, so it can be changed **while a job is running** — which is exactly when an operator discovers they need it, and exactly when restarting the binary would mean stopping an activation they have already paid for. The worker re-reads it each time it picks up a project, so a change takes effect at the next project boundary rather than at the next restart. Only the bulk worker reads this. The live Cloud-primary write path is a primary path and is never throttled; the offline `temps backfill cloud-telemetry` tool keeps its own `--rate-limit-spans-per-sec` flag, because it runs in a different process with the server stopped.
    - `telemetry_consent_bootstrapped` boolean: Set once Temps Cloud's bootstrap file has applied its telemetry-export consent (ADR-045 Amendment 2). Cloud drops that file on every upgrade of a hosted plane; this makes the consent apply exactly once, so an operator who later turns telemetry off is not overridden by the next upgrade. Never set on a self-hosted instance.
    - `telemetry_enabled` boolean: Explicit consent to mirror locally stored telemetry.
    - `telemetry_outbox_max_bytes` integer: ADR-041 §3d: hard ceiling, in bytes, on the durable span outbox that backs Cloud-primary telemetry writes. An operator setting on the singleton `settings` row rather than an environment variable, per CLAUDE.md, so it can be raised at runtime by the operator watching a queue fill up — which is exactly when they need to change it and exactly when restarting the binary is the worst available option. Expressed in **bytes and not rows**: the reference deployment is 3 vCPU / 4 GB, and a row count says nothing about disk on a table whose rows are serialized spans of wildly varying size. When the queue reaches this size the instance stops accepting new spans for Cloud-primary projects and records a gap window with a start, an end and a count — see [`DEFAULT_CLOUD_TELEMETRY_OUTBOX_MAX_BYTES`] for how the default is sized and what it buys.
  - `cloudflare_new_projects` boolean: Enable Cloudflare delivery by default for projects created after this is set.
  - `cluster_dns` ClusterDnsSettings: Cluster-DNS resolver settings (ADR-024, experimental beta). Off by default — see `ClusterDnsSettings` for the incident background and trade-offs. Must be explicitly enabled by operators who need `*.temps.local` service-to-service resolution inside containers.
    - `enabled` boolean: Master switch. When `false` (default), no custom DNS is injected into containers — they use Docker's embedded DNS which forwards to the host's own `resolv.conf`. When `true`, the control-plane Hickory resolver is started and its bridge IP is injected as the first nameserver so `*.temps.local` FQDNs resolve inside containers.
    - `operator_chosen` boolean: Whether an operator has ever changed `enabled` themselves. Until then, the control plane turns cluster DNS on when the first worker joins, since cross-node links need `*.temps.local`. Set by the server when a save changes `enabled`; a client cannot clear it.
  - `connection_limits` ConnectionLimitSettings: Per-upstream concurrent-connection cap applied by the proxy to customer app traffic. `0` (the default) is unlimited. See issue #646.
    - `default_max_concurrent_connections` integer: Default max concurrent in-flight requests to a single project/environment's upstream, used when the project/environment hasn't set its own `max_concurrent_connections` override. `0` (the default) means unlimited — matches the "opt-in, never breaks an existing app on upgrade" philosophy already established for `RequestTimeoutSettings`.
  - `console_force_https` boolean, nullable: Whether plain-HTTP requests to the console host (`external_url`) are redirected to HTTPS. Same tri-state contract as an environment's `force_https`: - `None` (default) — inherit the per-host heuristic: redirect only once the console hostname has actually completed TLS provisioning. An HTTP-only install, and an install whose TLS is terminated upstream, are both left alone. - `Some(true)` — always redirect. For operators who terminate TLS at Temps but have not provisioned the cert through Temps. - `Some(false)` — never redirect, even once a certificate exists. Deliberately operator-set rather than inferred. Temps cannot tell "HTTPS terminated by an upstream CDN" apart from "plain HTTP" — both arrive as a plaintext connection, and `X-Forwarded-Proto` is not trustworthy from an arbitrary peer — so inferring `true` from an `https://` `external_url` would 301 a CDN-fronted console into an infinite redirect loop with no way out but the global kill switch.
  - `console_version` string, nullable: Binary version tag (e.g. "v0.1.0") of the *console* process (`temps serve`, role=all or role=console) that last started. Written on console startup; read by the standalone `temps proxy` to detect version skew during a rolling upgrade (ADR-017 Phase 3). `None` on installs that never ran a console build carrying this field. This is informational state written by the binary itself — NOT an operator-tunable setting. It is intentionally absent from `AppSettingsResponse` and the PATCH path so an operator cannot accidentally overwrite the self-recorded value.
  - `container_logs` ContainerLogSettings: Docker container log rotation settings Controls the `--log-opt max-size` and `--log-opt max-file` for containers
    - `cache_mb` integer: Disk budget, in MiB, for the collected-log read cache (`logs/cache` under the data dir): recently read chunk blocks, block indexes and bloom filters kept locally so searches over object storage do not re-fetch them (ADR-046 §6). Applied within a minute of saving; shrinking evicts immediately.
    - `head_buffer_mb` integer: Per-container cap, in MiB, on unsealed log lines held in memory (and the WAL) before they are sealed into a chunk object. Larger buffers mean fewer, bigger chunks; smaller ones bound memory per container.
    - `ingest_kib_per_sec` integer: Per-container ingestion budget, in KiB per second, enforced alongside `ingest_lines_per_sec`. `0` disables the byte limit. A project or managed service can override it (`log_ingest_kib_per_sec`).
    - `ingest_lines_per_sec` integer: Per-container ingestion budget, in lines per second. A container over budget has its excess lines dropped (not stored or indexed), a notice written into its log, and is listed as throttled in the log explorer. Up to 10 seconds of budget may arrive at once. `0` disables the line limit. Applied within a minute of saving. A project or managed service can override it (`log_ingest_lines_per_sec`).
    - `max_file` integer: Maximum number of rotated log files to keep (e.g., 3 means up to 3 x max_size total)
    - `max_size` string: Maximum size of each log file (e.g., "50m", "100m", "1g") Docker default is unlimited; we default to "50m" to prevent disk exhaustion
    - `service_max_file` integer: Maximum rotated log files for external service containers
    - `service_max_size` string: Maximum size for external service container logs (postgres, redis, etc.) Defaults to "20m" since services are typically less verbose than app containers
  - `control_plane_resources` ControlPlaneResourceSettings: The control plane's (node 0's) scheduling settings, the counterpart of `nodes.resource_policy` / `nodes.system_reserved` on worker rows (ADR-055 §5). Stored here because node 0 is not a `nodes` row; changed through `PUT /nodes/0/resources`.
    - `enforce_reservations` boolean: `true` = `enforced`: refuse a placement on the control plane whose reservations exceed its capacity minus the reserve. `false` (the default) = `best_effort`.
    - `system_reserved_cpu_millis` integer, nullable: CPU kept for Temps itself, in millicores. `None` = the default.
    - `system_reserved_memory_mb` integer, nullable: Memory kept for Temps itself, in megabytes. `None` = the default.
  - `disk_space_alert` DiskSpaceAlertSettings: Disk space alert settings for monitoring disk usage
    - `check_interval_seconds` integer: Interval in seconds between disk space checks
    - `enabled` boolean: Whether disk space alerts are enabled
    - `monitor_path` string, nullable: Restrict monitoring to the disk backing this path. When unset (the default), every mounted writable volume is monitored — including dedicated volumes such as `/var/lib/docker`.
    - `threshold_percent` integer: Threshold percentage (0-100) at which to trigger alerts
  - `dns_provider` DnsProviderSettings
    - `cloudflare_api_key` string, nullable
    - `provider` string
  - `docker_registry` DockerRegistrySettings
    - `ca_certificate` string, nullable
    - `enabled` boolean
    - `password` string, nullable
    - `registry_url` string, nullable
    - `tls_verify` boolean
    - `username` string, nullable
  - `edge_target` string, nullable: Public edge target that generated DNS records point at when a managed domain opts into automatic record sync. An IPv4/IPv6 address produces an `A`/`AAAA` record; anything else is treated as a `CNAME` target. `None` disables DNS record sync regardless of per-domain opt-in.
  - `environment_hostname_template` string, nullable: Label of a new environment's generated hostname under `preview_domain`, from `{project}` and `{env}` (ADR 058 D9). `None` means [`temps_core::public_hostname::DEFAULT_ENVIRONMENT_LABEL_TEMPLATE`]. Applies to environments created after it is set; existing ones keep their names.
  - `expose_platform_identity` boolean, nullable: Opt in to platform identity in proxy responses. Missing values preserve the stored choice.
  - `external_url` string, nullable
  - `geo` GeoSettings: Geolocation database refresh policy, MaxMind credential (encrypted at rest), and the self-recorded freshness metadata of the last refresh.
    - `build_epoch` integer, nullable: MaxMind `build_epoch` of the database that was last installed.
    - `last_check_at` string, date-time, nullable: When a refresh was last attempted, successful or not.
    - `last_check_status` string, nullable: [`GEO_CHECK_STATUS_OK`] or [`GEO_CHECK_STATUS_ERROR`].
    - `last_error` string, nullable: Redacted reason the last refresh failed, so an operator can act on it without reading server logs. Never contains the license key.
    - `last_refreshed_at` string, date-time, nullable: When new database bytes were last installed and swapped in. Self-recorded by the refresh job; never writable by a client.
    - `maxmind_license_key_encrypted` string, nullable: AES-256-GCM ciphertext of the MaxMind license key, as produced by `EncryptionService::encrypt_string`. Never returned by the API.
    - `refresh_interval_hours` integer, nullable: How often the scheduled refresh job runs. `None` means [`DEFAULT_GEO_REFRESH_INTERVAL_HOURS`]; read it through [`GeoSettings::effective_refresh_interval_hours`].
    - `source` string, nullable: [`GEO_SOURCE_MAXMIND_OFFICIAL`] or [`GEO_SOURCE_BUNDLED_GITHUB`].
    - `stale_lookup_days` integer, nullable: Age at which a stored IP -> location row is re-resolved on its next lookup. `None` means [`DEFAULT_GEO_STALE_LOOKUP_DAYS`]; read it through [`GeoSettings::effective_stale_lookup_days`].
  - `image_retention` ImageRetentionSettings: Retention policy for locally-built deployment images. Modeled as a settings row (not an env var) per CLAUDE.md so an operator can change the system-wide default at runtime without restarting the binary. Individual projects override it via `projects.image_retention_hours`.
    - `default_hours` integer: Default hours to keep a built deployment image when the owning project has no `image_retention_hours` override. Valid range 1..=8760.
    - `enabled` boolean: Whether the nightly pass removes expired deployment images at all. Disabling it keeps every built image forever (the pre-0.1 behaviour).
  - `insecure_tls` boolean: Skip TLS certificate verification on outbound HTTP clients built by the server (deployer, agent, remote service client). Strictly opt-in for operators running self-signed control plane / worker certs on a trusted internal network. Worker→control-plane traffic that traverses the public internet must keep this `false` — otherwise a MitM steals the join token.
  - `internal_url` string, nullable: URL that service containers use to reach the Temps API from *inside* the Docker network (OTLP metrics ingest, agent callbacks, etc.). On Docker Desktop this defaults to `http://host.docker.internal:<console_port>`; on Linux it requires the `host.docker.internal:host-gateway` host mapping (which Temps adds to provisioned containers). Distinct from `external_url`, which is the public-facing address.
  - `kv` KvSettings: Managed KV service (Redis container) settings. Owned by `PATCH /kv/settings`; the generic settings update preserves the stored value.
    - `container_name` string: Docker container name of the KV Redis container. Empty means the per-instance default. A custom value must start with `redis-`.
  - `letsencrypt` LetsEncryptSettings
    - `email` string, nullable
    - `environment` string
  - `loopback_ja4_header` string, nullable: The header a trusted loopback proxy puts the visitor's JA4 TLS fingerprint in (ADR 066, D4), e.g. `x-ja4`. Read only from a peer `trust_loopback_forwarded_ip` trusts, and removed from every request before it goes upstream. `None` records no JA4 behind such a proxy. Set through [`normalize_loopback_ja4_header`].
  - `managed_service_healthchecks` ManagedServiceHealthcheckSettings: Instance-wide defaults for the Docker healthcheck of managed service containers. Owned by `PUT /external-services/healthcheck-defaults`, which validates and audits them; the generic settings update preserves the stored value. Unset values use Temps' built-in timings.
    - `interval_secs` integer, nullable: Seconds between checks once a container is healthy (5–3600).
    - `retries` integer, nullable: Consecutive failed checks that make a container unhealthy (1–10).
    - `start_interval_secs` integer, nullable: Seconds between checks while a container is starting (1–60).
    - `start_period_secs` integer, nullable: Seconds after start during which failed checks do not count (0–600).
    - `timeout_secs` integer, nullable: Seconds one check may run before it counts as failed (1–60).
  - `mcp_server` McpServerSettings: MCP server settings (ADR-039). Off by default — enable via the Settings UI to expose the MCP endpoint to the Temps CLI wizard.
    - `enabled` boolean: Master switch. When `false` (default), `GET /mcp/tools` returns `404` and all other MCP endpoints return `404` too. Set to `true` via the Settings UI to activate the MCP server.
  - `monitoring` MonitoringSettings: Metrics observability settings. Controls the MetricsStore backend, scrape interval, and tiered retention windows.
    - `clickhouse_url` string, nullable: ClickHouse DSN (legacy, optional). The runtime metrics store is built from the `TEMPS_CLICKHOUSE_*` env vars, never from this field; it is retained for compatibility and operator reference only. Example: `"http://localhost:8123"`.
    - `enabled` boolean: Enable or disable all metrics collection (scraping + alerting). Defaults to `false` so new installs don't write to TimescaleDB until an operator explicitly enables the feature.
    - `retention_daily_years` integer: How many years of daily-aggregate data to keep (converted to days internally).
    - `retention_hourly_days` integer: How many days of hourly-aggregate data to keep.
    - `retention_raw_days` integer: How many days of raw (30 s resolution) metric data to keep.
    - `scrape_interval_secs` integer: How often the MetricsScraper collects data from all sources, in seconds. Saving accepts 15 to 300 s: windowed metrics such as the Postgres cache hit ratio need several scrapes in their 15 minutes. A value above 300 s stored before that limit is kept when a save leaves it unchanged, and the MetricsScraper clamps it to 300 s at runtime, as it clamps anything below 10 s to 10 s.
    - `store` 'timescale_db' | 'click_house': Storage backend for metric data.
  - `multi_node` MultiNodeSettings: Multi-node cluster settings
    - `cluster_ca_cert_pem` string, nullable: Per-cluster CA certificate (PEM) for multi-node mTLS (ADR-020 WS-2.1). Public — distributed to nodes as the trust root and used by the control plane as the root for verifying agent server certs. Minted lazily on the first CSR-bearing registration.
    - `cluster_ca_key_encrypted` string, nullable: Per-cluster CA private key, AES-256-GCM ciphertext (EncryptionService). SECRET — never returned over HTTP (elided in the masked response).
    - `join_token_hash` string, nullable: SHA-256 hash of the join token (never store plaintext)
    - `legacy_shared_token_enabled` boolean: Whether the legacy single shared join token is still accepted for node registration (ADR-020 WS-1.1). Defaults to `true` so existing clusters keep working on upgrade; fresh installs should set it `false` and rely on short-lived, single-use enrollment tokens instead.
    - `node_cpu_alert_percent` number, double, nullable: CPU-usage percent above which a worker node raises a resource alert (ADR-020 / monitoring). `None` disables CPU alerting. Default 90.
    - `node_disk_alert_percent` number, double, nullable: Disk-usage percent above which a worker node raises a resource alert. `None` disables disk alerting. Default 90.
    - `node_failover_after_secs` integer, nullable: Seconds a worker node must go without a heartbeat before its workloads are failed over to healthy nodes. A node is reported offline (and operators alerted) well before this; the gap is a grace period so a brief network partition or a control-plane stall does not redeploy a whole node's worth of apps that never stopped serving. `None` disables automatic failover entirely. Default 300.
    - `node_memory_alert_percent` number, double, nullable: Memory-usage percent above which a worker node raises a resource alert. `None` disables memory alerting. Default 90.
    - `private_address` string, nullable: Private/WireGuard IP address of the control plane node. Used by remote worker nodes to reach services (databases, etc.) running on the control plane. Set via `--private-address` or `TEMPS_PRIVATE_ADDRESS`.
    - `require_mtls` boolean: Whether to enforce multi-node mTLS (ADR-020 WS-2.1). New installations default to `true`. Existing serialized settings that predate this field deserialize it as `false`, providing an explicit migration window rather than unexpectedly disconnecting legacy workers. When `true`, the CP signs node CSRs, nodes serve mutual TLS, and every CP→agent call uses the cluster client cert. Observe-then-enforce: flip this on only once all workers have re-enrolled with certs.
    - `wg_endpoint` string, nullable: `ip:port` workers dial for the control plane's end of the WireGuard mesh, published instead of `private_address` on the mesh port. For a control plane reachable only through NAT or a forwarded port. Owned by `temps serve --wg-endpoint` / `TEMPS_WG_ENDPOINT`: every start records the flag's value (clearing it when the flag is absent), and a settings write never changes it. Stored here only so the processes that set the mesh up (the deployer plugin, `temps network setup-multi-node`) read the same value.
  - `observability_compression` ObservabilityCompressionSettings: TimescaleDB compression delays for immutable observability data. Changes are applied at runtime by the Settings API.
    - `otel_spans_after_hours` integer: Compress OpenTelemetry span chunks after this many hours. Defaults to 24 hours.
    - `proxy_logs_after_hours` integer: Compress proxy-log chunks after this many hours. Defaults to 24 hours.
  - `observability_retention` ObservabilityRetentionSettings: Retention windows for raw proxy and OpenTelemetry telemetry. TimescaleDB policies are updated at runtime by the Settings API.
    - `container_logs_days` integer: Retain collected container logs (chunk objects on disk/S3, their manifest rows, and the ClickHouse line index when configured) for this many days.
    - `otel_logs_days` integer: Retain OpenTelemetry log events for this many days.
    - `otel_metrics_days` integer: Retain OpenTelemetry metric points for this many days.
    - `otel_spans_days` integer: Retain OpenTelemetry spans (traces) for this many days.
    - `proxy_logs_days` integer: Retain proxy request logs for this many days.
  - `on_demand_tls` OnDemandTlsSettings: On-demand (lazy) HTTP-01 TLS issuance settings (ADR-018). When `enabled`, the proxy's `certificate_callback` triggers ACME HTTP-01 issuance for allowlisted, STABLE hostnames (per-environment aliases and the console host) that have no active cert, rather than silently failing the handshake. Ephemeral per-deployment hostnames are NEVER certed (ADR §2). New installations start with it on (`AppSettings::default`); the zone comes from `zone` or is derived from `external_url`/`preview_domain`, and nothing is issued while none can be derived or `external_url` is loopback. A settings row stored before this section existed stays off until the operator enables it.
    - `deployment_url_mode` string: How ephemeral per-deployment hostnames behave when they have no cert (they are NEVER certed — see ADR §2). One of: - `"http"` (default): serve plain HTTP on :80. - `"redirect_to_env"`: 308-redirect to the stable per-environment URL, which IS certed.
    - `enabled` boolean: Master switch. When `false` the proxy's on-demand cert gate rejects every SNI and no issuance is ever triggered. New installations start with it `true`; a stored settings row that predates this section keeps `false`.
    - `hourly_cap` integer: Global cap on total on-demand issuances per hour across all hostnames (ADR §4 Layer 3). The operator's self-imposed safety net, separate from the Let's Encrypt rate limit.
    - `max_concurrent` integer: Maximum number of ACME issuance flows allowed to run simultaneously (the concurrent-issuance semaphore, ADR §4 Layer 1). Min 1.
    - `zone` string, nullable: Zone suffix for the allowlist gate. A hostname passes the gate only if it is a direct subdomain of this zone (e.g. zone `1.2.3.4.sslip.io` admits `myapp.1.2.3.4.sslip.io` but not `deep.sub.1.2.3.4.sslip.io`). `None` (default) means "auto-derive from `external_url`"; if no zone can be derived the gate rejects all SNI, disabling the feature.
  - `otel_ingest` OtelIngestSettings: OTLP ingest rate limits, storage quota, background analysis jobs and S3 log archival (credentials encrypted at rest). Replaces the `TEMPS_OTEL_*` environment variables; applied at the next restart.
    - `enable_anomaly_detection` boolean: Run the background metric anomaly detector.
    - `enable_health_compute` boolean: Run the background service-health computation.
    - `quota_gb_per_project` integer, nullable: Per-project OTel storage quota in GiB. `None` (or `0`) disables quotas, which also skips the per-project usage estimate on every ingest.
    - `rate_limit_requests` integer: OTLP requests a project may send per window before ingest answers 429.
    - `rate_limit_window_secs` integer: Length of the rate-limit window, in seconds.
    - `s3_archive` OtelS3ArchiveSettings: Optional archival of OTel logs to an S3-compatible bucket.
      - `access_key` string, nullable: Plaintext access key, accepted on a settings write only. Blank or absent preserves the stored key.
      - `bucket` string, nullable
      - `clear_credentials` boolean: Remove both stored credentials, which turns archival off.
      - `endpoint` string, nullable: Custom endpoint for S3-compatible stores (MinIO, R2, ...).
      - `prefix` string: Key prefix archived objects are written under.
      - `region` string, nullable: Bucket region. Archival is off unless region, bucket and both credentials are configured.
      - `secret_key` string, nullable: Plaintext secret key, accepted on a settings write only. Blank or absent preserves the stored key.
  - `plugin_installation_reporting_enabled` boolean: Share verified external-plugin installation counts with the official registry. Defaults to off; each plugin receives an unlinkable ID.
  - `preview_domain` string
  - `preview_gateway` PreviewGatewaySettings: Workspace preview gateway settings (single shared container per node). Owned by `PATCH /preview-gateway/settings` and `POST /preview-gateway/upgrade`, which change the gateway's containers to match; the generic settings update preserves the stored value.
    - `auto_upgrade` boolean: When true (default), the supervisor will pull and apply the image pinned in the Temps binary on every startup. When false, the currently-running image is left alone — operators upgrade manually from the settings UI.
    - `container_name` string: Docker container name for this instance's gateway. A single Temps install owns the whole host, so the default is fine and operators never need to touch this. It exists for the case where several Temps instances share one Docker daemon — most obviously a development machine with multiple checkouts running at once. Without it those instances silently fight: the `shared_secret` is per-database, so each generates a different one, but they all reconcile the *same* container name. Each start-up sees the other's container as drifted, recreates it with its own secret, and every other instance's previews start failing with "missing or invalid X-Temps-Preview-Token". Giving each instance its own container name (and `host_port`) makes them independent.
    - `enabled` boolean: Whether Temps runs the shared preview gateway. While false its containers are removed, so workspace preview URLs are not served.
    - `host_port` integer: Host port to publish the gateway on (always bound to 127.0.0.1). Pingora forwards `ws-*` traffic to this port after authenticating.
    - `image` string: Docker image reference. Empty follows this Temps release's digest; a nonempty value is an explicit operator pin.
    - `shared_secret` string: Shared secret the host-side Pingora sends on every forwarded preview request via `X-Temps-Preview-Token`; the gateway rejects requests without it. Auto-generated on first boot, persisted in DB so the secret is stable across `temps serve` restarts regardless of cwd, `TEMPS_DATA_DIR`, or data-dir changes. MUST be masked (`***`) in any API response — never expose it over HTTP.
  - `production_hostname_template` string, nullable: Label for an environment named `production`, when it should differ (e.g. `{project}` for `app.example.com`). `None` uses `environment_hostname_template`.
  - `public_ingress_url` string, nullable: Base URL handed to third parties that call back into Temps: email open/click tracking, git provider webhooks, SES/SNS events, revenue webhooks, the Sentry DSN (ADR-051). `None` (the default) falls back to `external_url`, which is right whenever the console is publicly reachable. Set it when the console host is restricted (VPN, firewall, identity-aware proxy) so only this hostname has to be public: the proxy serves nothing but the public callback routes on it. Read it through [`AppSettings::effective_public_ingress_url`].
  - `rate_limiting` RateLimitSettings
    - `blacklist_ips` string[]
    - `enabled` boolean
    - `max_requests_per_hour` integer
    - `max_requests_per_minute` integer
    - `whitelist_ips` string[]
  - `registry_mirror_prefix` string, nullable: Prefix applied to Docker Hub base images generated for a build (e.g. autopack's `FROM node:22-slim`), turning them into `{prefix}/node:22-slim`. Unlike `docker_registry` above — which authenticates pulls to one *named* private registry a user's own image reference already points at — this rewrites Temps' own generated, otherwise-anonymous `docker.io` references, for operators whose internal registry is a path-prefixing reverse proxy rather than a `registry-mirrors`-compatible pull-through cache (which needs no rewriting at all — see docs/howto/configure-a-docker-registry-mirror). `None`/empty (the default) leaves every reference untouched.
  - `request_timeouts` RequestTimeoutSettings: Upstream request/connection timeouts applied by the proxy to customer app traffic. Provides a global hard ceiling plus global defaults for regular HTTP, SSE, and WebSocket traffic; projects and environments may set a shorter value but never exceed the ceiling here.
    - `default_http_timeout_seconds` integer: Default timeout for regular (non-streaming) HTTP requests, in seconds. Used when a project/environment hasn't set `request_timeout_seconds`. `0` (the default) means no timeout.
    - `default_sse_idle_timeout_seconds` integer: Default idle timeout for Server-Sent Events streams, in seconds. Used when a project/environment hasn't set `sse_idle_timeout_seconds`. `0` (the default) means no timeout.
    - `default_websocket_idle_timeout_seconds` integer: Default idle timeout for WebSocket connections, in seconds. Used when a project/environment hasn't set `websocket_idle_timeout_seconds`. `0` (the default) means no timeout.
    - `max_request_timeout_seconds` integer: Hard ceiling, in seconds, applied once a timeout is configured (via a global default above or a project/environment override). Has no effect on traffic with no timeout configured at all.
  - `require_mfa_for_admins` boolean: When `true`, any user holding the `Admin` role must have MFA enrolled (`users.mfa_enabled = true`) to complete a **password** login. Users without MFA enrolled are rejected with a typed error instructing them to enroll before retrying. This only gates the password-login path (`AuthService::login`) -- SSO/OIDC logins are handled by a separate code path (`OidcService::resolve_user` + `oidc_handler`) and are intentionally unaffected, since federating identity to a properly-hardened IdP is itself an acceptable alternative to local TOTP MFA. Modeled as a settings row (not an env var) per CLAUDE.md so an operator can flip it at runtime via the Settings API without restarting the binary.
  - `screenshots` ScreenshotSettings
    - `enabled` boolean
    - `provider` string
    - `url` string
  - `security_headers` SecurityHeadersSettings
    - `content_security_policy` string, nullable
    - `enabled` boolean
    - `permissions_policy` string, nullable
    - `preset` string
    - `referrer_policy` string
    - `strict_transport_security` string
    - `x_content_type_options` string
    - `x_frame_options` string
    - `x_xss_protection` string
  - `self_update` SelfUpdateSettings, nullable: Controls the console's one-click "Update now" action.
    - `channel` string, nullable: Release channel this install tracks: `stable`, `beta` or `nightly`. `None` (the default) means "infer from the running version tag", which is what the CLI has always done — a `-nightly.` build tracks nightly, a `-beta.N` build tracks beta, a plain tag tracks stable. Setting it explicitly pins the channel, so an operator can move a nightly box back onto stable without reinstalling.
    - `enabled` boolean: Allow admins to apply a release and restart the server from the console. `true` by default: the action is permission-gated, audited, and only ever installs an official release whose published SHA-256 matches. Turning this off hides nothing — the console still shows the update banner and the manual command, it just refuses to run it for you.
  - `setup_complete` boolean: Set to `true` by `temps setup` (all modes) once initial configuration has been applied. The web onboarding wizard reads this from the server and skips itself when true, preventing the "Configure Base Domain" wall from appearing on installs that were already configured via the CLI.
  - `shield` ShieldSettings: ADR 066: platform-wide Shield settings.
    - `share_observations` boolean: Whether what one environment's visitors did counts for every environment (D9): addresses and fingerprints learned from events are proposed, and an approved proposal applies fleet-wide. Nothing applies without an approval. Off, nothing is proposed or applied.
  - `tenant_resource_ceilings` TenantResourceCeilings: Ceilings the operator places on what a *tenant* may configure for their own project/environment. Entirely unenforced by default, so an upgrade never changes what an existing config means.
    - `allow_unlimited_request_timeouts` boolean: Whether a project/environment may set a request, SSE or WebSocket timeout of `0` ("no timeout"). `true` (the default) preserves current behaviour. Nonzero tenant timeouts need no ceiling here: they are already clamped to [`RequestTimeoutSettings::ceiling`] at resolution time. `0` escapes that clamp by construction — it means "no timeout is configured", so there is nothing to clamp — which is precisely the hole this closes.
    - `max_concurrent_connections` integer: Largest `max_concurrent_connections` a project/environment may set. `0` (the default) leaves it unenforced. As with memory, a project value of `0` means unlimited and is refused whenever this ceiling is set.
    - `max_memory_limit_mb` integer: Largest `memory_limit` (MB) a project/environment may set for its containers. `0` (the default) leaves it unenforced. A project value of `0` means "no cgroup limit at all", so it is refused whenever this ceiling is set — that is the case that OOMs the host, not merely a large number.
  - `trust_loopback_forwarded_ip` boolean, nullable: Allow the proxy to use forwarding headers from a loopback peer for client IP attribution. `None` means an older client did not send the field; the settings handler preserves the stored decision on PUT. This is the sole control surface — there is no CLI/env override.
  - `trusted_private_networks` string[]: Private networks (CIDRs or single addresses) that user-configured outbound requests may reach: webhooks, notification channels, uptime checks, AI gateway providers, self-hosted git, importers. Empty by default, which keeps the SSRF guard blocking every private, loopback and CGNAT destination. Only private ranges are accepted, and cloud metadata endpoints stay blocked regardless. Published process-wide via `url_validation::set_trusted_private_networks`.
  - `trusted_proxy_cidrs` string[]: Inbound reverse proxy IPs/CIDRs trusted to append or overwrite forwarded client IP headers. Stored in the settings row; empty trusts no extra peers.

## Response `200`

Settings updated successfully

- SettingsUpdateResponse: Response for successful settings update
  - `message` string, required

## Other responses

- `400`: Bad request - invalid settings
- `401`: Unauthorized
- `500`: Internal server error

## Changes

- **2026-11-16** `3d1a00c14282`: 1 info
  - added the new optional request property `trusted_proxy_cidrs`
- **2026-11-15** `c5965797b8b1`: 2 info
  - added the new optional request property `ai_config/config_repo_allowlist`
  - the `ai_config` request property default value changed from `{"config_repo":"","config_repo_branch":"main"}` to `{"config_repo":"","config_repo_allowlist":[],"config_repo_branch":"main"}`
- **2026-11-15** `4e654843cab2`: 1 warning, 1 info
  - removed the request property `ai_config/config_repo_allowlist`
  - the `ai_config` request property default value changed from `{"config_repo":"","config_repo_allowlist":[],"config_repo_branch":"main"}` to `{"config_repo":"","config_repo_branch":"main"}`
- **2026-11-15** `a4c9f6e36889`: 2 info
  - added the new optional request property `ai_config/config_repo_allowlist`
  - the `ai_config` request property default value changed from `{"config_repo":"","config_repo_branch":"main"}` to `{"config_repo":"","config_repo_allowlist":[],"config_repo_branch":"main"}`
- **2026-11-14** `3d5be996525d`: 1 info
  - added the new optional request property `managed_service_healthchecks`

[Operation history](https://skmtc.dev/gotempsh/apis/temps/changes/settings/put.md)

---

[API](https://skmtc.dev/gotempsh/apis/temps.md) - [All operations](https://skmtc.dev/gotempsh/apis/temps/llms.txt) - [OpenAPI document](https://skmtc.dev/gotempsh/apis/temps/revisions/3b040526eb43?raw)
