VPS.org API

Litokomane tsa REST API

API ea Taolo ea DNS

Laola libaka tsa DNS le lirekoto ka lenaneo bakeng sa libaka tsa hau.

Mafelo a ho Qetela Lintlha tse 4 tsa pheletso
Tsela ea Motheo /api/v1/dns-zones
Netefatso Token ea mokhanni e hlokahala

Kakaretso

DNS API fana ka taolo e felletseng ea libaka le li-records tsa DNS. Li-zone tsohle li bolokiloe ho li-server tsa lebitso la VPS.org tse nang le ho thehoa ha faele ea BIND9 ea sebaka le ho kenya.

Nameserver Infrastructure

Likarolo tsa bohlokoa

Netefatso

Lipotso tsohle tsa DNS API li hloka ho phethela ho phethela. E-ba le li-token tsa API ho tloha dashboard ea ak'haonte ea hau ho /account/developers/ le litokelo tse latelang:

Mohlala

Authorization: Bearer vps_abc123def456...
Boholo: Token ea API e bonts'oa ka nako e le 'ngoe feela ha e thehiloe. E boloke ka mokhoa o sireletsehileng. Haeba u lahleheloa ke token, u tlameha ho etsa e ncha.
FUMANA /api/v1/dns-zones/

Thathamisa Libaka Tsohle tsa DNS

Fumana lethathamo la li-pagina tsa libaka tsohle tsa DNS tse nang le mosebelisi ea netefalitsoeng. E fana ka ts'ebetso ea ho sutumelletsa ka lebitso la domain.

Liparamitha tsa Potso

Parameter Mofuta E hlokahala Bophara
domain string Ha ho joalo Filter zones by exact domain name (e.g., example.com)

Kopo ea Mohlala

cURL
Python
JavaScript
curl -X GET "https://admin.vps.org/api/v1/dns-zones/" \
  -H "Authorization: Bearer YOUR_API_TOKEN"
import requests

url = "https://admin.vps.org/api/v1/dns-zones/"
headers = {"Authorization": "Bearer YOUR_API_TOKEN"}

response = requests.get(url, headers=headers)
print(response.json())
const response = await fetch('https://admin.vps.org/api/v1/dns-zones/', {
  headers: {'Authorization': 'Bearer YOUR_API_TOKEN'}
});

const zones = await response.json();
console.log(zones);

Karabo ea Mohlala

[
  {
    "uuid": "abc123-def456-ghi789",
    "domain": "example.com",
    "created_at": "2024-01-15T10:30:00Z",
    "record_count": 12
  },
  {
    "uuid": "xyz789-uvw456-rst123",
    "domain": "myapp.io",
    "created_at": "2024-06-20T14:15:00Z",
    "record_count": 8
  }
]

Masimo a Karabo

Setereke Mofuta Bophara
uuid string Unique zone identifier (used in API requests)
domain string Domain name for this DNS zone
created_at datetime Zone creation timestamp (ISO 8601 format)
record_count integer Total number of DNS records in this zone

Likhoutu tsa Boemo ba Karabelo

200 Successfully retrieved DNS zones list
401 Unauthorized - Invalid or missing API token
403 Forbidden - Token lacks dns:list permission
FUMANA /api/v1/dns-zones/{uuid}/

Fumana lintlha tsa sebaka sa DNS

Fumana tlhaiso-leseling e batsi ka sebaka sa DNS se itseng, ho kenyeletsoa le li-records tsohle.

Liparamitha tsa Tsela

Parameter Mofuta E hlokahala Bophara
uuid string E Unique zone identifier

Karabo ea Mohlala

