KyPanelDocs

API reference

Security

Brute force protection, allow and block lists, firewall, security policies, hotlink protection.

Save hotlink protection

PUT/api/v1/accounts/{id}/hotlink

Who
root, reseller (ACL: create-user-session); customer
API tokens
admin token area: accounts; account token area: hotlink
Feature
hotlink
Operation
hotlinkSave · ky call hotlinkSave

Parameters

NameIn
idpath

Request body

FieldType
allow_directboolean
allowedarray of string
enabledboolean
extensionsarray of string
redirectstring

Responses

  • 202 Accepted (runs in the background)
    Body
    FieldType
    job_idstring
    optionsStoreWebOptions
  • 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

Unblock an IP address from the account's sites

DELETE/api/v1/accounts/{id}/ip-blocks

Who
root, reseller (ACL: create-user-session); customer
API tokens
admin token area: accounts; account token area: ip-blocks
Feature
ip_blocker
Operation
ipBlockRemove · ky call ipBlockRemove

Parameters

NameIn
idpath
entryquery

Responses

  • 202 Accepted (runs in the background)
    Body
    FieldType
    job_idstring
    optionsStoreWebOptions
  • 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

Block an IP address from the account's sites

POST/api/v1/accounts/{id}/ip-blocks

Who
root, reseller (ACL: create-user-session); customer
API tokens
admin token area: accounts; account token area: ip-blocks
Feature
ip_blocker
Operation
ipBlockAdd · ky call ipBlockAdd

Parameters

NameIn
idpath

Request body

FieldType
entrystring

Responses

  • 202 Accepted (runs in the background)
    Body
    FieldType
    job_idstring
    optionsStoreWebOptions
  • 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

Minimum password strength

GET/api/v1/password-policy

Tells password forms the minimum strength per kind of password (not secret: it is enforced anyway).

Who
public
API tokens
not needed
Operation
passwordPolicy · ky call passwordPolicy

Responses

  • 200 OK
    Body
    FieldType
    min_lengthinteger
    minimumsmap of integer

Two-factor authentication overview

GET/api/v1/security/2fa

Who
root
API tokens
API tokens can't use this endpoint
Operation
twoFAOverview · ky call twoFAOverview

Responses

  • 200 OK
    Body
    FieldType
    adminsarray of StoreAdminTwoFactor
    customersobject
    FieldType
    totalinteger
    with_2fainteger
    issuerstring
    issuer_effectivestring
    mestring
    require_2fa_adminsboolean
    require_2fa_customersboolean
  • 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

Turn off an admin's two-factor authentication

DELETE/api/v1/security/2fa/admins/{id}

Who
root
API tokens
API tokens can't use this endpoint
Operation
twoFAResetAdmin · ky call twoFAResetAdmin

Parameters

NameIn
idpath

Responses

  • 204 Done, no content
  • 401 Unauthorized: no session, or an invalid or expired token
  • 403 Forbidden: root-only
  • 404 Not Found: not-found
  • 409 Conflict: self
  • 500 Internal Server Error: internal

List blocked addresses

GET/api/v1/security/blocks

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

Responses

  • 200 OK
    Body
    FieldType
    itemsarray of BlockView
  • 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

Block an address

POST/api/v1/security/blocks

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

Request body

FieldType
hoursinteger
ipstring
reasonstring

Responses

  • 200 OK
    Body
    FieldType
    itemsarray of BlockView
  • 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

Unblock an address

DELETE/api/v1/security/blocks/{id}

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

Parameters

NameIn
idpath

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

Get the brute force protection settings

GET/api/v1/security/brute-force

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

Responses

  • 200 OK
    Body
    FieldType
    geomap of any
    my_countrystring
    my_ipstring
    my_ip_trustedboolean
    settingsmap of any
    statsobject
    FieldType
    failures_24hinteger
    ip_blocksinteger
    user_locksinteger
  • 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

Save the brute force protection settings

PUT/api/v1/security/brute-force

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

Request body

map of any

Responses

  • 200 OK
    Body
    FieldType
    geomap of any
    my_countrystring
    my_ipstring
    my_ip_trustedboolean
    settingsmap of any
    statsobject
    FieldType
    failures_24hinteger
    ip_blocksinteger
    user_locksinteger
  • 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

