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
| Method | Path | Description |
|---|---|---|
| POST | /v1/auth/login | Obtain an access token (refresh token set as httpOnly cookie) |
| POST | /v1/auth/refresh | Rotate the refresh cookie and get a new access token |
| GET | /v1/domains?page=1&per_page=20 | List your domains (paginated) |
| GET | /v1/domains/:id | Domain details |
| POST | /v1/domains | Register a domain |
| GET | /v1/dns/zones | List DNS zones |
| GET | /v1/dns/:domainId/records | List DNS records for a domain |
| POST | /v1/dns/:domainId/records | Create a DNS record |
| GET | /v1/billing/invoices | List invoices |
Accredited registrars integrate over EPP instead — see the EPP guide.