Return available Site Publisher templates

This function lists available templates for cPanel's Site Publisher feature.

  • If you call this function as the root or system user, the function lists the root user's templates.
  • If you call this function as a reseller, the function lists the root user's templates and the reseller's templates.
  • If you call this function as a cPanel user, the function's output depends on the account's owner:
    • If the root user owns the account, the function only lists the root user's templates.
    • If a reseller owns the account, the function lists the root user's templates and that reseller's templates.

Note:

The template directory's location depends on whether the root user or a reseller owns the template:

  • /var/cpanel/customizations/site_templates/ — The root user's templates.
  • /home/username/var/cpanel/reseller/site_templates/ — A reseller's templates, where username represents 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.

SecurityBasicAuth
Responses
200

HTTP Request was successful.

Response Schema: application/json
apiversion
integer

The version of the API.

func
string

The name of the method called.

module
string

The name of the module called.

object
get/SiteTemplates/list_site_templates
Request samples
uapi --output=jsonpretty \
  --user=username \
  SiteTemplates \
  list_site_templates
Response samples
application/json
{
  • "apiversion": 3,
  • "func": "list_site_templates",
  • "module": "SiteTemplates",
  • "result": {
    • "data": [
      • {
        • "meta": {
          • "fields": [
            • {
              • "id": "fullName",
              • "label": "Full Name",
              • "placeholder": "Your Name",
              • "type": "text"
              }
            ],
          • "information": {
            • "date": "2020-06-30T00:00:00.000Z",
            • "description": "Single page 'About Me' site",
            • "id": "about_me",
            • "name": "About Me",
            • "preview_image_path": "/preview.png"
            }
          },
        • "path": "/usr/local/cpanel/3rdparty/share/site_templates",
        • "preview": 1,
        • "template": "about_me"
        }
      ],
    • "errors": null,
    • "messages": null,
    • "metadata": {
      • "transformed": 1
      },
    • "status": 1,
    • "warnings": null
    }
}