KyPanelDocs

API reference

DNS

DNS zones and records, zone templates.

List the account's DNS zones

GET/api/v1/accounts/{id}/dns/zones

Who
root, reseller (ACL: edit-dns or create-user-session); customer
API tokens
admin token area: accounts; account token area: dns
Feature
zone_editor
Operation
listZones · ky call listZones

Parameters

NameIn
idpath

Responses

  • 200 OK
    Body
    FieldType
    itemsarray of StoreZone
  • 401 Unauthorized: no session, or an invalid or expired token
  • 403 Forbidden: the caller can't use this (privileges, token scope, feature turned off)
  • 500 Internal Server Error: internal

List a zone's records

GET/api/v1/accounts/{id}/dns/zones/{zid}/records

Who
root, reseller (ACL: edit-dns or create-user-session); customer
API tokens
admin token area: accounts; account token area: dns
Feature
zone_editor
Operation
listRecords · ky call listRecords

Parameters

NameIn
idpath
zidpath

Responses

  • 200 OK
    Body
    FieldType
    itemsarray of StoreDNSRecord
    zoneStoreZone
  • 401 Unauthorized: no session, or an invalid or expired token
  • 403 Forbidden: the caller can't use this (privileges, token scope, feature turned off)
  • 404 Not Found: not-found
  • 500 Internal Server Error: internal

Add a DNS record

POST/api/v1/accounts/{id}/dns/zones/{zid}/records

Who
root, reseller (ACL: edit-dns); customer
API tokens
admin token area: accounts; account token area: dns
Feature
zone_editor
Operation
addRecord · ky call addRecord

Parameters

NameIn
idpath
zidpath

Request body

FieldType
contentstring
namestring
priorityinteger
ttlinteger
typestring

Responses

  • 200 OK
  • 400 Bad Request: validation
  • 401 Unauthorized: no session, or an invalid or expired token
  • 403 Forbidden: the caller can't use this (privileges, token scope, feature turned off)
  • 404 Not Found: not-found
  • 409 Conflict: duplicate, validation
  • 500 Internal Server Error: internal
  • 502 Bad Gateway: dns-publish-failed

Delete a DNS record

DELETE/api/v1/accounts/{id}/dns/zones/{zid}/records/{rid}

Who
root, reseller (ACL: edit-dns); customer
API tokens
admin token area: accounts; account token area: dns
Feature
zone_editor
Operation
deleteRecord · ky call deleteRecord

Parameters

NameIn
idpath
zidpath
ridpath

Responses

  • 200 OK
  • 401 Unauthorized: no session, or an invalid or expired token
  • 403 Forbidden: the caller can't use this (privileges, token scope, feature turned off)
  • 404 Not Found: not-found
  • 409 Conflict: duplicate, validation
  • 500 Internal Server Error: internal
  • 502 Bad Gateway: dns-publish-failed

Update a DNS record

PUT/api/v1/accounts/{id}/dns/zones/{zid}/records/{rid}

Who
root, reseller (ACL: edit-dns); customer
API tokens
admin token area: accounts; account token area: dns
Feature
zone_editor
Operation
updateRecord · ky call updateRecord

Parameters

NameIn
idpath
zidpath
ridpath

Request body

FieldType
contentstring
namestring
priorityinteger
ttlinteger
typestring

Responses

  • 200 OK
  • 400 Bad Request: validation
  • 401 Unauthorized: no session, or an invalid or expired token
  • 403 Forbidden: the caller can't use this (privileges, token scope, feature turned off)
  • 404 Not Found: not-found
  • 409 Conflict: duplicate, validation
  • 500 Internal Server Error: internal
  • 502 Bad Gateway: dns-publish-failed

Turn Cloudflare's proxy on or off for a record

PUT/api/v1/accounts/{id}/dns/zones/{zid}/records/{rid}/proxy

Who
root, reseller (ACL: edit-dns); customer
API tokens
admin token area: accounts; account token area: dns
Feature
cloudflare
Operation
cfRecordProxy · ky call cfRecordProxy

Parameters

NameIn
idpath
zidpath
ridpath

Request body

FieldType
proxiedboolean

Responses

  • 204 Done, no content
  • 400 Bad Request: validation
  • 401 Unauthorized: no session, or an invalid or expired token
  • 403 Forbidden: cloudflare-permission
  • 404 Not Found: cloudflare-zone-missing, not-found
  • 409 Conflict: cloudflare-not-connected
  • 500 Internal Server Error: internal
  • 502 Bad Gateway: cloudflare

