GET /subdomains
Lists your subdomains.
curl -H "Authorization: Bearer YOUR_API_TOKEN" "https://www.20dragons.com/api/subdomains"
{ "ok": true, "subdomains": [ { "...": "see subdomain fields below" } ] }
POST /subdomains
Registers a subdomain.
Required: a platform domain (as platform_domain_id, domain, or as part of fqdn) and a label (unless it can be derived from fqdn).
Optional: coupon_code, nameservers (or ns1.."ns4"), glue addresses for nameservers that live inside the subdomain, ds_records, and confirm (see below). You can also send registration_mode set to free, plus, premium, or special — admin mode is not available through the API.
curl -X POST "https://www.20dragons.com/api/subdomains" \
-H "Authorization: Bearer YOUR_API_TOKEN" \
-H "Content-Type: application/json" \
-d '{"domain":"example-domain.com","label":"myproject","nameservers":["ns1.example.net"],"glue":[]}'
A successful registration returns HTTP 201:
{
"ok": true,
"subdomain": { "...": "see subdomain fields below" },
"provisioning": { "...": "..." },
"charged_credits": 0,
"coupon": null
}
Paid registrations: if credits are required, the first request returns a quote instead of completing (see API errors — payment_confirmation_required and similar). Show the quoted price to the user, then send the same request again with "confirm": true to finalize it.
GET /subdomains/{fqdn}
Retrieves one of your subdomains by its full subdomain name (or id).
{ "ok": true, "subdomain": { "...": "see subdomain fields below" } }
DELETE /subdomains/{fqdn}
Removes a subdomain from your account (moves it to Trash — see My subdomains).
{ "ok": true, "deleted": { "id": 0, "fqdn": "myproject.example-domain.com" } }
PUT /subdomains/{fqdn}/nameservers
Updates nameservers, glue addresses, and DS records.
curl -X PUT "https://www.20dragons.com/api/subdomains/myproject.example-domain.com/nameservers" \
-H "Authorization: Bearer YOUR_API_TOKEN" \
-H "Content-Type: application/json" \
-d '{"nameservers":["ns1.myproject.example-domain.com"],"glue":[{"host":"ns1.myproject.example-domain.com","ipv4":"192.0.2.10"}]}'
{ "ok": true, "subdomain": { "...": "..." }, "provisioning": { "...": "..." } }
If your nameserver lives inside your own subdomain, a public authoritative IPv4 or IPv6 glue address is required for it.
POST /subdomains/{fqdn}/retry
Retries provisioning after a failure. Requires nameserver 1 to already be set.
Same response shape as the nameservers update above.
POST /subdomains/{fqdn}/renew
Renews a subdomain. Optional: confirm, coupon_code.
{
"ok": true,
"subdomain": { "...": "..." },
"renewal": {
"expires_at": "...",
"renewal_available": true,
"charged_credits": 0,
"coupon": null
}
}
If renewal requires credits, the same confirm pattern as registration applies.
Subdomain object fields
A subdomain object returned by these endpoints includes: id, fqdn, label, domain, domain_public_name, status, status_label, registration_type, registration_source, nameservers, glue, dnssec_enabled, ds_records, provision_error, registered_at, expires_at, last_renewed_at, renewal_available, created_at, updated_at.