DNS
Delete an RRset
Section titled “Delete an RRset”DELETE /v1/dns/zones/{zone}/records/{name}/{type} · scope dns:write · destructive — cannot be undone · idempotent
Deletes every value for that name and type.
curl https://api.truo.cloud/v1/dns/zones/example.com/records/www/A \ -X DELETE \ -H "Authorization: Bearer $TRUO_TOKEN"truo dns record delete example.com www Aawait truo.dns.records.delete("example.com", "www", "A");truo_dns({ "action": "record_delete", "zone": "example.com", "name": "www", "type": "A"})operationId: dns.records.delete
Get an RRset
Section titled “Get an RRset”GET /v1/dns/zones/{zone}/records/{name}/{type} · scope dns:read
curl https://api.truo.cloud/v1/dns/zones/example.com/records/www/A \ -H "Authorization: Bearer $TRUO_TOKEN"truo dns record get example.com www Aawait truo.dns.records.get("example.com", "www", "A");truo_dns({ "action": "record_get", "zone": "example.com", "name": "www", "type": "A"})operationId: dns.records.get
List a zone’s records
Section titled “List a zone’s records”GET /v1/dns/zones/{zone}/records · scope dns:read
Grouped into RRsets: an A record with two IPs is one record with two values. The response carries an ETag; pass it as If-Match when writing and no concurrent change gets lost.
curl https://api.truo.cloud/v1/dns/zones/example.com/records \ -H "Authorization: Bearer $TRUO_TOKEN"truo dns record list example.comawait truo.dns.records.list("example.com");truo_dns({ "action": "record_list", "zone": "example.com"})operationId: dns.records.list
Apply several changes at once
Section titled “Apply several changes at once”PATCH /v1/dns/zones/{zone}/records · scope dns:write · destructive — cannot be undone · idempotent
Each element replaces its RRset; values: [] deletes it. It is how you apply a coherent change —moving a site and its mail together— without it landing halfway between two calls. It is not atomic in the backend: if one change fails, the earlier ones were already applied and the response says which one stopped.
curl https://api.truo.cloud/v1/dns/zones/example.com/records \ -X PATCH \ -H "Authorization: Bearer $TRUO_TOKEN" \ -H "Content-Type: application/json" \ -d '{"records":[]}'truo dns record apply example.comawait truo.dns.records.patch("example.com", {"records":[]});truo_dns({ "action": "record_apply", "zone": "example.com"})operationId: dns.records.patch
Create or replace an RRset
Section titled “Create or replace an RRset”PUT /v1/dns/zones/{zone}/records/{name}/{type} · scope dns:write · reversible · idempotent
Replaces the entire RRset: values missing from values are deleted. That is DNS semantics and the backend’s — there is no “add an IP” without rewriting the set. Read the RRset, add the value to the list, and send the full list with the ETag in If-Match.
curl https://api.truo.cloud/v1/dns/zones/example.com/records/www/A \ -X PUT \ -H "Authorization: Bearer $TRUO_TOKEN" \ -H "Content-Type: application/json" \ -d '{"values":[]}'truo dns record set example.com www Aawait truo.dns.records.put("example.com", "www", "A", {"values":[]});truo_dns({ "action": "record_set", "zone": "example.com", "name": "www", "type": "A"})operationId: dns.records.put
Export the zone in BIND format
Section titled “Export the zone in BIND format”GET /v1/dns/zones/{zone}/export · scope dns:read
The zone file exactly as the backend emits it. Useful for backup or migration.
curl https://api.truo.cloud/v1/dns/zones/example.com/export \ -H "Authorization: Bearer $TRUO_TOKEN"truo dns zone export example.comawait truo.dns.zones.export("example.com");truo_dns({ "action": "zone_export", "zone": "example.com"})operationId: dns.zones.export
Get a zone
Section titled “Get a zone”GET /v1/dns/zones/{zone} · scope dns:read
curl https://api.truo.cloud/v1/dns/zones/example.com \ -H "Authorization: Bearer $TRUO_TOKEN"truo dns zone get example.comawait truo.dns.zones.get("example.com");truo_dns({ "action": "zone_get", "zone": "example.com"})operationId: dns.zones.get
List DNS zones
Section titled “List DNS zones”GET /v1/dns/zones · scope dns:read
Served from the database, without querying the DNS backend: record_count and serial come back null. Fetching them would cost one call per zone, and some accounts have dozens.
curl https://api.truo.cloud/v1/dns/zones \ -H "Authorization: Bearer $TRUO_TOKEN"truo dns zone listawait truo.dns.zones.list();truo_dns({ "action": "zone_list"})operationId: dns.zones.list