WordPress/sites
WordPress group

sites

15 operations, invoked through the wordpress_manage tool.

Lifecycle of WordPress installations on a hosting service: list, install, clone, staging, backups, upgrade, domain change, delete, one-click admin login, and task polling.

Discover before you call: list_wordpress_operations lists the groups, get_wordpress_module(module) returns one group's parameters, and wordpress_manage(module, operation, params, service_id, installation_id) runs it. Operations marked confirm need confirm: true in the same call; operations marked async return a task_id you poll with sites.operation_status.

sites.admin_login write confirm installation_id#

Get a one-time administrator login link for an installation.

Returns a short-lived, single-use URL that logs the customer into the installation's administration area without a password. Treat the link as a secret: open it once, do not store or forward it. It is never written to the activity log. Requires confirm: true.

No parameters.

Returns — inside the { ok, data, errors[], warnings[] } envelope, data is { login_url, single_use: true }.

sites.backup write async installation_id#

Take a backup of an installation.

Creates a backup of the installation's files and/or database in the account's backup storage. Long-running: returns a task_id; poll sites.operation_status, then sites.list_backups to see the new backup_id. Backups count toward the account's disk quota.

include_databasebooleanOptional
Include the database. Defaults to true.
include_filesbooleanOptional
Include the installation's files. Defaults to true.
notestringOptional
Free-text note stored with the backup. (maxLength 200)

Returns — inside the { ok, data, errors[], warnings[] } envelope, data is { task_id, status: "running", installation_id }.

sites.change_domain write confirm installation_id#

Move an installation to a new domain and/or directory.

Changes the installation's public address to new_domain (which must belong to this hosting service) and optional new_directory. Links stored in content are updated by the platform. Requires confirm: true.

