Create a record set
curl --request POST \
--url https://cloud.aptranetservices.com/cloud-dns/rrsets \
--header 'Aptranet-Secret: <api-key>' \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "www",
"type": "A",
"ttl": 300,
"resource_records": [
{
"enabled": true,
"content": [
"192.0.2.10"
]
}
]
}
'import requests
url = "https://cloud.aptranetservices.com/cloud-dns/rrsets"
payload = {
"name": "www",
"type": "A",
"ttl": 300,
"resource_records": [
{
"enabled": True,
"content": ["192.0.2.10"]
}
]
}
headers = {
"Authorization": "Bearer <token>",
"Aptranet-Secret": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
Authorization: 'Bearer <token>',
'Aptranet-Secret': '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
name: 'www',
type: 'A',
ttl: 300,
resource_records: [{enabled: true, content: ['192.0.2.10']}]
})
};
fetch('https://cloud.aptranetservices.com/cloud-dns/rrsets', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://cloud.aptranetservices.com/cloud-dns/rrsets"
payload := strings.NewReader("{\n \"name\": \"www\",\n \"type\": \"A\",\n \"ttl\": 300,\n \"resource_records\": [\n {\n \"enabled\": true,\n \"content\": [\n \"192.0.2.10\"\n ]\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Aptranet-Secret", "<api-key>")
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))
}{
"id": 2,
"warning": "<string>"
}{
"id": 2,
"warning": "<string>"
}{
"error_code": "<string>",
"error": "<string>",
"error_description": "<string>",
"trace_id": "<string>"
}{
"error_code": "<string>",
"error": "<string>",
"error_description": "<string>",
"trace_id": "<string>"
}{
"error_code": "<string>",
"error": "<string>",
"error_description": "<string>",
"trace_id": "<string>"
}{
"error_code": "<string>",
"error": "<string>",
"error_description": "<string>",
"trace_id": "<string>"
}{
"error_code": "<string>",
"error": "<string>",
"error_description": "<string>",
"trace_id": "<string>"
}Create a record set
Creates a relative owner name and type in the zone. Apex NS records are platform managed. Apex CNAME records and a CNAME coexisting with another type at the same name are rejected.
POST
/
cloud-dns
/
rrsets
Create a record set
curl --request POST \
--url https://cloud.aptranetservices.com/cloud-dns/rrsets \
--header 'Aptranet-Secret: <api-key>' \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "www",
"type": "A",
"ttl": 300,
"resource_records": [
{
"enabled": true,
"content": [
"192.0.2.10"
]
}
]
}
'import requests
url = "https://cloud.aptranetservices.com/cloud-dns/rrsets"
payload = {
"name": "www",
"type": "A",
"ttl": 300,
"resource_records": [
{
"enabled": True,
"content": ["192.0.2.10"]
}
]
}
headers = {
"Authorization": "Bearer <token>",
"Aptranet-Secret": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
Authorization: 'Bearer <token>',
'Aptranet-Secret': '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
name: 'www',
type: 'A',
ttl: 300,
resource_records: [{enabled: true, content: ['192.0.2.10']}]
})
};
fetch('https://cloud.aptranetservices.com/cloud-dns/rrsets', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://cloud.aptranetservices.com/cloud-dns/rrsets"
payload := strings.NewReader("{\n \"name\": \"www\",\n \"type\": \"A\",\n \"ttl\": 300,\n \"resource_records\": [\n {\n \"enabled\": true,\n \"content\": [\n \"192.0.2.10\"\n ]\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Aptranet-Secret", "<api-key>")
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))
}{
"id": 2,
"warning": "<string>"
}{
"id": 2,
"warning": "<string>"
}{
"error_code": "<string>",
"error": "<string>",
"error_description": "<string>",
"trace_id": "<string>"
}{
"error_code": "<string>",
"error": "<string>",
"error_description": "<string>",
"trace_id": "<string>"
}{
"error_code": "<string>",
"error": "<string>",
"error_description": "<string>",
"trace_id": "<string>"
}{
"error_code": "<string>",
"error": "<string>",
"error_description": "<string>",
"trace_id": "<string>"
}{
"error_code": "<string>",
"error": "<string>",
"error_description": "<string>",
"trace_id": "<string>"
}Authorizations
Body
application/json
The name is relative to the zone; use @ for the apex. Apex NS is platform managed and apex CNAME is not supported. Content arrays use the ordered fields required by the record type.