Reset a zone to the template

POST/api/v1/accounts/{id}/dns/zones/{zid}/reset

Is the Zone Editor's Reset: the zone goes back to the records the panel creates.

Who
root, reseller (ACL: edit-dns); customer
API tokens
admin token area: accounts; account token area: dns
Feature
zone_editor
Operation
resetZone · ky call resetZone

Parameters

NameIn
idpath
zidpath

Responses

  • 200 OK
    Body
    FieldType
    recordsinteger
    zonestring
  • 401 Unauthorized: no session, or an invalid or expired token
  • 403 Forbidden: the caller can't use this (privileges, token scope, feature turned off)
  • 404 Not Found: not-found
  • 500 Internal Server Error: internal
  • 502 Bad Gateway: dns-publish-failed

Choose the default zone template

PUT/api/v1/server/dns/default-template

Who
root
API tokens
admin token area: server
Operation
adminDefaultTemplate · ky call adminDefaultTemplate

Request body

FieldType
namestring

Responses

  • 200 OK
    Body
    FieldType
    defaultstring
  • 400 Bad Request: validation
  • 401 Unauthorized: no session, or an invalid or expired token
  • 403 Forbidden: the caller can't use this (privileges, token scope, feature turned off)
  • 500 Internal Server Error: internal

Add the A record of the server's hostname

POST/api/v1/server/dns/hostname-record

Who
root
API tokens
admin token area: server
Operation
adminHostnameRecord · ky call adminHostnameRecord

Request body

FieldType
ipstring

Responses

  • 200 OK
    Body
    FieldType
    hostnamestring
    ipstring
    zonestring
  • 400 Bad Request: validation
  • 401 Unauthorized: no session, or an invalid or expired token
  • 403 Forbidden: the caller can't use this (privileges, token scope, feature turned off)
  • 404 Not Found: no-zone
  • 409 Conflict: hostname-record

List zone templates

GET/api/v1/server/dns/templates

Who
root
API tokens
admin token area: server
Operation
adminTemplates · ky call adminTemplates

Responses

  • 200 OK
    Body
    FieldType
    defaultstring
    itemsarray of StoreZoneTemplate
    variablesarray of string
  • 401 Unauthorized: no session, or an invalid or expired token
  • 403 Forbidden: the caller can't use this (privileges, token scope, feature turned off)
  • 500 Internal Server Error: internal

Delete a zone template

DELETE/api/v1/server/dns/templates/{name}

Who
root
API tokens
admin token area: server
Operation
adminDeleteTemplate · ky call adminDeleteTemplate

Parameters

NameIn
namepath

Responses

  • 204 Done, no content
  • 401 Unauthorized: no session, or an invalid or expired token
  • 403 Forbidden: the caller can't use this (privileges, token scope, feature turned off)
  • 404 Not Found: not-found
  • 409 Conflict: in-use
  • 500 Internal Server Error: internal

Save a zone template

PUT/api/v1/server/dns/templates/{name}

Who
root
API tokens
admin token area: server
Operation
adminSaveTemplate · ky call adminSaveTemplate

Parameters

NameIn
namepath

Request body

FieldType
bodystring

Responses

  • 200 OK
    Body
    FieldType
    body alwaysstring
    builtin alwaysboolean
    id alwaysstring
    name alwaysstring
    updated_at alwaysinteger
  • 400 Bad Request: validation
  • 401 Unauthorized: no session, or an invalid or expired token
  • 403 Forbidden: the caller can't use this (privileges, token scope, feature turned off)
  • 500 Internal Server Error: internal

Reset a zone template to the default

POST/api/v1/server/dns/templates/{name}/reset

Who
root
API tokens
admin token area: server
Operation
adminResetTemplate · ky call adminResetTemplate

Parameters

NameIn
namepath

Responses

  • 200 OK
    Body
    FieldType
    body alwaysstring
    builtin alwaysboolean
    id alwaysstring
    name alwaysstring
    updated_at alwaysinteger
  • 401 Unauthorized: no session, or an invalid or expired token
  • 403 Forbidden: the caller can't use this (privileges, token scope, feature turned off)
  • 404 Not Found: not-found
  • 500 Internal Server Error: internal

List every DNS zone

GET/api/v1/server/dns/zones

Who
root
API tokens
admin token area: server
Operation
adminZones · ky call adminZones

