curl -X POST "https://your-paneldns-domain.com/api/v1/zones/501/import" \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"zone_file": "$ORIGIN widgets.co.\n$TTL 3600\n@ IN A 192.0.2.10\nwww IN CNAME @\n"
}'
{
"ok": true,
"data": null
}
{
"ok": false,
"error": "Zone has no provider.",
"code": 422
}
{
"ok": false,
"error": "Could not parse zone file: unexpected token on line 4.",
"code": 502
}
Zones
Import Zone
Import records from a BIND-format zone file. Requires zones:write scope.
POST
/
api
/
v1
/
zones
/
{id}
/
import
curl -X POST "https://your-paneldns-domain.com/api/v1/zones/501/import" \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"zone_file": "$ORIGIN widgets.co.\n$TTL 3600\n@ IN A 192.0.2.10\nwww IN CNAME @\n"
}'
{
"ok": true,
"data": null
}
{
"ok": false,
"error": "Zone has no provider.",
"code": 422
}
{
"ok": false,
"error": "Could not parse zone file: unexpected token on line 4.",
"code": 502
}
Replaces the zone’s records on the provider with those parsed from the supplied BIND zone file. All existing records on the provider are removed and replaced with the imported set.
Import replaces the existing record set. Back up the current zone with Export Zone before importing if you want to preserve the existing records.
integer
required
Zone ID.
string
required
Full BIND 9 zone file contents. Must contain valid resource records. The
$ORIGIN and $TTL directives are supported. Max 51,200 bytes (50 KB).curl -X POST "https://your-paneldns-domain.com/api/v1/zones/501/import" \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"zone_file": "$ORIGIN widgets.co.\n$TTL 3600\n@ IN A 192.0.2.10\nwww IN CNAME @\n"
}'
{
"ok": true,
"data": null
}
{
"ok": false,
"error": "Zone has no provider.",
"code": 422
}
{
"ok": false,
"error": "Could not parse zone file: unexpected token on line 4.",
"code": 502
}