Stores a new template under the name in the path, for a reseller, a domain, a server, or all of them. Send the file as a multipart part, or as base64 in a JSON body.Requires Super User or Reseller scope. A Reseller can manage templates stored for its own reseller or for a domain in it. A template that applies to every reseller and every domain (reseller and domain both *) is platform-wide, and only a Super User can create, change, or delete it. Other scopes get 403.A template is stored per reseller, domain, and server, and each defaults to *, meaning all. The values are matched exactly here: a template stored for every domain is not found when you name one domain. If a template already exists under this name for the same reseller, domain, and server, the request returns 400; replace it with PUT /templates/{filename}.The file must be an HTML template, a plain-text template, or a Word .docx document. The file's contents are checked, and the type detected from them is the one stored: text/html, text/plain, text/x-php for one whose contents read as PHP, such as a file that begins with <?php, or application/vnd.openxmlformats-officedocument.word for a .docx. Any other file, such as an image, SVG, JSON, a zip, or an executable, returns 400. A declared media type is optional; when one is sent, it must name the same kind as the contents. The file can be at most 1 MB (1,048,576 bytes); a larger one returns 413. Store images with /images.Send reseller and domain in the body; query-string values for them are ignored. The request returns 202: the template is accepted and stored shortly after.
Request
Authorization
Bearer Token
Provide your bearer token in the
Authorization
header when making requests to protected resources.
Example:
Authorization: Bearer ********************
or
Path Params
Body Params
application/json
Required
Examples
Responses
🟢202Accepted
application/json
Accepted. The template is stored shortly after. Read it with GET /templates/{filename} to confirm.