Update nameservers
curl --request PUT \
--url https://console.perfgrid.com/api/v1/domains/{domain}/nameservers \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"nameservers": [
"<string>"
]
}
'import requests
url = "https://console.perfgrid.com/api/v1/domains/{domain}/nameservers"
payload = { "nameservers": ["<string>"] }
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({nameservers: ['<string>']})
};
fetch('https://console.perfgrid.com/api/v1/domains/{domain}/nameservers', 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://console.perfgrid.com/api/v1/domains/{domain}/nameservers",
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([
'nameservers' => [
'<string>'
]
]),
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://console.perfgrid.com/api/v1/domains/{domain}/nameservers"
payload := strings.NewReader("{\n \"nameservers\": [\n \"<string>\"\n ]\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://console.perfgrid.com/api/v1/domains/{domain}/nameservers")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"nameservers\": [\n \"<string>\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://console.perfgrid.com/api/v1/domains/{domain}/nameservers")
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 \"nameservers\": [\n \"<string>\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"data": {
"id": "<string>",
"name": "<string>",
"ascii_name": "<string>",
"status": "pending_registration",
"registered_on": "<string>",
"expires_on": "<string>",
"next_due_date": "<string>",
"auto_renew": true,
"whois_privacy": true,
"is_locked": true,
"manageable": true,
"nameservers": [
"<string>"
],
"dnssec": [
"<unknown>"
],
"registrant": {}
}
}{
"message": "<string>",
"errors": {}
}Domains
Update nameservers
Two to thirteen nameservers, sent on to the registrar. Needs
domains.manage. The answer has the domain’s nameservers, DNSSEC
records and registrant only for a token that also has domains.view.
PUT
/
domains
/
{domain}
/
nameservers
Update nameservers
curl --request PUT \
--url https://console.perfgrid.com/api/v1/domains/{domain}/nameservers \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"nameservers": [
"<string>"
]
}
'import requests
url = "https://console.perfgrid.com/api/v1/domains/{domain}/nameservers"
payload = { "nameservers": ["<string>"] }
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({nameservers: ['<string>']})
};
fetch('https://console.perfgrid.com/api/v1/domains/{domain}/nameservers', 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://console.perfgrid.com/api/v1/domains/{domain}/nameservers",
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([
'nameservers' => [
'<string>'
]
]),
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://console.perfgrid.com/api/v1/domains/{domain}/nameservers"
payload := strings.NewReader("{\n \"nameservers\": [\n \"<string>\"\n ]\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://console.perfgrid.com/api/v1/domains/{domain}/nameservers")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"nameservers\": [\n \"<string>\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://console.perfgrid.com/api/v1/domains/{domain}/nameservers")
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 \"nameservers\": [\n \"<string>\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"data": {
"id": "<string>",
"name": "<string>",
"ascii_name": "<string>",
"status": "pending_registration",
"registered_on": "<string>",
"expires_on": "<string>",
"next_due_date": "<string>",
"auto_renew": true,
"whois_privacy": true,
"is_locked": true,
"manageable": true,
"nameservers": [
"<string>"
],
"dnssec": [
"<unknown>"
],
"registrant": {}
}
}{
"message": "<string>",
"errors": {}
}Authorizations
An API token from API tokens in the console, sent as Authorization: Bearer pgapi_.... It works for one billing account, and its permissions decide which endpoints it may call.
Path Parameters
Body
application/json
Required array length:
1 - 13 elementsMaximum string length:
255Response
DomainResource
Show child attributes
Show child attributes