KyPanelDocs

API reference

Databases

MariaDB/MySQL databases, users, privileges, remote hosts, phpMyAdmin.

Databases, users and privileges

GET/api/v1/accounts/{id}/mysql

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

Parameters

NameIn
idpath
refreshquery

Responses

  • 200 OK
    Body
    FieldType
    databasesarray of StoreDatabase
    hoststring
    limitinteger
    max_name_lengthinteger
    max_user_lengthinteger
    prefixstring
    privilegesarray of string
    remoteboolean
    used_bytesinteger
    usersarray of StoreDBUser
  • 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

Create a database

POST/api/v1/accounts/{id}/mysql/databases

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

Parameters

NameIn
idpath

Request body

FieldType
namestring

Responses

  • 201 Created
    Body
    FieldType
    account_id alwaysstring
    created_at alwaysinteger
    id alwaysstring
    name alwaysstring
    size_bytes alwaysinteger
    size_updated_atinteger
    users alwaysarray of StoreDatabaseGrant
  • 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
  • 409 Conflict: limit-reached, validation
  • 500 Internal Server Error: internal

Delete a database

DELETE/api/v1/accounts/{id}/mysql/databases/{did}

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

Parameters

NameIn
idpath
didpath
confirmquery

Responses

  • 204 Done, no content
  • 400 Bad Request: confirmation-required, 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
  • 500 Internal Server Error: internal

List remote database hosts

GET/api/v1/accounts/{id}/mysql/remote-hosts

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

Parameters

NameIn
idpath

Responses

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

Allow a remote database host

POST/api/v1/accounts/{id}/mysql/remote-hosts

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

Parameters

NameIn
idpath

Request body

FieldType
commentstring
hoststring

Responses

  • 201 Created
    Body
    FieldType
    comment alwaysstring
    created_at alwaysinteger
    host alwaysstring
    id alwaysstring
  • 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
  • 409 Conflict: limit-reached, validation
  • 500 Internal Server Error: internal

Remove a remote database host

DELETE/api/v1/accounts/{id}/mysql/remote-hosts/{hid}

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

Parameters

NameIn
idpath
hidpath

Responses

  • 204 Done, no content
  • 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
  • 500 Internal Server Error: internal

Create a database user

POST/api/v1/accounts/{id}/mysql/users

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

Parameters

NameIn
idpath

Request body

FieldType
namestring
passwordstring

Responses

  • 201 Created
    Body
    FieldType
    account_id alwaysstring
    auth_plugin alwaysstring
    created_at alwaysinteger
    grants alwaysarray of StoreDatabaseGrant
    id alwaysstring
    name alwaysstring
    updated_at alwaysinteger
  • 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
  • 409 Conflict: validation
  • 500 Internal Server Error: internal

Delete a database user

DELETE/api/v1/accounts/{id}/mysql/users/{uid}

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

Parameters

NameIn
idpath
uidpath

Responses

  • 204 Done, no content
  • 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
  • 500 Internal Server Error: internal

Remove a user's privileges on a database

DELETE/api/v1/accounts/{id}/mysql/users/{uid}/grants/{did}

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

Parameters

NameIn
idpath
uidpath
didpath

Responses

  • 204 Done, no content
  • 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
  • 500 Internal Server Error: internal

Set a user's privileges on a database

PUT/api/v1/accounts/{id}/mysql/users/{uid}/grants/{did}

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

Parameters

NameIn
idpath
uidpath
didpath

Request body

FieldType
privilegesarray of string

Responses

  • 200 OK
    Body
    FieldType
    account_id alwaysstring
    auth_plugin alwaysstring
    created_at alwaysinteger
    grants alwaysarray of StoreDatabaseGrant
    id alwaysstring
    name alwaysstring
    updated_at alwaysinteger
  • 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

Rename a database user

PUT/api/v1/accounts/{id}/mysql/users/{uid}/name

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

Parameters

NameIn
idpath
uidpath

Request body

FieldType
namestring

Responses

  • 200 OK
    Body
    FieldType
    account_id alwaysstring
    auth_plugin alwaysstring
    created_at alwaysinteger
    grants alwaysarray of StoreDatabaseGrant
    id alwaysstring
    name alwaysstring
    updated_at alwaysinteger
  • 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
  • 409 Conflict: validation
  • 500 Internal Server Error: internal

Change a database user's password

PUT/api/v1/accounts/{id}/mysql/users/{uid}/password

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

Parameters

NameIn
idpath
uidpath

Request body

FieldType
passwordstring

Responses

  • 204 Done, no content
  • 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

Create a database, a user and its privileges in one step

POST/api/v1/accounts/{id}/mysql/wizard

Creates a database, a user and the user's privileges on it in one step. Each part is undone if a later one fails, so the customer never ends up with half of it.

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

Parameters

NameIn
idpath

Request body

FieldType
databasestring
passwordstring
privilegesarray of string
userstring

Responses

  • 201 Created
    Body
    FieldType
    databaseStoreDatabase
    userStoreDBUser
  • 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
  • 409 Conflict: limit-reached, validation
  • 500 Internal Server Error: internal

Open phpMyAdmin signed in

POST/api/v1/accounts/{id}/phpmyadmin

Creates a direct sign-in link to phpMyAdmin (single use, 60 s).

Who
root, reseller (ACL: create-user-session); customer
API tokens
API tokens can't use this endpoint
Operation
phpMyAdminSSO · ky call phpMyAdminSSO

Parameters

NameIn
idpath

Responses

  • 200 OK
    Body
    FieldType
    expires_instring
    urlstring
  • 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-inactive
  • 500 Internal Server Error: internal