# PUT /settings/{key}

First published 3 Oct 2026 (release 0.1.0) · Unchanged since publication

UrbeStack release 0.2.35 API operation in the settings group.

Set a setting by key

- Who may call it: administrator
- Token scope, any of: settings, all
- Answers: 200 OK

Requires an administrator token with the settings scope. Returns the resulting setting as key and value. Run a rebuild after changing a setting whose catalog entry has acts set to rebuild. The catalog is available through GET /settings.

Returns 400 if the request body omits value. UrbeStack rejects unknown keys and suggests a known key when it finds a close match. It also rejects changes to secrets it generates for its own use.

On a DNS distribution network with multiple nodes, change dns.nameservers through the network. panel.timezone must be one of the timezones returned by GET /settings. You can turn off telemetry.share only if your license allows it. When you enable security.require_second_factor_admins, administrators can continue using their existing sessions and must use a second factor at their next sign-in.

php.default_version applies to domains without their own PHP version and must name an installed, visible version. Setting php.versions.legacy_enabled updates php.versions.hidden to hide legacy versions omitted from the supplied list. Set jobs.keep_days to 0 to retain jobs indefinitely. A finite jobs.keep_days must be at least jobs.show_days. For this comparison, UrbeStack uses 365 days for an absent jobs.keep_days and 30 days for an absent jobs.show_days.

Changes to firewall.enabled apply or remove UrbeStack's firewall rules immediately. A change to ssh.port takes effect immediately and supports rollback. UrbeStack checks for conflicts between ssh.port and panel.port. While a firewall rollback is armed, UrbeStack rejects changes to an existing ssh.port or panel.port.

## As a command

- [urbestack-setting-set](https://urbestack.com/docs/commands/urbestack-setting-set.md): Sets an UrbeStack setting.

## Parameters

- `key` (path, string, matching ^[a-z][a-z0-9_]{0,31}(\.[a-z][a-z0-9_]{0,31}){0,3}$, required)

## Request body

JSON.

- `value` (value or null, required): Any JSON value, subject to the setting's constraints.

## Example

Set $API to the base URL and $TOKEN to the token, as the [API overview](https://urbestack.com/docs/api.md) shows.

```
curl -sS -X PUT "$API/settings/panel.port" \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "value": 8443
  }'
```

Response, 200 OK:

```
{
  "key": "panel.port",
  "value": 8443
}
```

## Errors

- 400: '<zone>' is not a zone this machine knows: timedatectl list-timezones names them
- 400: --value or --value-stdin is required
- 400: <key> is made by the panel for its own use and is not set from outside
- 400: A new job is queued or running
- 400: Domain name required
- 400: Domain name too long
- 400: Give --value or --value-stdin, not both
- 400: Invalid <what>: 
- 400: Invalid IPv4 address
- 400: Invalid IPv6 address
- 400: Invalid domain name
- 400: Invalid port
- 400: Invalid setting key
- 400: Job parameters must be an object
- 400: PHP <version> cannot be the default: it is hidden from new choices on this server
- 400: PHP <version> cannot be the default: it is not installed on this server
- 400: Unknown job type
- 400: Unknown setting '<key>'
- 400: body is missing required field value
- 400: jobs.keep_days (<keep>) may not be smaller than jobs.show_days (<show>): a job cannot be shown longer than it is kept; 0 keeps them for good
- 401: Authentication required
- 404: Setting '<key>' not found
- 409: <key> cannot take that value: <SECOND>{<k>}{on} <sp> (<k>). <SECOND>{<k>}{move}, or choose another
- 409: <key> cannot take that value: the panel listens on port <port> (panel.port). Move the panel first, or choose another
- 409: <s.subject> cannot take port <port>: 
- 409: <s.subject> cannot take port <port>: <why>
- 409: <s.subject> cannot take port <port>: it is the panel's port (panel.port)
- 409: A change is already armed for revert (
- 409: Sharing is required with this license.
- 409: The panel cannot take port <port>: 
- 409: The panel cannot take port <port>: <why>
- 409: These are the nameservers of a distribution network with several nodes, and every node lists the same ones. To remove a nameserver or move it to another node, use the actions beside its name on DNS zones › Nameservers & addresses, or urbestack-dns-nameserver
