Preview DNS records from a zone file

POST /api/v2/dns-zones/{id}/smartcopy-zonefile

Parse a pasted DNS zone file and compare its importable records with the selected HostUp DNS zone.

Get {id} from GET /api/v2/dns-zones data[].id.

The zone file is limited to 200,000 characters.

Invalid or unsupported rows are skipped; the request fails when no valid records remain.

This operation only builds a preview and does not change the zone.

Validation failures use errors[] with the /zoneFile pointer and a stable field code.

Domains & DNS DNS

Authentication

Required API scope: write:dns

Authenticate with an API key in the Authorization: Bearer <token> header.

Context

Path Parameters

id string required Example: zone_01hxa3b4c5d6e7f8g9h0j1k2m3

Public DNS zone ID from GET /api/v2/dns-zones. Do not invent this value; use the exact ID returned by the referenced API response.

Headers

Authorization Bearer <token>
Accept application/json
Content-Type application/json

Body

required
application/json
zoneFile string required · Example: $ORIGIN example.com. @ 3600 IN A 192.0.2.10 www 3600 IN CNAME @

DNS zone-file text to parse.

Responses

200 SmartCopy zone-file comparison preview.
records array<object> required
records[].type string · enum required · Example: A
A
AAAA
CNAME
ALIAS
MX
TXT
CAA
SRV
NS
TLSA
records[].name string required · Example: www

Record name relative to the destination zone. @ is the zone root.

records[].value string required · Example: 192.0.2.10
records[].ttl number · Example: 3600
records[].priority number · Example: 10
records[].weight number · Example: 5
records[].port number · Example: 5060
records[].isCloudflare boolean · Example: false

True when the source record has proxy-specific behavior that needs review.

records[].cloudflareWarning string

Customer-facing warning about source proxy behavior, when applicable.

records[].recordSubtype string · enum · Example: SPF
SPF
DMARC
DKIM
DOMAINKEY
MS365
records[].annotation string · enum required · Example: new

How the discovered record compares with the destination zone.

new
duplicate
conflict
records[].conflictingValue string

Existing destination value when annotation is conflict.

domain string · nullable required · Example: example.com

existingCount integer · min: 0 required · Example: 8
400 Missing, oversized, or unparseable zone file. Inspect errors[0].code: missing_zone_file, zone_file_too_large, or zone_file_no_records.
type string · Example: https://developer.hostup.se/errors/invalid_request
title string · Example: Validation failed
status integer · Example: 400
detail string · Example: The request body failed validation.
code string · Example: invalid_request

Stable machine-readable code. Branch on this field, not on detail.

instance string · Example: /api/v2/orders
requestId string · Example: req_01hxa3b4c5d6e7f8g9h0j1k2m3
timestamp string · Example: 2026-04-27T12:34:56.000Z
errors array<object>

Field-level validation errors when code is invalid_request.

errors[].pointer string required · Example: /items/0/eppCode
errors[].detail string required · Example: `eppCode` is required for this transfer.
errors[].code string required · Example: missing_required
extensions object
401 Unauthorized. Authentication is required.
type string · Example: https://developer.hostup.se/errors/invalid_request
title string · Example: Validation failed
status integer · Example: 400
detail string · Example: The request body failed validation.
code string · Example: invalid_request

Stable machine-readable code. Branch on this field, not on detail.

instance string · Example: /api/v2/orders
requestId string · Example: req_01hxa3b4c5d6e7f8g9h0j1k2m3
timestamp string · Example: 2026-04-27T12:34:56.000Z
errors array<object>

Field-level validation errors when code is invalid_request.

errors[].pointer string required · Example: /items/0/eppCode
errors[].detail string required · Example: `eppCode` is required for this transfer.
errors[].code string required · Example: missing_required
extensions object
403 Forbidden. The caller lacks a required scope or does not own the resource.
type string · Example: https://developer.hostup.se/errors/invalid_request
title string · Example: Validation failed
status integer · Example: 400
detail string · Example: The request body failed validation.
code string · Example: invalid_request

