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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
Returns — inside the { ok, data, errors[], warnings[] } envelope, data is { task_id, status: "running", installation_id }.