DNGate
Developer API · v1

DNGate Developer API

Manage your domains programmatically: list your portfolio, edit DNS records, switch nameservers. Authenticate with a personal API key from Profile → API access.

Authentication

Create a key in Profile → API access (up to 5 active keys). Send it as a Bearer token on every request:

curl https://dngate.io/api/v1/domains \
  -H "Authorization: Bearer dgk_YOUR_KEY"

The full key is shown only once at creation. Revoking a key takes effect immediately. Browser (CORS) clients are not supported — the API is for scripts, servers and CI.

List domains

MethodPath
GET/api/v1/domains200

Every domain in your account as a pure account-data projection: domain, status, registrar, registration_date, expiry_date, auto_renew, created_at. Lock state is deliberately not included (it is a live registry query — use the app).

DNS records

MethodPathBody
GET/api/v1/domains/{domain}/records—
POST/api/v1/domains/{domain}/records{"name","type","ttl?","data"}
PUT/api/v1/domains/{domain}/records{"match":{…},"record":{…}}
DELETE/api/v1/domains/{domain}/records?name=&type=&data=or JSON {"name","type","data"}

Record types: A, AAAA, CNAME, MX, TXT, NS, SRV, CAA. TTL 60–86400 (optional on create). The apex is @; automation-friendly input is normalized — "", the bare domain or www.example.com all become @ / www.

# add a record
curl -X POST https://dngate.io/api/v1/domains/example.com/records \
  -H "Authorization: Bearer dgk_YOUR_KEY" -H "Content-Type: application/json" \
  -d '{"name":"www","type":"A","ttl":300,"data":"192.0.2.10"}'

# update: match locates the old record, record is the new value
curl -X PUT https://dngate.io/api/v1/domains/example.com/records \
  -H "Authorization: Bearer dgk_YOUR_KEY" -H "Content-Type: application/json" \
  -d '{"match":{"name":"www","type":"A","data":"192.0.2.10"},
       "record":{"name":"www","type":"A","ttl":600,"data":"192.0.2.11"}}'

# delete — JSON body also accepted (easier for TXT payloads)
curl -X DELETE 'https://dngate.io/api/v1/domains/example.com/records?name=www&type=A&data=192.0.2.11' \
  -H "Authorization: Bearer dgk_YOUR_KEY"

Why DELETE needs data: registries have no per-record id — records are addressed by the ⟨name, type, data⟩ triple (TTL is ignored). Two SPF TXT records differ only by data, so data is required to pick the right one.

Nameservers

MethodPathBody
GET/api/v1/domains/{domain}/nameservers—
PUT/api/v1/domains/{domain}/nameservers{"nameservers":["ns1.example.com",…]}

PUT replaces the full set (1–13 hosts), it never appends. Tokenized domains (claimed as NFT) reject NS changes with 409 domain_tokenized — that lock is by design.

Errors & limits

HTTPcodeMeaning
400invalid_domain / validation_errorBad path or body — domains must be ASCII/Punycode (IDN: send xn--…)
401invalid_api_keyMissing, malformed, revoked or wrong key (uniform — no detail)
403not_ownerThe key's account does not own the domain
404zone_not_foundNo DNS zone at the registrar; response carries nameservers + usesRegistrarDns to tell "no zone yet" from "delegated elsewhere"
409domain_tokenizedNS change blocked while the domain is tokenized
429rate_limitedRate limit — see Retry-After
502upstream_error / upstream_uncertainRegistry failure. On upstream_uncertain GET the current state before retrying — the change may have been applied

Rate limits: 60 reads/min and 20 writes/min per key, 10 failed authentications/min per IP. Successful responses carry X-RateLimit-Limit / X-RateLimit-Remaining; 429s carry Retry-After. Machine-readable schema: openapi.json (import into Postman / Bruno).