Stable machine-readable code. Branch on this field, not on detail.

instance string · Example: /api/v2/orders
requestId string · Example: req_01hxa3b4c5d6e7f8g9h0j1k2m3
timestamp string · Example: 2026-04-27T12:34:56.000Z
errors array<object>

Field-level validation errors when code is invalid_request.

errors[].pointer string required · Example: /items/0/eppCode
errors[].detail string required · Example: `eppCode` is required for this transfer.
errors[].code string required · Example: missing_required
extensions object
404 The selected DNS zone does not exist or is not accessible to the caller.
type string · Example: https://developer.hostup.se/errors/invalid_request
title string · Example: Validation failed
status integer · Example: 400
detail string · Example: The request body failed validation.
code string · Example: invalid_request

Stable machine-readable code. Branch on this field, not on detail.

instance string · Example: /api/v2/orders
requestId string · Example: req_01hxa3b4c5d6e7f8g9h0j1k2m3
timestamp string · Example: 2026-04-27T12:34:56.000Z
errors array<object>

Field-level validation errors when code is invalid_request.

errors[].pointer string required · Example: /items/0/eppCode
errors[].detail string required · Example: `eppCode` is required for this transfer.
errors[].code string required · Example: missing_required
extensions object
429 Rate limited. Retry after the limit resets. 429 responses include Retry-After seconds plus X-RateLimit-* headers.
type string · Example: https://developer.hostup.se/errors/invalid_request
title string · Example: Validation failed
status integer · Example: 400
detail string · Example: The request body failed validation.
code string · Example: invalid_request

Stable machine-readable code. Branch on this field, not on detail.

instance string · Example: /api/v2/orders
requestId string · Example: req_01hxa3b4c5d6e7f8g9h0j1k2m3
timestamp string · Example: 2026-04-27T12:34:56.000Z
errors array<object>

Field-level validation errors when code is invalid_request.

errors[].pointer string required · Example: /items/0/eppCode
errors[].detail string required · Example: `eppCode` is required for this transfer.
errors[].code string required · Example: missing_required
extensions object
500 Internal error. Retry later or contact support if the issue persists.
type string · Example: https://developer.hostup.se/errors/invalid_request
title string · Example: Validation failed
status integer · Example: 400
detail string · Example: The request body failed validation.
code string · Example: invalid_request

Stable machine-readable code. Branch on this field, not on detail.

instance string · Example: /api/v2/orders
requestId string · Example: req_01hxa3b4c5d6e7f8g9h0j1k2m3
timestamp string · Example: 2026-04-27T12:34:56.000Z
errors array<object>

Field-level validation errors when code is invalid_request.

errors[].pointer string required · Example: /items/0/eppCode
errors[].detail string required · Example: `eppCode` is required for this transfer.
errors[].code string required · Example: missing_required
extensions object
POST https://cloud.hostup.se/api/v2/dns-zones/{id}/smartcopy-zonefile
For AI assistants
View as Markdown
cURL
curl -X POST "https://cloud.hostup.se/api/v2/dns-zones/zone_01hxa3b4c5d6e7f8g9h0j1k2m3/smartcopy-zonefile" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Accept: application/json" \
  -H "Content-Type: application/json" \
  -d '{
    "zoneFile": "$ORIGIN example.com.\n@ 3600 IN A 192.0.2.10\nwww 3600 IN CNAME @"
  }'
Response
{
  "records": [
    {
      "type": "A",
      "name": "@",
      "value": "192.0.2.10",
      "ttl": 3600,
      "annotation": "new"
    },
    {
      "type": "CNAME",
      "name": "www",
      "value": "example.com",
      "ttl": 3600,
      "annotation": "duplicate"
    }
  ],
  "domain": "example.com",
  "existingCount": 8
}
Request Body Parse a small zone file
{
  "zoneFile": "$ORIGIN example.com.\n@ 3600 IN A 192.0.2.10\nwww 3600 IN CNAME @"
}