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 Plesk via REST API?

 
automationclidomainshttpsmail

Question

Is it possible to manage Plesk via REST API?

How to manage Plesk via REST API?

Answer

Starting from Plesk Onyx 17.8, it is possible to use REST API for managing Plesk.

Besides this, REST API has the ability to call Plesk CLI utilities. The full list of supported CLI utilities can be found using following API request:

# curl -k -u admin:password -X GET "https://plesk.example.com:8443/api/v2/cli/commands/"

Find several examples of using REST API in the examples below:

Using REST API methods

  • To list all domains:

    # curl -k -X GET -u admin:password -H "Content-Type: application/json" -H "Accept: application/json" "https://203.0.113.2:8443/api/v2/domains"
    [
    {
    "id": 1,
    "created": "2018-12-17",
    "name": "example.com,
    "ascii_name": "example.com",
    "guid": "4e0da092-de42-4048-9459-989b5cb942f2",
    "hosting_type": "virtual"
    },
    {
    "id": 2,
    "created": "2018-12-17",
    "name": "example.org",
    "ascii_name": "example.org",
    "guid": "f1b6e826-c884-4fa2-832b-5813c09002d3",
    "hosting_type": "virtual"
    },
    {
    "id": 3,
    "created": "2018-12-17",
    "name": "example.net",
    "ascii_name": "example.net",
    "guid": "03f62600-db70-4a94-9818-ab12a57a1425",
    "hosting_type": "virtual"
    }

  • To create a mailbox:

    # curl -k -X POST -u admin:password "https://203.0.113.2:8443/api/v2/cli/mail/call" -H "accept: application/json" -H "Content-Type: application/json" -d "{ "params": [ "--create", "[email protected]","-mailbox", "true", "-passwd", "1qazXSW@" ]}"
    {
    "code": 0,
    "stdout": "SUCCESS: Creation of mailname '[email protected]' complete",
    "stderr": ""

Using REST API to call CLI utilities

  • Show the information about the subscription:

    # curl -k -X POST -u admin:password "https://203.0.113.2:8443/api/v2/cli/subscription/call" -H "accept: application/json" -H "Content-Type: application/json" -d "{ "params": ["--info", "example.com"]}"

  • Show help for mail utility:

    # curl -k -X POST -u admin:password "https://203.0.113.2:8443/api/v2/cli/mail/call" -H "accept: application/json" -H "Content-Type: application/json" -d "{ "params": [ "--help" ]}"

  • Use CLI gate to check SpamAssassin status for the mailbox:

    # curl -k -X POST -u admin:password "https://203.0.113.2:8443/api/v2/cli/spamassassin/call" -H "accept: application/json" -H "Content-Type: application/json" -d "{ "params": [ "--info", "[email protected]" ]}"

  • Use CLI gate to add additional user using secret key instead of admin password

    # curl -k -X 'GET' -H 'X-Api-Key: ******************' 'https://203.0.133.2:8443/api/v2/cli/user/call' -H "accept: application/json" -H "Content-Type: application/json" -d @user.json

    The content of the user.json file:

    { "params": [ "--create", "adduser", "-owner", "admin", "-passwd", "samplepassword", "-cname", "User", "-role", "webmaster" ] }

Additional Information

About REST API

New Remote Plesk REST API For Automation

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

Exploring Plesk’s Added Value Solutions So Far in 2023

Read More »

Unveiling Sitejet Builder: The Perfect Match for Your Effortless Website Creation Needs

Read More »

Dynamic List vs. Active List: A Comprehensive Comparison – Unveiling the Ultimate Winner!

Read More »
Knowledge Base

Websites on Plesk server are slow or show error 500 or PHP mail cannot be sent: ap_pass_brigade failed

Read More »

Mail delivery does not work: do not list domain in BOTH mydestination and virtual_mailbox_domains

Read More »

Unable to issue a Let’s Encrypt certificate for a domain or its mail in Plesk: the DNS challenge used another IP address

Read More »

Let’s Encrypt notification mail: Your certificate (or certificates) for the names listed below will expire in days

Read More »

Hosting Wiki

  • RESTful Web Service
  • CLI
  • QMAIL
  • Sendmail
  • SSI
  • SASS
  • Domain
  • Plesk
  • Email Autoresponder
  • Mailing Lists
  • Email Alias
  • Email Virus Protection
  • Email Forwarding
  • Webmail
  • SpamAssassin
  • SPAM
  • 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