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

# Create a template

`POST /templates`

Creates a new HTML template for waiting room pages. Must be a complete HTML5 document (`<!DOCTYPE html>`, closing `</body></html>`). Limited to 50 KB.

## Request body

- TemplateCreate — Payload used to create a new template.
  - `name` string, required — Name of the template.
  - `template` string, required — HTML content for the waiting room page. Must be a complete HTML5 document: `<!DOCTYPE html>`, `<html>`, `<head>`, `<body>`, and explicit `</body>` then `</html>`. Limited to 50 KB.

## Response `201`

Successfully created template.

- Template — A waiting room HTML template.
  - `id` string, uuid — System-generated unique identifier for the template.
  - `name` string — Name of the template.
  - `template` string — The customer-facing HTML content of the waiting room page. Limited to 50 KB. Must be a complete HTML5 document: `<!DOCTYPE html>`, `<html>`, `<head>`, `<body>`, and explicit `</body>` then `</html>`.
  - `assignedPrioritiesCount` integer — Number of priorities currently using this template.
  - `createdAt` string, date-time — Timestamp when the template was created (ISO 8601 UTC).
  - `updatedAt` string, date-time — Timestamp when the template was last updated (ISO 8601 UTC).

## Other responses

- `400` — Bad request - malformed JSON or invalid field types.
- `401` — Unauthorized - missing or invalid API key.
- `403` — Forbidden. The provided API key is valid, but the user does not have sufficient permissions to perform this operation.
- `422` — Unprocessable entity - validation failure. Examples: `template` exceeds 50 KB, `template` is not a valid HTML5 document, `name` too long, or the per-workspace template limit is reached.

---

[API](https://skmtc.net/datadome/apis/protection-api.md) · [All operations](https://skmtc.net/datadome/apis/protection-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/datadome/protection-api/versions/2576052958eb/schema)
