KyPanelDocs

API reference

PHP

Installed PHP versions, extensions and global settings.

PHP settings that can be changed per domain

GET/api/v1/php/ini-directives

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

Responses

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

Installed PHP versions

GET/api/v1/php/versions

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

Responses

  • 200 OK
    Body
    FieldType
    defaultstring
    versionsarray 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

PHP versions and the default

GET/api/v1/server/php

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

Responses

  • 200 OK
    Body
    FieldType
    defaultstring
    directivesarray of WebDirective
    versionsarray of VerRow
  • 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 a PHP version's extensions

GET/api/v1/server/php/{ver}/extensions

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

Parameters

NameIn
verpath
availablequery

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

Install or remove a PHP extension

POST/api/v1/server/php/{ver}/extensions

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

Parameters

NameIn
verpath

Request body

FieldType
actionstring
extensionstring

Responses

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

Get a PHP version's global settings

GET/api/v1/server/php/{ver}/ini

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

Parameters

NameIn
verpath

Responses

  • 200 OK
    Body
    FieldType
    directivesarray of WebDirective
    valuesmap of string
    versionstring
  • 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 PHP version's global settings

PUT/api/v1/server/php/{ver}/ini

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

Parameters

NameIn
verpath

Request body

FieldType
valuesmap of string

Responses

  • 200 OK
    Body
    FieldType
    valuesmap of string
    versionstring
  • 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)
  • 404 Not Found: not-found
  • 500 Internal Server Error: internal

Set the default PHP version

PUT/api/v1/server/php/default

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

Request body

FieldType
versionstring

Responses

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

PHP version of every domain

GET/api/v1/server/php/domains

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

Responses

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

Set the PHP version of many domains

POST/api/v1/server/php/domains

Sets one PHP version ("" = inherit the default) on many domains at once.

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

Request body

FieldType
domain_idsarray of string
versionstring

Responses

  • 202 Accepted (runs in the background)
    Body
    FieldType
    changedinteger
    job_idsarray of string
  • 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