{
  "uuid": "abc123-def456-ghi789",
  "domain": "example.com",
  "created_at": "2024-01-15T10:30:00Z",
  "record_count": 5,
  "records": [
    {
      "uuid": "rec-001",
      "record_type": "A",
      "name": "@",
      "value": "192.0.2.1",
      "ttl": 3600,
      "priority": null,
      "created_at": "2024-01-15T10:30:00Z"
    },
    {
      "uuid": "rec-002",
      "record_type": "MX",
      "name": "@",
      "value": "mail.example.com",
      "ttl": 3600,
      "priority": 10,
      "created_at": "2024-01-15T10:32:00Z"
    }
  ]
}

Likhoutu tsa Boemo ba Karabelo

200 Successfully retrieved zone details
404 Zone not found or not owned by user
POST /api/v1/dns-zones/

E_ba le sebaka sa DNS

E etsa sebaka sa DNS se secha bakeng sa domain. Sebaka se tla sebelisoa kapele ho VPS.org nameservers.

Kopa Liparamente tsa 'Mele

Parameter Mofuta E hlokahala Bophara
domain string E Domain name (e.g., example.com)

Kopo ea Mohlala

cURL
Python
JavaScript
curl -X POST "https://admin.vps.org/api/v1/dns-zones/" \
  -H "Authorization: Bearer YOUR_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"domain": "newdomain.com"}'
import requests

url = "https://admin.vps.org/api/v1/dns-zones/"
headers = {
    "Authorization": "Bearer YOUR_API_TOKEN",
    "Content-Type": "application/json"
}
data = {"domain": "newdomain.com"}

response = requests.post(url, headers=headers, json=data)
print(response.json())
const response = await fetch('https://admin.vps.org/api/v1/dns-zones/', {
  method: 'POST',
  headers: {
    'Authorization': 'Bearer YOUR_API_TOKEN',
    'Content-Type': 'application/json'
  },
  body: JSON.stringify({domain: 'newdomain.com'})
});

const zone = await response.json();
console.log(zone);

Karabo ea Mohlala

{
  "uuid": "new-zone-uuid",
  "domain": "newdomain.com",
  "created_at": "2026-01-18T16:45:00Z",
  "record_count": 0,
  "records": []
}

Likhoutu tsa Boemo ba Karabelo

201 DNS zone created successfully
400 Bad Request - Invalid domain name or zone already exists
403 Forbidden - Token lacks dns:create permission
Hlakola /api/v1/dns-zones/{uuid}/

Ho tlosa sebaka sa DNS

Ho tlosa sebaka sa DNS le li-records tsohle tse amanang le sona ka ho sa feleng. Ho se khone ho tlosa ts'ebetso ena.

Liparamitha tsa Tsela

Parameter Mofuta E hlokahala Bophara
uuid string E Unique zone identifier

Likhoutu tsa Boemo ba Karabelo

204 Zone deleted successfully (no response body)
403 Forbidden - Token lacks dns:delete permission
404 Zone not found
FUMANA /api/v1/dns-zones/{uuid}/records/

Libuka tsa DNS li hlahlojoa ka sebaka

Fumana li-records tsohle tsa DNS bakeng sa sebaka se itseng (mohala o kopantsoeng).

Liparamitha tsa Tsela

Parameter Mofuta E hlokahala Bophara
uuid string E Zone UUID

Kopo ea Mohlala

curl -X GET "https://admin.vps.org/api/v1/dns-zones/{uuid}/records/" \
  -H "Authorization: Bearer YOUR_API_TOKEN"

Karabo ea Mohlala

[
  {
    "uuid": "rec-001",
    "record_type": "A",
    "name": "@",
    "value": "192.0.2.1",
    "ttl": 3600,
    "priority": null,
    "created_at": "2024-01-15T10:30:00Z"
  },
  {
    "uuid": "rec-002",
    "record_type": "MX",
    "name": "@",
    "value": "mail.example.com",
    "ttl": 3600,
    "priority": 10,
    "created_at": "2024-01-15T10:32:00Z"
  }
]
POST /api/v1/dns-zones/{uuid}/records/

E 'ngoe

E-ba le lengolo le lecha la DNS ho sebaka se itseng (mohala o kopantsoeng).

