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
Responses
- 200 OK
Body
- 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
Responses
- 200 OK
Body
- 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
Request body
| Field | Type |
|---|
content | string |
name | string |
priority | integer |
ttl | integer |
type | string |
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
| Name | In |
|---|
id | path |
zid | path |
rid | path |
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
| Name | In |
|---|
id | path |
zid | path |
rid | path |
Request body
| Field | Type |
|---|
content | string |
name | string |
priority | integer |
ttl | integer |
type | string |
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
| Name | In |
|---|
id | path |
zid | path |
rid | path |
Request body
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
Responses
- 200 OK
Body
| Field | Type |
|---|
records | integer |
zone | 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)
- 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
Responses
- 200 OK
Body
- 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
Responses
- 200 OK
Body
| Field | Type |
|---|
hostname | string |
ip | string |
zone | string |
- 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
- 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
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
Request body
Responses
- 200 OK
Body
| Field | Type |
|---|
body always | string |
builtin always | boolean |
id always | string |
name always | string |
updated_at always | integer |
- 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
Responses
- 200 OK
Body
| Field | Type |
|---|
body always | string |
builtin always | boolean |
id always | string |
name always | string |
updated_at always | integer |
- 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
| Field | Type |
|---|
dns_enabled | boolean |
hostname | string |
hostname_zone | string |
items | array of StoreZoneInfo |
main_ip | string |
nameservers | array 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
| Field | Type |
|---|
account_id | string |
ip | string |
name | string |
template | string |
Responses
- 201 Created
Body
| Field | Type |
|---|
account_id | string |
account_status | string |
default_ttl | integer |
domain_id | string |
id | string |
name | string |
published always | boolean |
published_at | integer |
record_count always | integer |
serial | integer |
soa always | StoreZoneSOA |
template_id | string |
updated_at always | integer |
username | string |
- 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
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
Responses
- 200 OK
Body
- 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
| Name | In |
|---|
zid | path |
download | query |
Responses
- 200 OK
Body
| Field | Type |
|---|
text | string |
zone | 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)
- 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
Request body
| Field | Type |
|---|
dry_run | boolean |
text | string |
Responses
- 200 OK
Body
| Field | Type |
|---|
dry_run always | boolean |
records always | integer |
soa_imported always | boolean |
- 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
Responses
- 200 OK
Body
| Field | Type |
|---|
account_id | string |
account_status | string |
default_ttl | integer |
domain_id | string |
id | string |
name | string |
published always | boolean |
published_at | integer |
record_count always | integer |
serial | integer |
soa always | StoreZoneSOA |
template_id | string |
updated_at always | integer |
username | 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)
- 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
Request body
| Field | Type |
|---|
content | string |
name | string |
priority | integer |
ttl | integer |
type | string |
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
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
Request body
| Field | Type |
|---|
content | string |
name | string |
priority | integer |
ttl | integer |
type | string |
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
Request body
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
Responses
- 200 OK
Body
| Field | Type |
|---|
records | integer |
zone | 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)
- 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
Request body
| Field | Type |
|---|
default_ttl | integer |
expire | integer |
minimum | integer |
mname | string |
refresh | integer |
retry | integer |
rname | string |
serial | integer |
ttl | integer |
Responses
- 200 OK
Body
| Field | Type |
|---|
account_id | string |
account_status | string |
default_ttl | integer |
domain_id | string |
id | string |
name | string |
published always | boolean |
published_at | integer |
record_count always | integer |
serial | integer |
soa always | StoreZoneSOA |
template_id | string |
updated_at always | integer |
username | string |
- 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