Change nameservers on several domains
POST /api/v2/domains/bulk/nameservers
Point several domains at the same nameservers. This changes the nameservers registered for each domain at the registry. It does not change NS records inside a DNS zone. Use primary.ns.hostup.se and secondary.ns.hostup.se for DNS hosted by Hostup.
Send between one and ten nameservers. Most domains need at least two. A .se or .nu domain accepts a single nameserver when it is not a Hostup nameserver. The Hostup nameservers always go together as a pair.
Every nameserver is checked before the job is queued. Each must resolve to an IPv4 or IPv6 address. For a .se or .nu domain, a nameserver whose hostname ends in .se or .nu must also exist at the registry. Register a nameserver under your own domain (such as ns1.example.com) first with POST /api/v2/domains/{id}/glue-records. A nameserver that fails a check rejects the whole call with 422. The response does not say which one failed. POST /api/v2/domains/nameservers/validate with domain set shows it. The whole batch is also rejected when any domain ID is invalid or not in your account.
Before the job is queued, the current DNS records of each domain are saved as a snapshot (GET /api/v2/domains/{id}/dns/snapshots). The call returns 202 with a job. Follow it at operation.pollUrl (Jobs).
Authentication: An API key with the scope write:domains. About keys and scopes
Request
Body
domainIdsarray of stringrequireddom_…) to change. At least one.nameserversarray of stringrequiredExample
curl -X POST "https://cloud.hostup.se/api/v2/domains/bulk/nameservers" \ -H "Authorization: Bearer $HOSTUP_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "domainIds": [ "dom_01hxa3b4c5d6e7f8g9h0j1k2m3", "dom_01hxa3b4c5d6e7f8g9h0j1k2m4" ], "nameservers": [ "primary.ns.hostup.se", "secondary.ns.hostup.se" ] }'Responses
202 Job queued. Follow it at operation.pollUrl.
{ "operation": { "status": "pending", "jobId": "dbj_01hxa3b4c5d6e7f8g9h0j1k2m3", "pollUrl": "/api/jobs/dbj_01hxa3b4c5d6e7f8g9h0j1k2m3" }, "domainsQueued": 2}Response fields
operationobjectstatusstring202 Accepted response only has pending, queued or in_progress. completed and failed appear when you poll pollUrl. They also appear in a 200 OK response when the action finished during the request. One of pending, queued, in_progress, completed, failed.jobIdstringpollUrlstring or nullnull when status is already completed or failed.domainsQueuedinteger or nullErrors
Errors are Problem Details with a stable code. Branch on the code, not on the text.
| 400 | Validation failed. Check the body, the number of nameservers and the hostname format. When a domain needs more nameservers, errors[] points to it in /domainIds/{index}. |
| 401 | Unauthorized. Authentication is required. |
| 403 | Forbidden. The caller lacks a required scope or does not own the resource. |
| 404 | Not found. The resource does not exist or is not owned by the caller. |
| 422 | A nameserver failed the check. Either it does not resolve or a .se or .nu host is not registered at the registry. Nothing was queued. The response does not name the domain or the nameserver. |
| 429 | Rate limited. Retry after the limit resets. 429 responses include Retry-After seconds plus X-RateLimit-* headers. |
| 500 | Internal error. Retry later or contact support if the issue persists. |