API reference
Import Tools
Account imports from backup files and transfers from remote servers.
List imports
GET/api/v1/imports
Responses
- 200 OK
Body
Field Type 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
Request body
| Field | Type |
|---|---|
decisions | HostingImportDecisions |
path | string |
url | string |
Responses
- 202 Accepted (runs in the background)
Body
Field Type 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}
Parameters
| Name | In |
|---|---|
rid | path |
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
Parameters
| Name | In |
|---|---|
rid | path |
Responses
- 202 Accepted (runs in the background)
Body
Field Type 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
Parameters
| Name | In |
|---|---|
rid | path |
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
Parameters
| Name | In |
|---|---|
rid | path |
Request body
| Field | Type |
|---|---|
auto_apply | boolean |
ip_id | string |
keep_dns_ip | boolean |
overwrite | boolean |
owner_id | string |
package_id | string |
skip_databases | boolean |
skip_dns | boolean |
skip_home | boolean |
skip_mail | boolean |
url | string |
username | string |
Responses
- 202 Accepted (runs in the background)
Body
Field Type 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.
Request body
| Field | Type |
|---|---|
auto_apply | boolean |
dir | string |
Responses
- 202 Accepted (runs in the background)
Body
Field Type 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").
Responses
- 202 Accepted (runs in the background)
Body
Field Type 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
Responses
- 200 OK
Body
Field Type 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
Request body
| Field | Type |
|---|---|
auth_method | string |
host | string |
password | string |
port | integer |
private_key | string |
user | string |
Responses
- 201 Created
Body
Field Type host_keyobject Field Type 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}
Parameters
| Name | In |
|---|---|
tid | path |
Responses
- 200 OK
Body
Field Type 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
Parameters
| Name | In |
|---|---|
tid | path |
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
Parameters
| Name | In |
|---|---|
tid | path |
Responses
- 200 OK
Body
Field Type accountsalwaysarray of HostingRemoteAccount atalwaysinteger home_free_kbalwaysinteger typealwaysstring versionalwaysstring - 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
Parameters
| Name | In |
|---|---|
tid | path |
Request body
| Field | Type |
|---|---|
sha256 | string |
Responses
- 200 OK
Body
Field Type 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
Parameters
| Name | In |
|---|---|
tid | path |
Request body
| Field | Type |
|---|---|
accounts | array of object |
Responses
- 202 Accepted (runs in the background)
Body
Field Type 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