Skip to content
  • Solutions
    By Role
    • For Developers
    • For Content Managers
    • For Agencies
    • For IT Admins
    • For Web Hosters
    • For Developers
    • For Content Managers
    • For Agencies
    • For IT Admins
    • For Web Hosters
    By Infrastructure
    • Overview
    • AWS
    • Microsoft Azure
    • Alibaba Cloud
    • Google Cloud Platform
    • Vultr
    • Overview
    • AWS
    • Microsoft Azure
    • Alibaba Cloud
    • Google Cloud Platform
    • Vultr
    • Digital Ocean
    • Linode
    • Upcloud
    • Oracle
    • OVH
    • Digital Ocean
    • Linode
    • Upcloud
    • Oracle
    • OVH
  • Product
    • Plesk Features
    • Plesk Editions
    • What’s new
    • Pricing
    • Roadmap
    • Lifecycle Policy
    • Extensions Catalogue
  • Pricing
  • Extensions
    Featured Extensions
    • SocialBee
    • WP Toolkit
    • Sitejet Builder for Plesk
    • SEO Toolkit
    • Joomla! Toolkit
    • Premium Email
    • Email Security
    • SocialBee
    • WP Toolkit
    • Sitejet Builder for Plesk
    • SEO Toolkit
    • Joomla! Toolkit
    • Premium Email
    • Email Security
    Bundles and packs:
    • Business and Collaboration Edition
    • WP pack
    • Hosting pack
    • Power pack
    • Language pack
    • Business and Collaboration Edition
    • WP pack
    • Hosting pack
    • Power pack
    • Language pack

    See all Extensions

  • For Partners
    • Plesk Contributor Program
    • Plesk Partner Program
    • Affiliate program
    • Plesk University
  • Help Center
    • Documentation
    • Professional Services
    • Support
    • Contact Us
    • Wiki
    • Forum
  • Plesk 360 login
  • Free Trial
  • Pricing
  • Solutions
    • By Role
      • For Developers
      • For Content Managers
      • For Agencies
      • For IT Admins
      • For Web Hosters
    • By Infrastructure
      • Overview
      • Plesk on Amazon Web Services (AWS & Lightsail)
      • Microsoft Azure
      • Alibaba Cloud
      • Google Cloud Platform
      • Vultr
      • DigitalOcean
      • Linode
      • UpCloud
      • Oracle
      • OVH
  • Products
  • Pricing
  • Extensions
    • Featured Extensions
      • SocialBee
      • WP Toolkit
      • Sitejet Builder for Plesk
      • SEO Toolkit
      • Joomla! Toolkit
      • Premium Email
      • Email Security
    • Bundles and packs:
      • Business and Collaboration Edition
      • WP pack
      • Hosting pack
      • Power pack
      • Language pack
      • See all Extensions
  • For Partners
    • Plesk Contributor Program
    • Plesk Partner Program
    • Affiliate Program
    • Plesk University
  • Help Center
    • Documentation
    • Professional Services
    • Support
    • Contact Us
    • Wiki
    • Forum
  • Plesk 360 login
  • Free Trial
  • Pricing
  • Solutions
    • By Role
      • For Developers
      • For Content Managers
      • For Agencies
      • For IT Admins
      • For Web Hosters
    • By Infrastructure
      • Overview
      • Plesk on Amazon Web Services (AWS & Lightsail)
      • Microsoft Azure
      • Alibaba Cloud
      • Google Cloud Platform
      • Vultr
      • DigitalOcean
      • Linode
      • UpCloud
      • Oracle
      • OVH
  • Products
  • Pricing
  • Extensions
    • Featured Extensions
      • SocialBee
      • WP Toolkit
      • Sitejet Builder for Plesk
      • SEO Toolkit
      • Joomla! Toolkit
      • Premium Email
      • Email Security
    • Bundles and packs:
      • Business and Collaboration Edition
      • WP pack
      • Hosting pack
      • Power pack
      • Language pack
      • See all Extensions
  • For Partners
    • Plesk Contributor Program
    • Plesk Partner Program
    • Affiliate Program
    • Plesk University
  • Help Center
    • Documentation
    • Professional Services
    • Support
    • Contact Us
    • Wiki
    • Forum
  • Plesk 360 login
  • Free Trial
Plesk 360 login
Free Trial

Knowledge Base