Kopa Liparamente tsa 'Mele

Parameter Mofuta E hlokahala Bophara
record_type string E Record type: A, AAAA, CNAME, MX, TXT, NS, SRV, CAA
name string E Record name (@ for root, subdomain, or FQDN)
value string E Record value (IP address, hostname, text)
ttl integer No Time to live in seconds (default: 3600)
priority integer For MX/SRV Priority (required for MX and SRV records)

Kopo ea Mohlala

cURL
Python
curl -X POST "https://admin.vps.org/api/v1/dns-zones/{uuid}/records/" \
  -H "Authorization: Bearer YOUR_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "record_type": "A",
    "name": "www",
    "value": "192.0.2.1",
    "ttl": 3600
  }'
import requests

url = f"https://admin.vps.org/api/v1/dns-zones/{zone_uuid}/records/"
headers = {
    "Authorization": "Bearer YOUR_API_TOKEN",
    "Content-Type": "application/json"
}
data = {
    "record_type": "A",
    "name": "www",
    "value": "192.0.2.1",
    "ttl": 3600
}

response = requests.post(url, headers=headers, json=data)
print(response.json())

Likhoutu tsa Boemo ba Karabelo

201 DNS record created successfully
400 Bad Request - Invalid parameters or validation error (e.g., MX record missing priority)
GET PUT PATCH DELETE /api/v1/dns-records/{uuid}/

Manage DNS Records (Direct Access)

Likarolo tsohle tsa CRUD li sebetsa ka li-records tsa DNS ka ho sebelisa UUID ea li-record.

Likarolo tse fumanehang

Parameters ea potso (e le GET /api/v1/dns-records/)

Parameter Mofuta Bophara
zone string Filter records by zone UUID
record_type string Filter by record type (A, AAAA, MX, etc.)

Mohlala: Ho nchafatsa TTL ea lifaele

curl -X PATCH "https://admin.vps.org/api/v1/dns-records/{rec-uuid}/" \
  -H "Authorization: Bearer YOUR_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"ttl": 1800}'

Supported DNS Record Types

Mofuta Purpose Example Value Priority Required
A Maps domain to IPv4 address 192.0.2.1 Ha ho joalo
AAAA Maps domain to IPv6 address 2001:0db8::1 Ha ho joalo
CNAME Creates alias to another domain example.com Ha ho joalo
MX Mail server for domain mail.example.com E
TXT Text record (SPF, DKIM, verification) v=spf1 include:_spf.google.com ~all Ha ho joalo
NS Nameserver delegation ns1.example.com Ha ho joalo
SRV Service location record 10 5060 sip.example.com E
CAA Certificate authority authorization 0 issue "letsencrypt.org" Ha ho joalo

Likarolo

Ho kenya TTL

Litšoantšo tse tloaelehileng

Setsi sa _Seha

Ho lokisa liphoso

Liphoso tse tloaelehileng

Khoutu ea Boemo Ho se khone ho bula %s: %s Mofuta
400 Lebitso la domain le sa nepahale Lekola hore domain e latela litaelo tsa ho bitsa DNS
400 Rekoto ea MX e hloka ho ba le boikarabello E_tsa priority sebaka sa li-records tsa MX le SRV
401 Token ea API e sa nepahale Check token format (e tlameha ho qala ka vps_)
403 Litokelo li sa fumaneha E etsa token e ncha e hlokang dns:* Litokelo
404 Sebopeho sa faele se sa fumanehe Qetellong u tla fumana UUID ea hau.

Mohlala oa karabo ea bothata

{
  "detail": "MX records require a priority value",
  "error_code": "validation_error",
  "field": "priority"
}

Ho hlahloba liphetoho tsa DNS

QFont

# Query A record
dig example.com A

# Query specific nameserver
dig @ns1.vps.org example.com

# Query MX records
dig example.com MX

# Check all records
dig example.com ANY

Ho sebelisa lisebelisoa tsa marang-rang