NPDNS
Sign inRegister

REST API

Automate domains, DNS and billing

Authentication

Use an API key from API Keys in the X-API-Key header, or a user access token as Authorization: Bearer <token>. Keys support scopes, IP allowlists and expiry.

curl https://api.npdns.np/v1/domains \
  -H "X-API-Key: npdns_…"

Responses

Every response uses the same envelope. Amounts are integers in paisa (1 NPR = 100).

{ "success": true, "data": [...], "meta": { "page": 1, "perPage": 20, "total": 42, "totalPages": 3 } }
{ "success": false, "error": { "code": "NOT_FOUND", "message": "Domain not found" } }

Paginate with ?page= and ?per_page= (max 100).

Common endpoints

MethodPathDescription
POST/v1/auth/loginObtain an access token (refresh token set as httpOnly cookie)
POST/v1/auth/refreshRotate the refresh cookie and get a new access token
GET/v1/domains?page=1&per_page=20List your domains (paginated)
GET/v1/domains/:idDomain details
POST/v1/domainsRegister a domain
GET/v1/dns/zonesList DNS zones
GET/v1/dns/:domainId/recordsList DNS records for a domain
POST/v1/dns/:domainId/recordsCreate a DNS record
GET/v1/billing/invoicesList invoices

Accredited registrars integrate over EPP instead — see the EPP guide.