UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings.
https://api.docs.cpanel.net/_mock/specifications/cpanel.openapi/
https://{host}:{port}/execute/
Request
This function lists information for the cPanel account's Site Publisher websites.
Note:
To retrieve the list of Site Publisher website information, the function queries the configurations.json file in each domain's document root. For more information, read our Guide to Site Publisher Templates documentation.
Important:
When you disable the Web Server role, the system disables this function.
- Mock server
https://api.docs.cpanel.net/_mock/specifications/cpanel.openapi/SiteTemplates/list_user_settings
- A server running cPanel.
https://cpanel-server.tld:2083/execute/SiteTemplates/list_user_settings
- curl
- JavaScript
- Node.js
- Python
- Java
- C#
- PHP
- Go
- Ruby
- R
- Payload
curl -i -X GET \
-u <username>:<password> \
https://api.docs.cpanel.net/_mock/specifications/cpanel.openapi/SiteTemplates/list_user_settings{ "apiversion": 3, "func": "list_user_settings", "module": "SiteTemplates", "result": { "data": [ … ], "errors": null, "messages": null, "metadata": { … }, "status": 1, "warnings": null } }
Request
This function publishes a Site Publisher website.
- This function uses the
/scripts/process_site_templatescript to publish the Site Publisher website. - This function creates the
configurations.jsonfile in the specified directory.- This file contains the user-entered data for the Site Publisher website and uses
0700permissions. - For more information, read our Guide to Site Publisher Templates documentation.
- This file contains the user-entered data for the Site Publisher website and uses
- When users publish a Site Publisher website, the system first creates a backup tarball of the target directory's contents in the
/site_publisher/backups/directory within the user's home directory.
Notes:
- When users publish a Site Publisher website, the system logs template information and the target directory to the
/usr/local/cpanel/logs/error_logfile. - The template directory's location depends on whether the
rootuser or a reseller owns the template:/var/cpanel/customizations/site_templates/— Therootuser's templates./home/username/var/cpanel/reseller/site_templates/— A reseller's templates, whereusernamerepresents the reseller's username./usr/local/cpanel/3rdparty/share/site_templates/— cPanel-provided templates.
Important:
When you disable the Web Server role, the system disables this function.
The directory that will contain the Site Publisher website.
The template's variables and values.
Note:
- Use each variable's name as a parameter name for a parameter and value pair.
- The template that you specify determines the values to define.
- You must include the appropriate data for the selected template. If you use a cPanel-provided template, read our Guide to Site Publisher Templates documentation for more information. If you use a third-party template, consult that template's documentation or its
meta.jsonfile.
The directory that contains the template's source directory.
/var/cpanel/customizations/site_templates/— Therootuser's templates./home/username/var/cpanel/reseller/site_templates/— A reseller's templates, whereusernamerepresents the reseller's username./usr/local/cpanel/3rdparty/share/site_templates/— cPanel-provided templates.
Note:
You must include either the source parameter or the path and template parameters.
The absolute path to a template directory that exists in one of the following directories:
/var/cpanel/customizations/site_templates/— Therootuser's templates./home/username/var/cpanel/reseller/site_templates/— A reseller's templates, whereusernamerepresents the reseller's username./usr/local/cpanel/3rdparty/share/site_templates/— cPanel-provided templates.
If you do not specify a value, the system uses the path and template values to determine the template's source directory.
Note:
You must include either the source parameter or the path and template parameters.
- Mock server
https://api.docs.cpanel.net/_mock/specifications/cpanel.openapi/SiteTemplates/publish
- A server running cPanel.
https://cpanel-server.tld:2083/execute/SiteTemplates/publish
- curl
- JavaScript
- Node.js
- Python
- Java
- C#
- PHP
- Go
- Ruby
- R
- Payload
curl -i -X GET \
-u <username>:<password> \
'https://api.docs.cpanel.net/_mock/specifications/cpanel.openapi/SiteTemplates/publish?target++or++docroot=%2Fhome%2Fexample%2Fpublic_html¶meter_name=My+Website&path=%2Fusr%2Flocal%2Fcpanel%2F3rdparty%2Fshare%2Fsite_templates%2F&source=%2Fusr%2Flocal%2Fcpanel%2F3rdparty%2Fshare%2Fsite_templates%2Funder_construction&template=under_construction'{ "apiversion": 3, "func": "publish", "module": "SiteTemplates", "result": { "data": null, "errors": null, "messages": null, "metadata": { … }, "status": 1, "warnings": null } }