Add a DNSSEC record
POST /api/v2/domains/{id}/dnssec
Adds one DS or KEY record for the domain at the registry. Use it when another DNS provider signs the domain’s zone and gives you the record. Domains on Hostup nameservers normally get their DS record from automatic DNSSEC (GET /api/v2/domains/{id}/dnssec-auto). Before you call it, check that actions.canAdd.allowed is true on GET /api/v2/domains/{id}/dnssec. That response also says whether the registry takes DS or KEY records. If it lists detectedRecords, send the values of one of them to turn DNSSEC on for a zone that is already signed. The change goes to the registry right away. A wrong record can make the domain stop resolving for resolvers that check DNSSEC. While a .se or .nu registry lock is on, the call returns 409 registry_lock_unlock_required.
Authentication: An API key with the scope write:domains. About keys and scopes
Request
Path parameters
idstringrequireddom_…).Body
typestringrequiredDS needs keyTag, algorithm, digestType and digest. KEY needs flag, protocol, algorithm and publicKey. One of DS, KEY.keyTagstringtype is DS.algorithmstringrequired13. Must be one of allowedAlgorithms.digestTypestring2 for SHA-256. Required when type is DS.digeststringtype is DS.flagstring257 for a key-signing key. Required when type is KEY.protocolstring3 for DNSSEC. Required when type is KEY.publicKeystringtype is KEY.recoveryValuesobjectdnssec_recovery_required response. Send only the keys listed in recovery.fields.Example
curl -X POST "https://cloud.hostup.se/api/v2/domains/dom_01hxa3b4c5d6e7f8g9h0j1k2m3/dnssec" \ -H "Authorization: Bearer $HOSTUP_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "type": "DS", "keyTag": "2371", "algorithm": "13", "digestType": "2", "digest": "5A1D7C1B9E7F4E6A8C2B0D5F9A3E6C7D8B1A2C3D4E5F60718293A4B5C6D7E8F9" }'curl -X POST "https://cloud.hostup.se/api/v2/domains/dom_01hxa3b4c5d6e7f8g9h0j1k2m3/dnssec" \ -H "Authorization: Bearer $HOSTUP_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "type": "KEY", "flag": "257", "protocol": "3", "algorithm": "13", "publicKey": "p8K3pYwQ5xvM7nR2sT4uV6wX8yZaBcDeFgHiJkLmNoPqRsTuVwXyZ0123456789" }'Responses
201 The record was sent to the registry. The response echoes it. id can be null.
{ "recordType": "DS", "ds": { "id": null, "keyTag": "2371", "algorithm": "13", "digestType": "2", "digest": "5A1D7C1B9E7F4E6A8C2B0D5F9A3E6C7D8B1A2C3D4E5F60718293A4B5C6D7E8F9" }, "key": null}Response fields
recordTypestringDS or KEY. One of DS, KEY.dsobject | nullidstring | nulldsr_…). Can be null here. Read GET /api/v2/domains/{id}/dnssec for it.keyTagstring | nullalgorithmstring | nulldigestTypestring | nulldigeststring | nullkeyobject | nullidstring | nulldsr_…). Can be null here. Read GET /api/v2/domains/{id}/dnssec for it.flagstring | nullprotocolstring | nullalgorithmstring | nullpublicKeystring | nullErrors
Errors are Problem Details with a stable code. Branch on the code, not on the text.
| 400 | The body is not valid or the registry rejected the record. errors[] points at the field. invalid_record_type means the domain takes the other record type. A domain can hold at most six DS records. |
| 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; code is domain_not_found. |
| 409 | The .se or .nu registry lock is on. The registry refuses DNSSEC changes until the lock is removed with POST /api/v2/domains/{id}/actions/request-unlock. |
| 422 | The registry needs more details first. recovery.fields lists them. Send them as recoveryValues in the same body and try again. A field with target account is changed in the account details instead. |
| 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. |
| 502 | The change was sent but could not be confirmed afterwards (upstream_failed). Read GET /api/v2/domains/{id}/dnssec before you try again. |