---
title: "Create a new HTML template"
method: POST
path: "/templates?endpoint_variant=create_html_template"
tags: ["Templates"]
---

# Create a new HTML template

`POST /templates?endpoint_variant=create_html_template`

Creates a new HTML template using HTML, CSS/SCSS, and Liquid templating. Allows complete
control over PDF layout and styling. Supports headers, footers, and dynamic content using
Liquid syntax for field values, conditions, loops, and filters.

## Request body

- object
  - `template` object, required
    - `add_data_request_submission_id_footers` boolean
    - `allow_additional_properties` boolean
    - `defaults` object
      - `alignment` 'left' | 'center' | 'right'
      - `backgroundColor` string, nullable
      - `bold` boolean
      - `characterSpacing` number
      - `checkBackgroundColor` string, nullable
      - `checkCharacter` string, nullable
      - `checkColor` string, nullable
      - `color` string, nullable, required
      - `dateFormat` string, nullable
      - `dateTimeFormat` string, nullable
      - `falseText` string, nullable
      - `fontSize` number, required
      - `opacity` number
      - `shapeBorderColor` string, nullable
      - `shapeBorderWidth` number
      - `shapeFillColor` string, nullable
      - `textColor` string, nullable
      - `trueText` string, nullable
      - `typeface` string, nullable, required
      - `uppercase` boolean
    - `description` string, nullable
    - `editable_submissions` boolean
    - `embed_domains` string, nullable
    - `embed_edit_allow_document_replacement` boolean — Allow the embedded template editor to replace the template's PDF document.
    - `embed_edit_allow_settings` boolean — Allow the embedded template editor to change sensitive template settings (webhooks, redirect URL, encryption, public access, expiration, etc.)
    - `embed_edit_allow_versioning` boolean — Allow the embedded template editor to publish, restore, diff, and delete published versions.
    - `encrypt_pdfs` boolean
    - `encrypt_pdfs_password` string, nullable
    - `expiration_interval` 'minutes' | 'hours' | 'days'
    - `expire_after` number
    - `expire_submissions` boolean
    - `external_predefined_fields_template_id` string, nullable
    - `external_predefined_fields_template_name` string, nullable
    - `field_order` array[]
      - number[]
    - `fields` object
    - `fields_patch` object[] — Array of field updates to apply
    - `footer_html` string, nullable
    - `header_html` string, nullable
    - `html` string, nullable, required
    - `html_engine_options` object
    - `locked` boolean
    - `merge_audit_trail_pdf` boolean
    - `name` string, nullable
    - `parent_folder_id` string
    - `predefined_fields` object[]
    - `predefined_fields_sample_data` union — Sample data for predefined fields. Can be a string when sent with multipart form upload.
      - object
      - string
    - `public_submissions` boolean
    - `public_web_form` boolean
    - `redirect_url` string, nullable
    - `scss` string, nullable
    - `shared_field_data` object
    - `shared_field_data_patch` object[] — Array of shared field data updates to apply
    - `slack_webhook_url` string, nullable
    - `template_type` 'html'
    - `webhook_options` object, nullable
      - `exclude_data` boolean
    - `webhook_url` string, nullable

## Response `201`

returns a created template

- TemplatePreview
  - `add_data_request_submission_id_footers` boolean, required
  - `allow_additional_properties` boolean, required
  - `description` string, nullable, required
  - `document_filename` string, nullable, required
  - `document_md5` string, nullable, required
  - `document_parse_error` boolean, required
  - `document_processed` boolean, required
  - `document_state` 'pending' | 'processed' | 'password_required' | 'malformed_pdf' | 'unknown_error', required
  - `document_url` string, nullable, required
  - `editable_submissions` boolean, required
  - `embed_domains` string, nullable, required
  - `embed_edit_allow_settings` boolean, required
  - `embed_edit_allow_versioning` boolean, required
  - `embed_edit_allow_document_replacement` boolean, required
  - `encrypt_pdfs_password` string, nullable, required
  - `encrypt_pdfs` boolean, required
  - `expiration_interval` string, required
  - `expire_after` integer, required
  - `expire_submissions` boolean, required
  - `external_predefined_fields_template_id` string, nullable, required
  - `external_predefined_fields_template_name` string, nullable, required
  - `first_template` boolean, required
  - `id` string, nullable, required
  - `locked` boolean, required
  - `merge_audit_trail_pdf` boolean, required
  - `name` string, nullable, required
  - `page_count` integer, required
  - `page_dimensions` array[], nullable, required
    - number[]
  - `parent_folder_id` string, nullable, required
  - `path` string, nullable, required
  - `permanent_document_url` string, nullable, required
  - `public_submissions` boolean, required
  - `public_web_form` boolean, required
  - `redirect_url` string, nullable, required
  - `slack_webhook_url` string, nullable, required
  - `template_type` 'pdf' | 'html', required
  - `updated_at` string, nullable, required
  - `version_published_at` string, nullable, required
  - `version` string, nullable, required
  - `webhook_url` string, nullable, required
  - `embed_edit_token` string, nullable
  - `demo` boolean, required
  - `latest_version` string, nullable, required
  - `last_changed_at` string, nullable, required
  - `last_changed_by_type` 'user' | 'api' | 'external_user', nullable, required
  - `last_changed_by_id` string, nullable, required
  - `last_changed_by_external_name` string, nullable, required
  - `last_changed_by_external_email` string, nullable, required
  - `last_changed_by_external_id` string, nullable, required

## Other responses

- `401` — authentication failed

---

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