Modify a CNAME record
curl --request PUT \
--url https://dev.namify.host/api/v1/dns/cname-record \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"order_id": 124680932,
"current_value": "old-target.example.com",
"new_value": "new-target.example.com",
"host": "www"
}
'import requests
url = "https://dev.namify.host/api/v1/dns/cname-record"
payload = {
"order_id": 124680932,
"current_value": "old-target.example.com",
"new_value": "new-target.example.com",
"host": "www"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
order_id: 124680932,
current_value: 'old-target.example.com',
new_value: 'new-target.example.com',
host: 'www'
})
};
fetch('https://dev.namify.host/api/v1/dns/cname-record', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://dev.namify.host/api/v1/dns/cname-record",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'order_id' => 124680932,
'current_value' => 'old-target.example.com',
'new_value' => 'new-target.example.com',
'host' => 'www'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://dev.namify.host/api/v1/dns/cname-record"
payload := strings.NewReader("{\n \"order_id\": 124680932,\n \"current_value\": \"old-target.example.com\",\n \"new_value\": \"new-target.example.com\",\n \"host\": \"www\"\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.put("https://dev.namify.host/api/v1/dns/cname-record")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"order_id\": 124680932,\n \"current_value\": \"old-target.example.com\",\n \"new_value\": \"new-target.example.com\",\n \"host\": \"www\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://dev.namify.host/api/v1/dns/cname-record")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"order_id\": 124680932,\n \"current_value\": \"old-target.example.com\",\n \"new_value\": \"new-target.example.com\",\n \"host\": \"www\"\n}"
response = http.request(request)
puts response.read_body{
"status": "SUCCESS",
"message": "Record modified successfully"
}
DNS
Modify CNAME
Modifies an existing CNAME record on the domain’s DNS zone.
PUT
/
api
/
v1
/
dns
/
cname-record
Modify a CNAME record
curl --request PUT \
--url https://dev.namify.host/api/v1/dns/cname-record \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"order_id": 124680932,
"current_value": "old-target.example.com",
"new_value": "new-target.example.com",
"host": "www"
}
'import requests
url = "https://dev.namify.host/api/v1/dns/cname-record"
payload = {
"order_id": 124680932,
"current_value": "old-target.example.com",
"new_value": "new-target.example.com",
"host": "www"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
order_id: 124680932,
current_value: 'old-target.example.com',
new_value: 'new-target.example.com',
host: 'www'
})
};
fetch('https://dev.namify.host/api/v1/dns/cname-record', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://dev.namify.host/api/v1/dns/cname-record",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'order_id' => 124680932,
'current_value' => 'old-target.example.com',
'new_value' => 'new-target.example.com',
'host' => 'www'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://dev.namify.host/api/v1/dns/cname-record"
payload := strings.NewReader("{\n \"order_id\": 124680932,\n \"current_value\": \"old-target.example.com\",\n \"new_value\": \"new-target.example.com\",\n \"host\": \"www\"\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.put("https://dev.namify.host/api/v1/dns/cname-record")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"order_id\": 124680932,\n \"current_value\": \"old-target.example.com\",\n \"new_value\": \"new-target.example.com\",\n \"host\": \"www\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://dev.namify.host/api/v1/dns/cname-record")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"order_id\": 124680932,\n \"current_value\": \"old-target.example.com\",\n \"new_value\": \"new-target.example.com\",\n \"host\": \"www\"\n}"
response = http.request(request)
puts response.read_body{
"status": "SUCCESS",
"message": "Record modified successfully"
}
Authorizations
A personal access token. Obtain one from the dashboard under Settings > API Key. Include it in the Authorization header as Bearer <token>. Unauthenticated requests to protected routes return 401 Unauthorized.
Body
application/json
Order ID of the domain.
Example:
124680932
The existing target hostname of the record to modify.
Example:
"old-target.example.com"
The replacement target hostname (fully qualified domain name).
Example:
"new-target.example.com"
Subdomain label being aliased, relative to the zone (e.g. www, shop).
Example:
"www"
TTL in seconds. Minimum 300. Omit to use the zone default.
Example:
300
⌘I