---
title: "Create a new template"
method: POST
path: "/templates"
tags: ["Widget"]
---

# Create a new template

`POST /templates`

Create a new template with given parameters

## Request body

- Template
  - `config` string — Widget editor configuration field linked to the translation locales field in JSON format.
  - `cssCode` string — CSS that belongs to this template.
  - `dateActivated` string, date-time — Date when the widget was activated.
  - `dateCreated` string, date-time — Date when this widget was created
  - `dateModified` string, date-time — Date when this widget was modified
  - `description` string — Description of the template.
  - `htmlCode` string — UI text that belongs to this template.
  - `id` integer — Unique Id of the template
  - `isCustomTemplate` boolean — Indicates if this is a custom template.
  - `name` string — Name of the template.
  - `siteId` integer, required — Web Id of the studio template.
  - `status` 'DRAFT' | 'ACTIVE' | 'PAUSED' — Template status.
  - `tags` string[] — Tags that belong to this template.
  - `templateCssCode` string — CSS code that belongs to this template.
  - `templateHtmlCode` string — HTML code that belongs to this template.
  - `templateJavaScriptCode` string — JavaScript code that belongs to this template.
  - `themeId` integer — Id of the theme linked to the widget.
  - `type` 'TEMPLATE' | 'EDITOR' | 'PBX' — Type of template.
  - `url` string — Url associated with this template.
  - `useCustomData` boolean — Indicates if custom data is being used.
  - `widgetEditorTemplate` string — Widget editor code that belongs to this template.

## Response `201`

Created

## Other responses

- `400` — Bad Request
- `401` — Unauthorized
- `403` — Forbidden
- `404` — Not Found
- `422` — Unprocessable Entity
- `423` — Locked
- `429` — Too Many Requests
- `500` — Internal Server Error

---

[API](https://skmtc.net/kameleoon/apis/openapi-definition-for-automation-api.md) · [All operations](https://skmtc.net/kameleoon/apis/openapi-definition-for-automation-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/kameleoon/openapi-definition-for-automation-api/versions/09f2abcea0b5/schema)
