• We value your experience with Plesk during 2024
    Plesk strives to perform even better in 2025. To help us improve further, please answer a few questions about your experience with Plesk Obsidian 2024.
    Please take this short survey:

    https://pt-research.typeform.com/to/AmZvSXkx
  • The Horde webmail has been deprecated. Its complete removal is scheduled for April 2025. For details and recommended actions, see the Feature and Deprecation Plan.
  • We’re working on enhancing the Monitoring feature in Plesk, and we could really use your expertise! If you’re open to sharing your experiences with server and website monitoring or providing feedback, we’d love to have a one-hour online meeting with you.

Resolved API install SSL certificate for mailserver

Lexz

Basic Pleskian
Good afternoon everybody,

I hope someone can help us.
We are developing the API implementation into our customerpanel.

We would like to install a certificate (Sectigo) for the mailserver of a subscription but we couldn't find it in the API documentation.
(Mail Service Preferences)

We only succeeded to install the certificate for the webmail and webserver. This seems to work fine.

Can someone help us out? Or give some details how we can do this?
Thank you in advance!

Update:
This is what we would like to do with the API
plesk bin subscription_settings --update example.com -mail_certificate 'certificate_name'
 
Last edited:
You can use REST API, POST "/cli/{id}/call" method to execute domain_pref CLI command (domain_pref is previous name of subscription_settings command, but you can call it over API).
Your example over API:
Bash:
curl -X POST "https://YOUR_IP:8443/api/v2/cli/domain_pref/call" -H "accept: application/json" -H "Content-Type: application/json" -d "{ \"params\": [ \"--update\", \"example.com\", \"-mail_certificate\", \"certificate_name\" ]}"
Don't forget API about authorization: About REST API
 
Back
Top