Create or update a glue record
POST /api/v2/domains/{id}/glue-records
Registers a glue record for one of the domain’s own nameservers at the registry. If the hostname already has a glue record, its IP addresses are replaced. Check actions.canCreateGlueRecord.allowed on GET /api/v2/domains/{id}/glue-records first. Only .se and .nu domains are supported. This does not change the domain nameserver set. To use the nameserver, add it with POST /api/v2/domains/{id}/nameservers. It does not create A or AAAA records in the DNS zone either.
Authentication: An API key with the scope write:domains. About keys and scopes
Request
Path parameters
idstringrequiredThe domain ID. From
GET /api/v2/domains.Body
hostnamestringrequiredThe nameserver’s fully qualified hostname under the domain, for example
ns1.example.se for example.se.ipsarray of stringrequired1-10 valid public IPv4 or IPv6 addresses for the nameserver. Replaces any addresses already registered.
Example
curl -X POST "https://cloud.hostup.se/api/v2/domains/dom_01hxa3b4c5d6e7f8g9h0j1k2m3/glue-records" \ -H "Authorization: Bearer $HOSTUP_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "hostname": "ns1.example.se", "ips": [ "192.0.2.10", "2001:db8::10" ] }'Responses
201 The glue record was registered or updated.
{ "hostname": "ns1.example.se", "ips": [ "192.0.2.10", "2001:db8::10" ]}Response fields
hostnamestringThe nameserver hostname.
ipsarray of stringThe IP addresses now registered.
Errors
Errors are Problem Details with a stable code. Branch on the code, not on the text.
| 400 | The request was refused. A malformed hostname or IP address is named in errors[].pointer. A private IP address, a hostname that is not under the domain, a domain that is not .se or .nu, and a refusal by the registry all answer detail “The request is invalid.” without saying which. Check those before you call. |
| 401 | Unauthorized. Authentication is required. |
| 403 | The API key lacks write:domains (the body lists requiredScopes), or the registry refused the change for this domain. A domain that is not on your account answers 404. |
| 404 | Not found. The resource does not exist or is not owned by the caller; code is domain_not_found. |
| 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. |