How to manage WordPress instances (WordPress installation, theme management) over API

 
applications extensionscliemailhttpsmail

Question

How to manage WordPress instances (installation, theme management) over API?

Answer

For that, REST API can be used. To get the list of all possible operations with WP Toolkit, run this command on a Plesk server:

# plesk bin extension --call wp-toolkit

 

Examples

  1. Create a secret key:

    # curl -iku admin:password -X POST -H 'Content-Type: application/json' -d'{}' https://plesk.example.com:8443/api/v2/auth/keys
    {
    "key": "c39cc4dd-b291-b64b-9b09-aad0bec0ffee"
    }

  1. Use the secret key and CLI endpoint to manage instances:
  • Install WordPress on example.net:

    # curl -ikX POST -H 'Content-Type: application/json' -H "X-API-Key: c39cc4dd-b291-b64b-909-aad0bec0ffee" -d'{ "params": ["--call", "wp-toolkit", "--install", "-domain-name", "example.net"] }' https://127.0.0.1:8443/api/v2/cli/extension/call

  • Install a theme on instance, e.g. instance 8:

    # curl -ikX POST -H 'Content-Type: application/json' -H "X-API-Key: c39cc4dd-b291-b64b-9b09-aad0bec0ffee" -d'{ "params": ["--call", "wp-toolkit", "--wp-cli", "-instance-id", "8", "--", "theme", "install", "https://downloads.wordpress.org/theme/corporatecorner.1.0.6.zip"] }' https://127.0.0.1:8443/api/v2/cli/extension/call

  • Activate a theme on instance, e.g. instance 8:

    # curl -ikX POST -H 'Content-Type: application/json' -H "X-API-Key: c39cc4dd-b291-b64b-9b09-aad0bec0ffee" -d'{ "params": ["--call", "wp-toolkit", "--wp-cli", "-instance-id", "8", "--", "theme", "activate", "corporatecorner"] }' https://127.0.0.1:8443/api/v2/cli/extension/call

  • To pass the variable to the REST API call use the env option as in the example below (e.g. install wordpress on test.com with credentials [email protected]/new_password):

    # curl -ikX POST -H 'Content-Type: application/json' -H "X-API-Key: c39cc4dd-b291-b64b-9b09-aad0bec0ffee" -d'{ "params": ["--call", "wp-toolkit", "--install", "-domain-name", "test.com", "-admin-email", "[email protected]"], "env": { "ADMIN_PASSWORD": "new_password" } }' https://127.0.0.1:8443/api/v2/cli/extension/call

 

Tweet
Share
Share
Email
0 Shares
Read the full article
Related Posts

Advanced Techniques for Building an Email List

Read More »

SSL Certificates and Web Security – A Guide

Read More »

Next Level Ops Podcast: Working with Self-hosting Email with Christian Mollekopf

Read More »
Knowledge Base

WP Toolkit Cloning hangs or stops after 60 seconds on a Plesk server

Read More »

Duplicate entries in Plesk WP Toolkit: nginx: [emerg] duplicate location “/fake-hotlink-stub”

Read More »

Can’t install plugin via WP Toolkit: destination folder already exists

Read More »

Unable to log in to a WordPress dashboard via Plesk: The “Log in” button is missing in WP Toolkit

Read More »

Hosting Wiki

  • RESTful Web Service
  • CLI
  • Server Redundancy
  • QMAIL
  • Sendmail
  • AMP
  • Bare Metal Server
  • Oracle VM Server
  • Server Virtualization Software
  • Windows Server
  • Linux
  • Joomla! Toolkit
  • WP Toolkit
  • WordPress
  • Plesk
  • Web Server
  • DNS Server
  • Email Autoresponder
  • Mailing Lists
  • Email Alias
  • Email Virus Protection
  • Email Forwarding
  • Webmail
  • HTTP
X-twitter Linkedin Youtube Reddit Github
  • Product
  • Login
  • Pricing
  • Editions
  • For Partners
  • Partner Program
  • Contributor Program
  • Affiliate Program
  • Plesk University
  • Company
  • Blog
  • Careers
  • Events
  • About Plesk
  • Our Brand
  • Resources
  • User and Admin guides
  • Help Center
  • Migrate to Plesk
  • Contact Us
  • Hosting Wiki
  • Forum
  • Legal
  • Legal
  • Privacy Policy
  • Imprint

© 2025 WebPros International GmbH

Part of the WebPros®  Family