Responses

  • 200 OK
    Body
    FieldType
    dns_enabledboolean
    hostnamestring
    hostname_zonestring
    itemsarray of StoreZoneInfo
    main_ipstring
    nameserversarray of string
  • 401 Unauthorized: no session, or an invalid or expired token
  • 403 Forbidden: the caller can't use this (privileges, token scope, feature turned off)
  • 500 Internal Server Error: internal

Create a DNS zone

POST/api/v1/server/dns/zones

Who
root
API tokens
admin token area: server
Operation
adminCreateZone · ky call adminCreateZone

Request body

FieldType
account_idstring
ipstring
namestring
templatestring

Responses

  • 201 Created
    Body
    FieldType
    account_idstring
    account_statusstring
    default_ttlinteger
    domain_idstring
    idstring
    namestring
    published alwaysboolean
    published_atinteger
    record_count alwaysinteger
    serialinteger
    soa alwaysStoreZoneSOA
    template_idstring
    updated_at alwaysinteger
    usernamestring
  • 400 Bad Request: validation
  • 401 Unauthorized: no session, or an invalid or expired token
  • 403 Forbidden: the caller can't use this (privileges, token scope, feature turned off)
  • 409 Conflict: validation
  • 500 Internal Server Error: internal
  • 502 Bad Gateway: dns-publish-failed

Delete a DNS zone

DELETE/api/v1/server/dns/zones/{zid}

Who
root
API tokens
admin token area: server
Operation
adminDeleteZone · ky call adminDeleteZone

Parameters

NameIn
zidpath

Responses

  • 204 Done, no content
  • 401 Unauthorized: no session, or an invalid or expired token
  • 403 Forbidden: the caller can't use this (privileges, token scope, feature turned off)
  • 404 Not Found: not-found
  • 500 Internal Server Error: internal
  • 502 Bad Gateway: dns-delete-failed

Get a DNS zone with its records

GET/api/v1/server/dns/zones/{zid}

Who
root
API tokens
admin token area: server
Operation
adminZone · ky call adminZone

Parameters

NameIn
zidpath

Responses

  • 200 OK
    Body
    FieldType
    itemsarray of StoreDNSRecord
    nameserversarray of string
    zoneStoreZoneInfo
  • 401 Unauthorized: no session, or an invalid or expired token
  • 403 Forbidden: the caller can't use this (privileges, token scope, feature turned off)
  • 404 Not Found: not-found
  • 500 Internal Server Error: internal

Export a zone file

GET/api/v1/server/dns/zones/{zid}/file

Who
root
API tokens
admin token area: server
Operation
adminZoneFile · ky call adminZoneFile

Parameters

NameIn
zidpath
downloadquery

Responses

  • 200 OK
    Body
    FieldType
    textstring
    zonestring
  • 401 Unauthorized: no session, or an invalid or expired token
  • 403 Forbidden: the caller can't use this (privileges, token scope, feature turned off)
  • 404 Not Found: not-found
  • 500 Internal Server Error: internal

Import a zone file

POST/api/v1/server/dns/zones/{zid}/file

Who
root
API tokens
admin token area: server
Operation
adminImportZone · ky call adminImportZone

Parameters

NameIn
zidpath

Request body

FieldType
dry_runboolean
textstring

Responses

  • 200 OK
    Body
    FieldType
    dry_run alwaysboolean
    records alwaysinteger
    soa_imported alwaysboolean
  • 400 Bad Request: validation
  • 401 Unauthorized: no session, or an invalid or expired token
  • 403 Forbidden: the caller can't use this (privileges, token scope, feature turned off)
  • 404 Not Found: not-found
  • 500 Internal Server Error: internal
  • 502 Bad Gateway: dns-publish-failed

Publish a zone again (bump the serial)

POST/api/v1/server/dns/zones/{zid}/publish

Who
root
API tokens
admin token area: server
Operation
adminPublishZone · ky call adminPublishZone

Parameters

NameIn
zidpath

Responses

  • 200 OK
    Body
    FieldType
    account_idstring
    account_statusstring
    default_ttlinteger
    domain_idstring
    idstring
    namestring
    published alwaysboolean
    published_atinteger
    record_count alwaysinteger
    serialinteger
    soa alwaysStoreZoneSOA
    template_idstring
    updated_at alwaysinteger
    usernamestring
  • 401 Unauthorized: no session, or an invalid or expired token
  • 403 Forbidden: the caller can't use this (privileges, token scope, feature turned off)
  • 404 Not Found: not-found
  • 500 Internal Server Error: internal
  • 502 Bad Gateway: dns-publish-failed

