Get your free beta license ↗
API operation · dns group
POST

/dns/zones/{name}/ttl

First published 14 Oct 20260.2.0Unchanged since publication

Set TTLs for multiple records in a DNS zone

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

Set ttl to a number of seconds, or pass null to clear the per-record TTLs and use the zone's $TTL (dns.ttl). The operation changes only the TTL of individually editable records. The server's own records and any record IDs listed in skip are excluded. A missing ttl or a skip value other than an array or null returns 400.

If any TTL changes, UrbeStack assigns a new zone serial and reloads the DNS server. The 200 response includes the publication outcome.

As a command

Run as root on the server

Parameters

namepath ·DomainNameRequired

Request body

JSON ·DnsTtlSet· 2 fields
ttlinteger, 0 or more or nullRequired
TTL in seconds to set on every selected record, or null to use the zone's $TTL.
skiparray of integer
IDs of records to leave unchanged, corresponding to the records deselected in the web interface.

Example

See the API overview for how to set $API and $TOKEN.
Request
curl -sS -X POST "$API/dns/zones/example.com/ttl" \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "skip": [
      1
    ],
    "ttl": 1
  }'
Response · 200 OK
{
  "changes": [
    {
      "from": 1,
      "id": 1,
      "name": "alice",
      "to": 1,
      "type": "rebuild"
    }
  ],
  "published": true,
  "records": 1,
  "reload": "text",
  "skipped": 1,
  "ttl": 1,
  "unchanged": 1,
  "zone": "text"
}

Errors

12 errors, each a status and a sentence
400--ttl SECONDS or --default is required
400--ttl and --default do not go together
400--zone is required
400<what> must be a number of seconds from 1 to 604800
400Domain name required
400Domain name too long
400Invalid domain name
400Invalid id
400body is missing required field ttl (seconds, or null for the zone's <TTL>)
400skip is a list of record ids
401Authentication required
404Zone '<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.2.0 on 14 Oct 2026.
urbestack.com/docs/api/post-dns-zones-name-ttl/