Update the country database

POST/api/v1/security/geo/update

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

Responses

  • 200 OK
    Body

    map of any

  • 401 Unauthorized: no session, or an invalid or expired token
  • 403 Forbidden: the caller can't use this (privileges, token scope, feature turned off)
  • 502 Bad Gateway: geo-download

Brute force history

GET/api/v1/security/history

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

Parameters

NameIn
allquery
limitquery
qquery

Responses

  • 200 OK
    Body
    FieldType
    attemptsarray of StoreLoginAttempt
    eventsarray of StoreBFEvent
  • 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 allowed and blocked addresses and countries

GET/api/v1/security/lists

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

Parameters

NameIn
listquery

Responses

  • 200 OK
    Body
    FieldType
    itemsarray of StoreBFRecord
    my_countrystring
    my_ipstring
  • 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 to the allow or block list

POST/api/v1/security/lists

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

Request body

FieldType
liststring
reasonstring
valuestring

Responses

  • 201 Created
    Body
    FieldType
    created_at alwaysinteger
    created_by alwaysstring
    expires_atinteger
    id alwaysstring
    kind alwaysstring
    list alwaysstring
    reasonstring
    value alwaysstring
  • 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

Remove from the allow or block list

DELETE/api/v1/security/lists/{id}

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

Parameters

NameIn
idpath

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: lockout
  • 500 Internal Server Error: internal

Get the security policies

GET/api/v1/security/policies

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

Responses

  • 200 OK
    Body
    FieldType
    my_ipstring
    password_featuresarray of SettingsOption
    policiesPoliciesView
  • 401 Unauthorized: no session, or an invalid or expired token
  • 403 Forbidden: the caller can't use this (privileges, token scope, feature turned off)

Save the security policies

PUT/api/v1/security/policies

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

Request body

FieldType
admin_allowed_ipsarray of string
admin_password_max_age_daysinteger
my_ipstring
password_strengthmap of integer
require_2fa_adminsboolean
require_2fa_customersboolean
smtp_restrictionboolean

Responses

  • 200 OK
    Body
    FieldType
    my_ipstring
    password_featuresarray of SettingsOption
    policiesPoliciesView
  • 400 Bad Request: rejected, 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

Firewall status and open ports

GET/api/v1/server/firewall

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

Parameters

NameIn
serverquery

Responses

  • 200 OK
    Body

    map of any

  • 400 Bad Request: rejected
  • 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

Open or close firewall ports

PUT/api/v1/server/firewall/ports

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

Parameters

NameIn
serverquery

Request body

FieldType
openboolean
portinteger
protocolstring

Responses

  • 200 OK
    Body

    map of any

  • 400 Bad Request: rejected
  • 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 firewall rules

GET/api/v1/server/firewall/rules

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

Responses

  • 200 OK
    Body
    FieldType
    kernelmap of any
    listsmap of integer
    my_ipstring
    rulesarray of FwRuleView
    smtp_restrictionboolean
  • 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 a firewall rule

POST/api/v1/server/firewall/rules

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

Request body

FieldType
actionstring
commentstring
portsstring
protocolstring
sourcestring

Responses

  • 201 Created
    Body
    FieldType
    action alwaysstring
    commentstring
    created_atinteger
    enabledboolean
    idstring
    portsstring
    positioninteger
    protocolstring
    sourcestring
  • 400 Bad Request: rejected, 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

Delete a firewall rule

DELETE/api/v1/server/firewall/rules/{id}

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

Parameters

NameIn
idpath

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: lockout
  • 500 Internal Server Error: internal

Update a firewall rule

PATCH/api/v1/server/firewall/rules/{id}

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

Parameters

NameIn
idpath

Request body

FieldType
enabledboolean

Responses

  • 200 OK
    Body
    FieldType
    action alwaysstring
    commentstring
    created_atinteger
    enabledboolean
    idstring
    portsstring
    positioninteger
    protocolstring
    sourcestring
  • 400 Bad Request: rejected
  • 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: lockout
  • 500 Internal Server Error: internal