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

# Create a template from HTML

`POST /templates/html`

The API endpoint provides the functionality to seamlessly generate a PDF document template by utilizing the provided HTML content while incorporating pre-defined fields.<br><b>Related Guides</b><br><a href="https://www.docuseal.com/guides/create-pdf-document-fillable-form-with-html-api" class="link">Create PDF document fillable form with HTML</a>

## Request body

- object
  - `html` string, required — HTML template with field tags.
  - `html_header` string — HTML template of the header to be displayed on every page.
  - `html_footer` string — HTML template of the footer to be displayed on every page.
  - `name` string — Template name. Random uuid will be assigned when not specified.
  - `size` 'Letter' | 'Legal' | 'Tabloid' | 'Ledger' | 'A0' | 'A1' | 'A2' | 'A3' | 'A4' | 'A5' | 'A6' — Page size. Letter 8.5 x 11 will be assigned when not specified.
  - `external_id` string — Your application-specific unique string key to identify this template within your app. Existing template with specified `external_id` will be updated with a new HTML.
  - `folder_name` string — The folder's name in which the template should be created.
  - `shared_link` boolean — Set to `true` to make the template available via a shared link. This will allow anyone with the link to create a submission from this template.
  - `documents` object[] — The list of documents built from HTML. Can be used to create a template with multiple documents. Leave `documents` param empty when using a top-level `html` param for a template with a single document.
    - `html` string, required — HTML template with field tags.
    - `name` string — Document name. Random uuid will be assigned when not specified.

## Response `200`

OK

- object
  - `id` integer, required — Unique identifier of the document template.
  - `slug` string, required — Unique slug of the document template.
  - `name` string, required — The name of the template.
  - `preferences` object, required — Template preferences.
  - `schema` object[], required — List of documents attached to the template.
    - `attachment_uuid` string, required — Unique identifier of attached document to the template.
    - `name` string, required — Name of the attached document to the template.
  - `fields` object[], required — List of fields to be filled in the template.
    - `uuid` string, required — Unique identifier of the field.
    - `submitter_uuid` string, required — Unique identifier of the submitter that filled the field.
    - `name` string, required — Field name.
    - `type` 'heading' | 'text' | 'signature' | 'initials' | 'date' | 'number' | 'image' | 'checkbox' | 'multiple' | 'file' | 'radio' | 'select' | 'cells' | 'stamp' | 'payment' | 'phone' | 'verification' | 'kba' | 'strikethrough', required — Type of the field (e.g., text, signature, date, initials).
    - `required` boolean, required — Indicates if the field is required.
    - `preferences` object — Field display preferences.
      - `font_size` integer — Font size of the field value in pixels.
      - `font_type` string — Font type of the field value.
      - `font` string — Font family of the field value.
      - `color` string — Font color of the field value.
      - `background` string — Field box background color.
      - `align` string — Horizontal alignment of the field text value.
      - `valign` string — Vertical alignment of the field text value.
      - `format` string — The data format for different field types.
      - `price` number — Price value of the payment field. Only for payment fields.
      - `currency` string — Currency value of the payment field. Only for payment fields.
      - `mask` boolean — Indicates if the field is masked on the document.
      - `reasons` string[] — An array of signature reasons to choose from.
    - `areas` object[], required — List of areas where the field is located in the document.
      - `x` number, required — X coordinate of the area where the field is located in the document.
      - `y` number, required — Y coordinate of the area where the field is located in the document.
      - `w` number, required — Width of the area where the field is located in the document.
      - `h` number, required — Height of the area where the field is located in the document.
      - `attachment_uuid` string, required — Unique identifier of the attached document where the field is located.
      - `page` integer, required — Page number of the attached document where the field is located.
  - `submitters` object[], required — The list of submitters for the template.
    - `name` string, required — The name of the submitter.
    - `uuid` string, required — Unique identifier of the submitter.
  - `author_id` integer, required — Unique identifier of the author of the template.
  - `archived_at` string, nullable, required — Date and time when the template was archived.
  - `created_at` string, required — The date and time when the template was created.
  - `updated_at` string, required — The date and time when the template was last updated.
  - `source` 'native' | 'api' | 'embed', required — Source of the template.
  - `external_id` string, nullable, required — Your application-specific unique string key to identify this template within your app.
  - `folder_id` integer, required — Unique identifier of the folder where the template is located.
  - `folder_name` string, required — Folder name where the template is located.
  - `shared_link` boolean — Indicates if the template is accessible by link.
  - `author` object, required
    - `id` integer, required — Unique identifier of the author.
    - `first_name` string, required — First name of the author.
    - `last_name` string, required — Last name of the author.
    - `email` string, required — Author email.
  - `documents` object[], required — List of documents attached to the template.
    - `id` integer, required — Unique identifier of the document.
    - `uuid` string, required — Unique identifier of the document.
    - `url` string, required — URL of the document.
    - `preview_image_url` string, required — Document preview image URL.
    - `filename` string, required — Document filename.

## Changes

- **2026-07-17** `c209c00c2386` — 1 warning
  - added the new `kba` enum value to the `fields/items/type` response property for the response status `200`
- **2025-12-15** `c684e0b4cc66` — 1 warning, 2 info
  - added the new `strikethrough` enum value to the `fields/items/type` response property for the response status `200`
  - added the optional property `fields/items/preferences/background` to the response with the `200` status
  - added the optional property `fields/items/preferences/reasons` to the response with the `200` status
- **2025-06-26** `ddfeff66ea4f` — 2 info
  - added the new optional request property `shared_link`
  - added the optional property `shared_link` to the response with the `200` status
- **2025-05-18** `0d8d180a4ed5` — 2 breaking, 4 warning, 2 info
  - the response property `archived_at` became nullable for the status `200`
  - the response property `external_id` became nullable for the status `200`
  - removed the request property `shared_link`
  - removed the optional property `fields/items/preferences/background` from the response with the `200` status
  - …4 more

[Change history](https://skmtc.dev/docusealco/apis/docuseal-api/changes/templates/html/post.md)

---

[API](https://skmtc.dev/docusealco/apis/docuseal-api.md) · [All operations](https://skmtc.dev/docusealco/apis/docuseal-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/docusealco/docuseal-api/revisions/c209c00c2386/schema)
