Automates zones creation, modification and deletion.
Base URL https://api.gslb.me/2.0. All requests require HTTP Basic authentication; set Accept to application/json or application/xml. Try these calls in the Postman collection.
Create zone
POSThttps://api.gslb.me/2.0/zone
Creates a new zone. No commit is needed.
Request body
Send a JSON object (Content-Type: application/json) with these fields; the full request is shown below.
| Field | Example | Notes |
|---|---|---|
name | mydomain.com | |
contactemail | contact@email.tld | E-mail address of the zone contact |
active | false | “true” or “false” |
ttl | 7200 | Time to live, in seconds |
Example request
curl -u "username@mydomain.com:your-password" \
-X POST "https://api.gslb.me/2.0/zone" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-d '{
"name": "mydomain.com",
"contactemail": "contact@email.tld",
"active": "false",
"ttl": "7200"
}'import requests
r = requests.post(
"https://api.gslb.me/2.0/zone",
auth=("username@mydomain.com", "your-password"),
headers={"Accept": "application/json", "Content-Type": "application/json"},
json={
"name": "mydomain.com",
"contactemail": "contact@email.tld",
"active": "false",
"ttl": "7200"
},
)
print(r.status_code, r.json())const res = await fetch("https://api.gslb.me/2.0/zone", {
method: "POST",
headers: {
"Authorization": "Basic " + btoa("username@mydomain.com:your-password"),
"Accept": "application/json",
"Content-Type": "application/json"
},
body: JSON.stringify({
"name": "mydomain.com",
"contactemail": "contact@email.tld",
"active": "false",
"ttl": "7200"
})
});
console.log(res.status, await res.json());Example responses
200 OK Create zone
{
"message": "Done",
"returncode": "0"
}
400 Bad Request Create zone – invalid parameter
{
"message": "'ttl' invalid, must be between 5 and 86400",
"returncode": "3"
}
403 Forbidden Create zone – zone already exists
{
"message": "Zone already exists",
"returncode": "6"
}
Modify zone
PUThttps://api.gslb.me/2.0/zone/{zone_name}
Modifies an existing zone. No commit is needed.
Path parameters
| Parameter | Example | Description |
|---|---|---|
{zone_name} | mydomain.com | Name of the zone (domain) |
Request body
Send a JSON object (Content-Type: application/json) with these fields; the full request is shown below.
| Field | Example | Notes |
|---|---|---|
contactemail | contact@email.tld | E-mail address of the zone contact |
active | true | “true” or “false” |
ttl | 1800 | Time to live, in seconds |
Example request
curl -u "username@mydomain.com:your-password" \
-X PUT "https://api.gslb.me/2.0/zone/mydomain.com" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-d '{
"contactemail": "contact@email.tld",
"active": "true",
"ttl": "1800"
}'import requests
r = requests.put(
"https://api.gslb.me/2.0/zone/mydomain.com",
auth=("username@mydomain.com", "your-password"),
headers={"Accept": "application/json", "Content-Type": "application/json"},
json={
"contactemail": "contact@email.tld",
"active": "true",
"ttl": "1800"
},
)
print(r.status_code, r.json())const res = await fetch("https://api.gslb.me/2.0/zone/mydomain.com", {
method: "PUT",
headers: {
"Authorization": "Basic " + btoa("username@mydomain.com:your-password"),
"Accept": "application/json",
"Content-Type": "application/json"
},
body: JSON.stringify({
"contactemail": "contact@email.tld",
"active": "true",
"ttl": "1800"
})
});
console.log(res.status, await res.json());Example response
200 OK Modify zone
{
"message": "Done",
"returncode": "0"
}
Get zone
GEThttps://api.gslb.me/2.0/zone/{zone_name}
Retrieves an existing zone configuration
Path parameters
| Parameter | Example | Description |
|---|---|---|
{zone_name} | mydomain.com | Name of the zone (domain) |
Example request
curl -u "username@mydomain.com:your-password" \
-X GET "https://api.gslb.me/2.0/zone/mydomain.com" \
-H "Accept: application/json"import requests
r = requests.get(
"https://api.gslb.me/2.0/zone/mydomain.com",
auth=("username@mydomain.com", "your-password"),
headers={"Accept": "application/json"},
)
print(r.status_code, r.json())const res = await fetch("https://api.gslb.me/2.0/zone/mydomain.com", {
method: "GET",
headers: {
"Authorization": "Basic " + btoa("username@mydomain.com:your-password"),
"Accept": "application/json"
}
});
console.log(res.status, await res.json());Example response
200 OK Get zone
{
"geohosts": null,
"rrsets": {
"rrset": [
{
"id": "7550",
"name": "@",
"readonly": "true",
"ttl": "86400",
"type": "NS",
"value": "ns1.gslb.me."
},
{
"id": "7551",
"name": "@",
"readonly": "true",
"ttl": "86400",
"type": "NS",
"value": "ns2.gslb.me."
}
]
},
"urlforwards": null,
"zone": {
"active": "true",
"dnssec": "false",
"expire": "1209600",
"name": "mydomain.com",
"needscommit": "false",
"postmaster": "contact@email.tld",
"refresh": "3600",
"retry": "600",
"serialnumber": "1524693322",
"sourceHost": "ns1.gslb.me",
"ttl": "1800"
}
}
Commit zone
POSThttps://api.gslb.me/2.0/commit/zone/{zone_name}
Commits a zone.
Path parameters
| Parameter | Example | Description |
|---|---|---|
{zone_name} | mydomain.com | Name of the zone (domain) |
Example request
curl -u "username@mydomain.com:your-password" \
-X POST "https://api.gslb.me/2.0/commit/zone/mydomain.com" \
-H "Accept: application/json"import requests
r = requests.post(
"https://api.gslb.me/2.0/commit/zone/mydomain.com",
auth=("username@mydomain.com", "your-password"),
headers={"Accept": "application/json"},
)
print(r.status_code, r.json())const res = await fetch("https://api.gslb.me/2.0/commit/zone/mydomain.com", {
method: "POST",
headers: {
"Authorization": "Basic " + btoa("username@mydomain.com:your-password"),
"Accept": "application/json"
}
});
console.log(res.status, await res.json());Example response
200 OK Commit zone
{
"message": "Done",
"returncode": "0"
}
Delete zone
DELETEhttps://api.gslb.me/2.0/zone/{zone_name}
Deletes a zone.
Path parameters
| Parameter | Example | Description |
|---|---|---|
{zone_name} | mydomain.com | Name of the zone (domain) |
Example request
curl -u "username@mydomain.com:your-password" \
-X DELETE "https://api.gslb.me/2.0/zone/mydomain.com" \
-H "Accept: application/json"import requests
r = requests.delete(
"https://api.gslb.me/2.0/zone/mydomain.com",
auth=("username@mydomain.com", "your-password"),
headers={"Accept": "application/json"},
)
print(r.status_code, r.json())const res = await fetch("https://api.gslb.me/2.0/zone/mydomain.com", {
method: "DELETE",
headers: {
"Authorization": "Basic " + btoa("username@mydomain.com:your-password"),
"Accept": "application/json"
}
});
console.log(res.status, await res.json());Example responses
200 OK Delete zone
{
"message": "Done",
"returncode": "0"
}
404 Not Found Delete zone – zone not found
{
"message": "Zone not found",
"returncode": "2"
}