SPanel API

GDPR GDPR shared this idea 4 years ago
Completed

As a website owner I want to be able to use API for my website for subdomain creation/deletion. Please integrate it in SPanel.

37 votes

Comments (38)

photo

waiting for this request 

photo

Please don't forget to vote for the feature request as that's what makes it developed quicker than other features.

photo
I also need an API script for creating addon domains.
photo

Part of the API is already developed and in use internally. Basically, the Softaculous integration runs via the SPanel API. We plan to have all the actions you can do via the SPanel GUI available in the API - creating addon domains will be there too.

photo

Hey @Vlad, any news on this? are there something available to check?... thanks

photo
It seems we'll get to the release of the API before we see enough demand for it with only 13 votes for this feature at the moment. I think the API will become available to users in ~3 months.
photo

Interesting, I would love this, just to be sure , you would basically be able to create cpanel or spanel for users using the api, right?


photo

SPanel users will be able to manage API users (add/remove users, modify permissions/access for each user).

In terms of functionality, each action that can be performed via the SPanel graphic interface will also be available in the API since the API is already available and actively used in SPanel internally (for the Softaculous integration for example). We'll document and make the API available to users as well to integrate with external applications such as WHMCS, for example (which we plan to build an integration with until the end of the year).

photo

I'd love to be able to edit DNS entries via the APi.  On my current hosting service,  I use Lego to generate non-wildcard LetsEncrypt certs for non-public hosts via dns Acme challenges (see https://github.com/go-acme/lego).  As you can see, here:

https://go-acme.github.io/lego/dns/

Lego has built in support for many DNS providers.  For most you just need set a few environment variables.

I think certbot has similar functionality.

I'm trying to plan a move to scalahosting VPS and want to be able to provision LetsEncrypt certs in the same way.  

If the spanel API were to have a method for editing DNS entries, I'd be willing to write a PR to support spanel-managed domains in Lego.



photo

Hi Evan,

SPanel automatically issues wildcard and non-wildcard Let's encrypt certificates and renews them automatically for all domains that point to your SPanel VPS.

The feature to generate a Let's encrypt certificate will be available in the API as well. We edit the DNS zone if only a wildcard certificate is required. For non-wildcard certificates we use the http authorization method.

photo

Vlad,So 

Thanks for the info.  My use case is issuing certs for a couple of my systems at home which are not online.  So I can't use the http auth approach.  I use lan.<mydomain.com> for these servers and so I'll get certs issued for specific <hosts>.lan.<mydomain.com>.  I suppose I could switch to scalahosting but leave my lan.<mydomain.com> zone on my old provider.  It would just be nicer to have all my DNS under one roof.  For that I'd need an API for creating and removing the TXT entry used during each DNS acme challenge. 

photo

That will be available at some point for sure but maybe not in the first release of the SPanel API.

photo

Vlad, what will the authentication model be for the API.  I'm trying to implement an automated approach using a headless browser.  Needing to first auth against spanel and then navigate into a domain account in order to get the browser seeded with the right cookie/session data so that subsequent API calls work is a pain.  In particular, the captchas are incredibly agressive, making testing very slow going.  Long-term it would be much nicer to have API keys and for the APIs to include a domain account path or query parameter so writing an API client to automate an action is much simpler.

photo

A follow up to my previous comment: is there an easier way to gain API access to a domain's account's spanel  that's just not documented yet?

photo

We haven't started working on the API functionality yet however it is planned and we'll probably get to it within a month. Authentication will happen with tokens sent via HTTP POST. We'll provide documentation with examples.

photo

Wow, does this means that we will be able to add billing and other initial automation with Spanel, right?

photo
Souvik, that is correct.
photo

We have started working on this.

photo

This is now available in the latest version of SPanel which will be
updated to all servers in the next 7 days. The API documentation will become available in the next couple of weeks.

photo

Ooh, ooh...I can see Manage API Tokens now.   Yay!

Looking forward to docs.  In the meantime, is there can we using the existing endpoints (such ashttps://cloud-XXX.managed-vps.net/spanel/sess:XXXX/ajax/domain/listDNSrecords)  adding a token in the header instead of passing a cookie? Or do sessions go away altogether?

BTW, I get notified via when others add comments on this site, but not with you do @Vlad.



photo

You will not be able to use it that way. Please give us some time to prepare the docs and then everything will be much easier :)

We'll fix the notifications too. Thanks for reporting this.

photo

Do you have any updated on API doc availability?

photo

It's in progress. Please email hello@spanel.io with what you want to achieve and we can send you the docs how to achieve it while the official documentation is being written.

photo

FYI, I was able to use the API to implement a POC to automate my private lets-encrypt cert renewals.  I'm now picking up golang to implement Scalahosting/spanel support in the goacme/lego project.

photo

Vlad:

Does the API allow for restart of services? If not, please consider adding.

Due to OLS htaccess change restart requirement and how I'm using memcached, I need to be able to soft restart OLS service AND restart Memcached Object Cache Service at the user level for cron jobs and other commands running in my code. The former is very common need in WP as lots of plugins, etc. write to htaccess. 

photo

Restarting services is not available in the API. We'll consider adding it.

photo

hello, what is the status on the docs for the API?

photo

It will be available along with the licensing options in the next 2 weeks.

photo

Hello, when can the API documentation be ready?

photo

I apologize for the delay. We need 2 weeks more.

photo

Hello, is the API documentation ready?

photo

Yes. Please look at https://www.spanel.io/docs/

photo

No email interaction? like create an email account, change password for an email account?

photo

All that is available in the API however we forgot to document it. We are going to do it.

photo

The email API functionality is accessible at https://www.spanel.io/docs/article/api-functions/user-functions/user-email-functions/email-createemailaccount/

photo

AWESOME!!!!!

photo

API  endpoint to allow Single Sign on to the Spanel using username and password. 



photo
Hi James. Since this feature request is completed, it's best to open a new one for the SSO. We already talked internally about SSO and the advantages that it brings so we will certainly work on it in the next couple of months.
Leave a Comment