KyPanelDocs

API reference

Import Tools

Account imports from backup files and transfers from remote servers.

List imports

GET/api/v1/imports

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

Responses

  • 200 OK
    Body
    FieldType
    itemsarray of 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)
  • 500 Internal Server Error: internal

Import a backup file on the server

POST/api/v1/imports

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

Request body

FieldType
decisionsHostingImportDecisions
pathstring
urlstring

Responses

  • 202 Accepted (runs in the background)
    Body
    FieldType
    job_idstring
    restore_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 an import and its analysis

GET/api/v1/imports/{rid}

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

Parameters

NameIn
ridpath

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)
  • 404 Not Found: not-found
  • 500 Internal Server Error: internal

Run an import

POST/api/v1/imports/{rid}/apply

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

Parameters

NameIn
ridpath

Responses

  • 202 Accepted (runs in the background)
    Body
    FieldType
    job_idstring
  • 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: conflicts, not-ready
  • 500 Internal Server Error: internal

Cancel an import

POST/api/v1/imports/{rid}/cancel

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

Parameters

NameIn
ridpath

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

Resolve an import's conflicts

PUT/api/v1/imports/{rid}/decisions

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

Parameters

NameIn
ridpath

Request body

FieldType
auto_applyboolean
ip_idstring
keep_dns_ipboolean
overwriteboolean
owner_idstring
package_idstring
skip_databasesboolean
skip_dnsboolean
skip_homeboolean
skip_mailboolean
urlstring
usernamestring

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)
  • 404 Not Found: not-found
  • 409 Conflict: busy
  • 500 Internal Server Error: internal

Import every backup in a folder

POST/api/v1/imports/batch

Queues every cPanel backup in a folder of the server; with auto_apply the ones without conflicts are applied right after their analysis.

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

Request body

FieldType
auto_applyboolean
dirstring

Responses

  • 202 Accepted (runs in the background)
    Body
    FieldType
    itemsarray of map of string
  • 400 Bad Request: file-operation, 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

Upload a backup file to import

POST/api/v1/imports/upload

Takes a cpmove file as multipart (field "file"; optional "username").

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

Responses

  • 202 Accepted (runs in the background)
    Body
    FieldType
    job_idstring
    restore_idstring
  • 400 Bad Request: invalid-body, upload, 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

List transfers from remote servers

GET/api/v1/transfers

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

Responses

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

Start a transfer from a remote server

POST/api/v1/transfers

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

Request body

FieldType
auth_methodstring
hoststring
passwordstring
portinteger
private_keystring
userstring

Responses

  • 201 Created
    Body
    FieldType
    host_keyobject
    FieldType
    sha256string
    typestring
    sessionStoreTransferSession
  • 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 transfer

GET/api/v1/transfers/{tid}

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

Parameters

NameIn
tidpath

Responses

  • 200 OK
    Body
    FieldType
    itemsarray of map of any
    sessionStoreTransferSession
  • 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

Abort a transfer

POST/api/v1/transfers/{tid}/abort

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

Parameters

NameIn
tidpath

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

Analyze the remote server's accounts

POST/api/v1/transfers/{tid}/analyze

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

Parameters

NameIn
tidpath

Responses

  • 200 OK
    Body
    FieldType
    accounts alwaysarray of HostingRemoteAccount
    at alwaysinteger
    home_free_kb alwaysinteger
    type alwaysstring
    version alwaysstring
  • 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: analysis

Trust the remote server's SSH host key

POST/api/v1/transfers/{tid}/host-key

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

Parameters

NameIn
tidpath

Request body

FieldType
sha256string

Responses

  • 200 OK
    Body
    FieldType
    host_keystring
  • 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: host-key
  • 500 Internal Server Error: internal
  • 502 Bad Gateway: unreachable

Copy the chosen accounts

POST/api/v1/transfers/{tid}/start

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

Parameters

NameIn
tidpath

Request body

FieldType
accountsarray of object

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)
  • 404 Not Found: not-found
  • 409 Conflict: not-ready
  • 500 Internal Server Error: internal