Get your free beta license ↗
API operation · domains group
PATCH

/domains/{name}

First published 3 Oct 20260.1.0Unchanged since publication

Update a domain's settings

Who may call it
AdministratorResellerCustomer
Token scope, any of
domainsall
Answers200 OK

Supply at least one change. UrbeStack synchronizes the DNS zones it manages and returns the updated domain in the same format as GET /domains/{name}. An unknown domain returns 404. Access to an existing domain is limited to administrators, the domain owner and the owner's reseller. Other callers receive 403.

Use www_alias to control whether the site also answers to www.<domain>, and wildcard to control whether it also answers to *.<domain>. Set www_redirect to www or bare to redirect to that form of the domain name, or to none to disable the redirect. The directory_listing option controls whether visitors see a file list when there is no index page. Enable error_pages to serve errors/{403,404,500}.html from the document root. Use stats_enabled to control inclusion in nightly statistics.

Set ssl_mode to auto for automatic certificate issuance or none to disable it. Set challenge to http for HTTP-01 validation or dns for DNS-01 validation. With auto, UrbeStack uses HTTP-01 unless wildcard is enabled, in which case it uses DNS-01. Once a certificate is installed, force_https redirects visitors to HTTPS and hsts instructs browsers to keep using HTTPS. Set either field to false to disable that option.

Set php_version to an installed version available for new selections, such as 8.4, or to null to follow the server default. Administrators can hide versions from new selections. Version selection is unavailable while a PHP installation is running.

Administrators can set php_settings. Resellers can set them for their customers, except for settings reserved for administrators. Passing null or an empty string for a setting removes the override and restores the server default. Only administrators can set pm.max_children, pm.process_idle_timeout (in seconds), pm.max_requests and open_basedir_tmp. Set open_basedir_tmp to on to include the shared /tmp directory in the pool's open_basedir or to off to exclude it. It defaults to off for new domains.

The php.ini settings are memory_limit, upload_max_filesize, post_max_size, max_execution_time, max_input_vars, disable_functions, display_errors and date.timezone. For disable_functions, use a comma-separated list of function names or none.

The API returns 400 if the request supplies no changes, an unknown PHP setting name or an invalid value for www_redirect, ssl_mode or challenge. It returns 403 if the caller lacks permission to change a requested PHP setting.

As a command

Run as root on the server

Parameters

namepath ·DomainNameRequired

Request body

JSON ·DomainPatch· 12 fields
challengestring, one of auto, http, dns
directory_listingboolean
error_pagesboolean
force_httpsboolean
hstsboolean
php_settingsobject of string, up to 64 characters
php_versionstring, matching ^[5-9]\.[0-9]$ or null
ssl_modestring, one of none, auto
Certificate mode, either none or auto. Set the mode to custom by installing a custom certificate.
stats_enabledboolean
wildcardboolean
www_aliasboolean
www_redirectstring, one of none, www, bare

Example

See the API overview for how to set $API and $TOKEN.
Request
curl -sS -X PATCH "$API/domains/example.com" \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "challenge": "auto",
    "directory_listing": true,
    "error_pages": true,
    "force_https": true,
    "hsts": true,
    "php_settings": {},
    "php_version": "8.4",
    "ssl_mode": "none",
    "stats_enabled": true,
    "wildcard": true,
    "www_alias": true,
    "www_redirect": "none"
  }'
Response · 200 OK
{
  "domain": {
    "bandwidth_cut": true,
    "created_at": "2026-09-09T10:15:00Z",
    "directory_listing": true,
    "docroot": "/home/alice/files/web/example.com/public_html",
    "error_pages": true,
    "id": 1,
    "move_state": "text",
    "name": "example.com",
    "package": "basic",
    "parent": "example.com",
    "php_effective": {},
    "php_settings": {},
    "php_version": "8.4",
    "ssl": {},
    "stats_enabled": true,
    "status": "active",
    "template": "default",
    "user": "alice",
    "user_id": 2,
    "wildcard": true,
    "www_alias": true,
    "www_redirect": "none"
  }
}

Errors

20 errors, each a status and a sentence
400--php-setting expects KEY=VALUE, got '<kv>'
400Domain name required
400Domain name too long
400Invalid PHP version, expected e.g. 8.2
400Invalid domain name
400Nothing to change
400Unknown PHP setting '<k>'
400Unknown PHP setting '<key>'; known:
400Unknown PHP setting '<raw>'
400Unknown PHP version '<version>'
400Unknown ssl key '<k>'
400challenge must be auto, http or dns
400ssl must be an object
400ssl_mode must be none or auto; a custom certificate is put on with its own route
400www_redirect must be none, www or bare
401Authentication required
403<k> is set by an administrator, on the PHP page
403Insufficient privileges
403PHP settings are set by an administrator, or by the reseller of the customer
404Domain '<name>' not found
Generated from release 0.2.35 (current) · the API’s own descriptionThis entry has been unchanged since it was first published in release 0.1.0 on 3 Oct 2026.
urbestack.com/docs/api/patch-domains-name/