API reference
Domains
Main, addon, subdomain and alias domains; document roots, PHP version and settings, redirects, error pages.
#List domains
GET/api/v1/accounts/{id}/domains
- Who
- root, reseller (ACL: create-user-session); customer
- API tokens
- admin token area: accounts; account token area: domains
- Operation
listDomains · ky call listDomains
Parameters
Responses
- 200 OK
Body
| Field | Type |
|---|
home_dir | string |
items | array of DomainView |
limits | object |
- 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 domain (addon, subdomain or alias)
POST/api/v1/accounts/{id}/domains
- Who
- root, reseller (ACL: create-user-session); customer
- API tokens
- admin token area: accounts; account token area: domains
- Feature
domains- Operation
createDomain · ky call createDomain
Parameters
Request body
| Field | Type |
|---|
docroot | string |
label | string |
name | string |
parent_id | string |
type | string |
Responses
- 202 Accepted (runs in the background)
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)
- 404 Not Found: not-found
- 409 Conflict: account-not-active, limit-reached, validation
- 500 Internal Server Error: internal
#Remove a domain
DELETE/api/v1/accounts/{id}/domains/{did}
- Who
- root, reseller (ACL: create-user-session); customer
- API tokens
- admin token area: accounts; account token area: domains
- Feature
domains- Operation
deleteDomain · ky call deleteDomain
Parameters
| Name | In |
|---|
id | path |
did | path |
confirm | query |
remove_files | query |
Responses
- 202 Accepted (runs in the background)
Body
- 400 Bad Request: confirmation-required
- 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: already-removing, has-subdomains, main-domain, still-provisioning
- 500 Internal Server Error: internal
#Get a domain
GET/api/v1/accounts/{id}/domains/{did}
- Who
- root, reseller (ACL: create-user-session); customer
- API tokens
- admin token area: accounts; account token area: domains
- Operation
getDomain · ky call getDomain
Parameters
Responses
- 200 OK
Body
| Field | Type |
|---|
docroot | string |
force_https | boolean |
id | string |
name | string |
parent_id | string |
parent_name | string |
php_ini_count always | integer |
php_version | string |
redirect_count always | integer |
redirect_to | string |
ssl | DomainSSLView |
status | string |
subdomains always | integer |
type | 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
#Include or exclude a domain from AutoSSL
PUT/api/v1/accounts/{id}/domains/{did}/autossl
- Who
- root, reseller (ACL: ssl or create-user-session); customer
- API tokens
- admin token area: accounts; account token area: ssl
- Feature
ssl_status- Operation
sslAutoSSLExclude · ky call sslAutoSSLExclude
Parameters
Request body
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
#Change a domain's document root
PUT/api/v1/accounts/{id}/domains/{did}/docroot
- Who
- root, reseller (ACL: create-user-session); customer
- API tokens
- admin token area: accounts; account token area: domains
- Feature
domains- Operation
setDocroot · ky call setDocroot
Parameters
Request body
Responses
- 202 Accepted (runs in the background)
Body
| Field | Type |
|---|
docroot | string |
job_id | 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
- 409 Conflict: alias, already-removing
- 500 Internal Server Error: internal
#Turn HTTPS redirection on or off
PUT/api/v1/accounts/{id}/domains/{did}/force-https
- Who
- root, reseller (ACL: ssl or create-user-session); customer
- API tokens
- admin token area: accounts; account token area: domains
- Feature
domains- Operation
setForceHTTPS · ky call setForceHTTPS
Parameters
Request body
Responses
- 202 Accepted (runs in the background)
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
- 409 Conflict: no-certificate
- 500 Internal Server Error: internal
#Change a domain's PHP version
PUT/api/v1/accounts/{id}/domains/{did}/php
- Who
- root, reseller (ACL: create-user-session); customer
- API tokens
- admin token area: accounts; account token area: domains
- Feature
php_version- Operation
setDomainPHP · ky call setDomainPHP
Parameters
Request body
Responses
- 202 Accepted (runs in the background)
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)
- 404 Not Found: not-found
- 500 Internal Server Error: internal
#Get a domain's PHP settings
GET/api/v1/accounts/{id}/domains/{did}/php-ini
- Who
- root, reseller (ACL: create-user-session); customer
- API tokens
- admin token area: accounts; account token area: domains
- Feature
php_ini- Operation
getPHPIni · ky call getPHPIni
Parameters
Responses
- 200 OK
Body
| Field | Type |
|---|
directives | array of WebDirective |
domain | string |
domain_id | string |
php_version | string |
values | map 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)
- 404 Not Found: not-found
- 409 Conflict: alias
- 500 Internal Server Error: internal
#Save a domain's PHP settings
PUT/api/v1/accounts/{id}/domains/{did}/php-ini
- Who
- root, reseller (ACL: create-user-session); customer
- API tokens
- admin token area: accounts; account token area: domains
- Feature
php_ini- Operation
setPHPIni · ky call setPHPIni
Parameters
Request body
| Field | Type |
|---|
values | map of string |
Responses
- 202 Accepted (runs in the background)
Body
| Field | Type |
|---|
job_id | string |
values | map of 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
- 409 Conflict: alias
- 500 Internal Server Error: internal
#List custom error pages
GET/api/v1/accounts/{id}/error-pages
- Who
- root, reseller (ACL: create-user-session); customer
- API tokens
- admin token area: accounts; account token area: error-pages
- Feature
error_pages- Operation
errorPagesList · ky call errorPagesList
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
#Save a custom error page
PUT/api/v1/accounts/{id}/error-pages/{did}/{code}
- Who
- root, reseller (ACL: create-user-session); customer
- API tokens
- admin token area: accounts; account token area: error-pages
- Feature
error_pages- Operation
errorPageSave · ky call errorPageSave
Parameters
| Name | In |
|---|
id | path |
did | path |
code | path |
Request body
Responses
- 202 Accepted (runs in the background)
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)
- 404 Not Found: not-found
- 500 Internal Server Error: internal
#List redirects
GET/api/v1/accounts/{id}/redirects
- Who
- root, reseller (ACL: create-user-session); customer
- API tokens
- admin token area: accounts; account token area: domains
- Feature
redirects- Operation
listRedirects · ky call listRedirects
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 redirect
POST/api/v1/accounts/{id}/redirects
- Who
- root, reseller (ACL: create-user-session); customer
- API tokens
- admin token area: accounts; account token area: domains
- Feature
redirects- Operation
createRedirect · ky call createRedirect
Parameters
Request body
| Field | Type |
|---|
code | integer |
domain_id | string |
path | string |
target_url | string |
wildcard | boolean |
www_mode | 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: validation
- 500 Internal Server Error: internal
#Delete a redirect
DELETE/api/v1/accounts/{id}/redirects/{rid}
- Who
- root, reseller (ACL: create-user-session); customer
- API tokens
- admin token area: accounts; account token area: domains
- Feature
redirects- Operation
deleteRedirect · ky call deleteRedirect
Parameters
Responses
- 202 Accepted (runs in the background)
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
#Update a redirect
PUT/api/v1/accounts/{id}/redirects/{rid}
- Who
- root, reseller (ACL: create-user-session); customer
- API tokens
- admin token area: accounts; account token area: domains
- Feature
redirects- Operation
updateRedirect · ky call updateRedirect
Parameters
Request body
| Field | Type |
|---|
code | integer |
domain_id | string |
path | string |
target_url | string |
wildcard | boolean |
www_mode | 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: validation
- 500 Internal Server Error: internal
#Directory indexes, hotlink protection and IP blocks
GET/api/v1/accounts/{id}/web-options
- Who
- root, reseller (ACL: create-user-session); customer
- API tokens
- admin token area: accounts; account token area: web-options
- Operation
webOptionsGet · ky call webOptionsGet
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
#List the server's domains by type
GET/api/v1/server/domains
List Subdomains (?type=sub) and List Parked Domains (?type=alias), or addon domains.
- Who
- root, reseller (ACL: list-accts)
- API tokens
- admin token area: server
- Operation
serverDomains · ky call serverDomains
Parameters
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