Add a record to any zone

POST/api/v1/server/dns/zones/{zid}/records

Who
root
API tokens
admin token area: server
Operation
adminAddRecord · ky call adminAddRecord

Parameters

NameIn
zidpath

Request body

FieldType
contentstring
namestring
priorityinteger
ttlinteger
typestring

Responses

  • 200 OK
  • 400 Bad Request: validation
  • 401 Unauthorized: no session, or an invalid or expired token
  • 403 Forbidden: the caller can't use this (privileges, token scope, feature turned off)
  • 404 Not Found: not-found
  • 409 Conflict: duplicate, validation
  • 500 Internal Server Error: internal
  • 502 Bad Gateway: dns-publish-failed

Delete a record from any zone

DELETE/api/v1/server/dns/zones/{zid}/records/{rid}

Who
root
API tokens
admin token area: server
Operation
adminDeleteRecord · ky call adminDeleteRecord

Parameters

NameIn
zidpath
ridpath

Responses

  • 200 OK
  • 401 Unauthorized: no session, or an invalid or expired token
  • 403 Forbidden: the caller can't use this (privileges, token scope, feature turned off)
  • 404 Not Found: not-found
  • 409 Conflict: duplicate, validation
  • 500 Internal Server Error: internal
  • 502 Bad Gateway: dns-publish-failed

Update a record in any zone

PUT/api/v1/server/dns/zones/{zid}/records/{rid}

Who
root
API tokens
admin token area: server
Operation
adminUpdateRecord · ky call adminUpdateRecord

Parameters

NameIn
zidpath
ridpath

Request body

FieldType
contentstring
namestring
priorityinteger
ttlinteger
typestring

Responses

  • 200 OK
  • 400 Bad Request: validation
  • 401 Unauthorized: no session, or an invalid or expired token
  • 403 Forbidden: the caller can't use this (privileges, token scope, feature turned off)
  • 404 Not Found: not-found
  • 409 Conflict: duplicate, validation
  • 500 Internal Server Error: internal
  • 502 Bad Gateway: dns-publish-failed

Disable or enable a record

PUT/api/v1/server/dns/zones/{zid}/records/{rid}/disabled

Who
root
API tokens
admin token area: server
Operation
adminDisableRecord · ky call adminDisableRecord

Parameters

NameIn
zidpath
ridpath

Request body

FieldType
disabledboolean

Responses

  • 200 OK
  • 401 Unauthorized: no session, or an invalid or expired token
  • 403 Forbidden: the caller can't use this (privileges, token scope, feature turned off)
  • 404 Not Found: not-found
  • 409 Conflict: duplicate, validation
  • 500 Internal Server Error: internal
  • 502 Bad Gateway: dns-publish-failed

Reset any zone to the template

POST/api/v1/server/dns/zones/{zid}/reset

Who
root
API tokens
admin token area: server
Operation
adminResetZone · ky call adminResetZone

Parameters

NameIn
zidpath

Responses

  • 200 OK
    Body
    FieldType
    recordsinteger
    zonestring
  • 401 Unauthorized: no session, or an invalid or expired token
  • 403 Forbidden: the caller can't use this (privileges, token scope, feature turned off)
  • 404 Not Found: not-found
  • 500 Internal Server Error: internal
  • 502 Bad Gateway: dns-publish-failed

Change a zone's SOA

PUT/api/v1/server/dns/zones/{zid}/soa

Who
root
API tokens
admin token area: server
Operation
adminSetSOA · ky call adminSetSOA

Parameters

NameIn
zidpath

Request body

FieldType
default_ttlinteger
expireinteger
minimuminteger
mnamestring
refreshinteger
retryinteger
rnamestring
serialinteger
ttlinteger

Responses

  • 200 OK
    Body
    FieldType
    account_idstring
    account_statusstring
    default_ttlinteger
    domain_idstring
    idstring
    namestring
    published alwaysboolean
    published_atinteger
    record_count alwaysinteger
    serialinteger
    soa alwaysStoreZoneSOA
    template_idstring
    updated_at alwaysinteger
    usernamestring
  • 400 Bad Request: validation
  • 401 Unauthorized: no session, or an invalid or expired token
  • 403 Forbidden: the caller can't use this (privileges, token scope, feature turned off)
  • 404 Not Found: not-found
  • 500 Internal Server Error: internal
  • 502 Bad Gateway: dns-publish-failed