# Add Site Publisher website This function publishes a Site Publisher website. * This function uses the script to publish the Site Publisher website. * This function creates the file in the specified directory. * This file contains the user-entered data for the Site Publisher website and uses permissions. * For more information, read our Guide to Site Publisher Templates documentation. * When users publish a Site Publisher website, the system first creates a backup tarball of the target directory's contents in the directory within the user's home directory. * When users publish a Site Publisher website, the system logs template information and the target directory to the file. * The template directory's location depends on whether the user or a reseller owns the template: * — The user's templates. * — A reseller's templates, where represents the reseller's username. * — cPanel-provided templates. When you disable the _Web Server_ role, the system this function. Endpoint: GET /SiteTemplates/publish Version: 11.134.0.5 Security: BasicAuth ## Query parameters: - `target or docroot` (string, required) The directory that will contain the Site Publisher website. Example: "/home/example/public_html" - `parameter_name` (string) The template's variables and values. * 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 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 file. Example: "My Website" - `path` (string) The directory that contains the template's source directory. * — The user's templates. * — A reseller's templates, where represents the reseller's username. * — cPanel-provided templates. You include either the parameter the and parameters. Example: "/usr/local/cpanel/3rdparty/share/site_templates/" - `source` (string) The absolute path to a template directory that exists in one of the following directories: * — The user's templates. * — A reseller's templates, where represents the reseller's username. * — 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. You include either the parameter the and parameters. Example: "/usr/local/cpanel/3rdparty/share/site_templates/under_construction" - `template` (string) The template's directory's name. You include either the parameter the and parameters. Example: "under_construction" ## Response 200 fields (application/json): - `apiversion` (integer) The version of the API. Example: 3 - `func` (string) The name of the method called. Example: "publish" - `module` (string) The name of the module called. Example: "SiteTemplates" - `result` (object) - `result.data` (object,null) - `result.errors` (array,null) List of errors if the API failed. - `result.messages` (array,null) List of messages generated by the API. - `result.metadata` (object) - `result.metadata.transformed` (integer) Post-processing may have transformed the data. Enum: 1 - `result.status` (integer) - — Success. - — Failed. Check the field for more details. Enum: 0, 1 - `result.warnings` (array,null) List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API.