new_domainstringRequired
New domain or subdomain. It must belong to this hosting service. (pattern ^[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?(\.[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?)+$)
new_directorystringOptional
New subdirectory: one to four path segments of letters, digits, '_' or '-' separated by '/', no dots. Omit for the domain root. (pattern ^[A-Za-z0-9_-]{1,63}(/[A-Za-z0-9_-]{1,63}){0,3}$)

Returns — inside the { ok, data, errors[], warnings[] } envelope, data is { changed: true, url }.

sites.clone write confirm async installation_id#

Copy an installation to a new domain or subdirectory on the same service.

Creates an independent copy of the installation (files and database) at target_domain and optional target_directory on the same hosting service. Long-running: returns a task_id; poll sites.operation_status, then sites.list to find the new installation_id. Requires confirm: true.

target_domainstringRequired
Domain or subdomain for the copy. It must belong to this hosting service. (pattern ^[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?(\.[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?)+$)
target_directorystringOptional
Subdirectory for the copy: one to four path segments of letters, digits, '_' or '-' separated by '/', no dots. Omit for the domain root. (pattern ^[A-Za-z0-9_-]{1,63}(/[A-Za-z0-9_-]{1,63}){0,3}$)

Returns — inside the { ok, data, errors[], warnings[] } envelope, data is { task_id, status: "running", installation_id }.

sites.core_upgrade write async installation_id#

Upgrade the installation's WordPress core to the latest version.

Upgrades WordPress core to the latest release available to the hosting platform. Long-running: returns a task_id; poll sites.operation_status. For a check-only view of pending updates use content.core_check_update.

No parameters.

Returns — inside the { ok, data, errors[], warnings[] } envelope, data is { task_id, status: "running", installation_id }.

sites.delete write confirm installation_id#

Permanently delete an installation.

Removes the installation's files, database and database user. Cannot be undone; take a backup first if the content may be needed. Requires confirm: true.

remove_databasebooleanOptional
Drop the database and its database user. Defaults to true.
remove_filesbooleanOptional
Delete the installation's files. Defaults to true.

Returns — inside the { ok, data, errors[], warnings[] } envelope, data is { deleted: true, installation_id }.

sites.delete_backup write confirm installation_id#

Delete one backup of an installation.

Permanently deletes the backup identified by backup_id (from list_backups). Cannot be undone. Requires confirm: true.

backup_idstringRequired
backup_id exactly as returned by list_backups (1-255 characters, no '/'). (pattern ^[^\x00-\x1f\x7f/]{1,255}$)

Returns — inside the { ok, data, errors[], warnings[] } envelope, data is { deleted: true, backup_id }.

sites.install write confirm async service_id#

Install a fresh WordPress on a domain or subdirectory of the service.

Creates a new WordPress installation on the given domain (which must belong to the hosting service) and optional subdirectory. The database name, database user and database password are generated by JetHost. If admin_password is omitted a strong password is generated and NOT returned; use the admin_login operation afterwards, or supply your own password. Long-running: returns a task_id immediately; poll sites.operation_status until status is done or failed, then call sites.list to see the new installation_id. Requires confirm: true.

admin_emailstringRequired
E-mail address of the administrator account. (maxLength 100, pattern ^[^\s@-][^\s@]{0,63}@[A-Za-z0-9.-]{1,253}$)
admin_usernamestringRequired
Username of the first administrator account. (pattern ^[A-Za-z0-9][A-Za-z0-9 _.@-]{0,59}$)
domainstringRequired
Domain or subdomain the site will be served from. It must already exist on this hosting service. (pattern ^[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?(\.[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?)+$)
site_titlestringRequired
Site title. (minLength 1, maxLength 200)
admin_passwordstringOptional
Password of the administrator account (12-128 printable ASCII characters (0x20-0x7e)). Omit to have a strong password generated; the generated password is never returned. Masked in the activity log. (minLength 12, maxLength 128, pattern ^[\x20-\x7e]{12,128}$)
auto_upgradebooleanOptional
Enable automatic core upgrades for the new installation. Defaults to false.
directorystringOptional
Subdirectory under the domain's web root, e.g. "blog" or "sites/blog": one to four path segments of letters, digits, '_' or '-' separated by '/', no dots. Omit to install at the domain root. (pattern ^[A-Za-z0-9_-]{1,63}(/[A-Za-z0-9_-]{1,63}){0,3}$)
languagestringOptional
Site language code, e.g. "en" or "bg_BG". Defaults to "en". (pattern ^[a-z]{2,3}(_[A-Z]{2})?$)
protocolstringOptional
URL scheme and www prefix of the site address. Defaults to "https".
One of: https https_www http http_www

Returns — inside the { ok, data, errors[], warnings[] } envelope, data is { task_id, status: "running" }.

sites.list read service_id#

List the WordPress installations on one hosting service.

Returns every WordPress installation on the hosting service identified by service_id, with its installation_id, domain, public URL, WordPress version, whether it is a staging copy (and of which installation), the site title and the install date. Use it first to pick the installation_id for every other operation. The server file path is never returned.

No parameters.

Returns — inside the { ok, data, errors[], warnings[] } envelope, data is { installations: [ { installation_id, label, domain, url, version, is_staging, parent_installation_id, site_title, installed_at } ], count }.

sites.list_backups read installation_id#

List the backups of an installation.

Returns the backups stored for the installation with backup_id, size, creation time, what they include and the note. backup_id is the value to pass to restore_backup and delete_backup. Downloading a backup is done from the client area, not through this tool.

No parameters.

Returns — inside the { ok, data, errors[], warnings[] } envelope, data is { backups: [ { backup_id, size_bytes, created_at, includes_files, includes_database, note } ], count }.

sites.operation_status read service_id#

Poll the status of a long-running sites operation.

Returns the current status of a task started by install, clone, staging, push_to_live, backup, restore_backup or core_upgrade on the same hosting service. status is "running", "done" or "failed"; progress is a percentage when available. For a task started on an existing installation (clone, staging, push_to_live, backup, restore_backup, core_upgrade) installation_id is required and must be the one returned with the task_id; omit installation_id only for a task started by sites.install. Poll every 5-10 seconds. A task_id that does not belong to this service returns not_found.

task_idstringRequired
task_id returned by the long-running operation. (pattern ^[0-9a-f]{32}$)

Returns — inside the { ok, data, errors[], warnings[] } envelope, data is { task_id, status: "running"|"done"|"failed", progress: integer|null, message }.

sites.push_to_live write confirm async installation_id#

Push a staging copy over its live installation.

Overwrites the live installation with the staging copy identified by installation_id. mode "full" pushes files and database, "files_only" pushes only files, "database_only" pushes only the database. The live site's current content is replaced; take a backup first. Long-running: returns a task_id; poll sites.operation_status. Requires confirm: true.

modestringOptional
What to push. Defaults to "full".
One of: full files_only database_only

Returns — inside the { ok, data, errors[], warnings[] } envelope, data is { task_id, status: "running", installation_id }.

sites.push_to_live_preview read installation_id#

Show which database tables differ between a staging copy and its live site.

For a staging installation, lists the database tables whose structure and whose data differ from the live installation it was copied from. Read-only; use it before push_to_live to decide the mode.

No parameters.

Returns — inside the { ok, data, errors[], warnings[] } envelope, data is { parent_installation_id, tables_structure_changed: [string], tables_data_changed: [string] }.

sites.restore_backup write confirm async installation_id#

Restore an installation from one of its backups.

Replaces the installation's files and/or database with the contents of the backup identified by backup_id (from list_backups). Current content is overwritten. Long-running: returns a task_id; poll sites.operation_status. Requires confirm: true.

backup_idstringRequired
backup_id exactly as returned by list_backups (1-255 characters, no '/'). (pattern ^[^\x00-\x1f\x7f/]{1,255}$)
restore_databasebooleanOptional
Restore the database. Defaults to true.
restore_filesbooleanOptional
Restore files. Defaults to true.

Returns — inside the { ok, data, errors[], warnings[] } envelope, data is { task_id, status: "running", installation_id }.

sites.staging write confirm async installation_id#

Create a staging copy of a live installation.

Creates a staging copy of the installation so changes can be tested before they reach visitors. The copy is placed under staging_domain (default: the same domain) in staging_directory (default: "staging"). A staging copy cannot itself be staged. Long-running: returns a task_id; poll sites.operation_status, then sites.list (the copy shows is_staging: true with parent_installation_id set). Requires confirm: true.

staging_directorystringOptional
Subdirectory for the staging copy: one to four path segments of letters, digits, '_' or '-' separated by '/', no dots. Defaults to "staging". (pattern ^[A-Za-z0-9_-]{1,63}(/[A-Za-z0-9_-]{1,63}){0,3}$)
staging_domainstringOptional
Domain for the staging copy. Defaults to the live installation's domain. (pattern ^[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?(\.[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?)+$)

Returns — inside the { ok, data, errors[], warnings[] } envelope, data is { task_id, status: "running", installation_id }.