v1

latestOpenAPI 3.1.02026-07-14220425.8 KB
Templates

Create a template from 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="/keyring-guides/create-pdf-document-fillable-form-with-html-api.html" class="link">Create PDF document fillable form with HTML</a>

post/templates/html

Request body

htmlstring required

HTML template with field tags.

html_headerstring

HTML template of the header to be displayed on every page.

html_footerstring

HTML template of the footer to be displayed on every page.

namestring

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_idstring

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_namestring

The folder's name in which the template should be created.

shared_linkboolean

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.

Example request

{
  "html": "<p>Lorem Ipsum is simply dummy text of the\n<text-field\n  name=\"Industry\"\n  role=\"First Party\"\n  required=\"false\"\n  style=\"width: 80px; height: 16px; display: inline-block; margin-bottom: -4px\">\n</text-field>\nand typesetting industry</p>\n",
  "name": "Test Template",
  "size": "A4",
  "external_id": "714d974e-83d8-11ee-b962-0242ac120002",
  "documents": [
    {
      "html": "<p>Lorem Ipsum is simply dummy text of the\n<text-field\n  name=\"Industry\"\n  role=\"First Party\"\n  required=\"false\"\n  style=\"width: 80px; height: 16px; display: inline-block; margin-bottom: -4px\">\n</text-field>\nand typesetting industry</p>\n",
      "name": "Test Document"
    }
  ]
}

Response

OK

idinteger required

Unique identifier of the document template.

slugstring required

Unique slug of the document template.

namestring required

The name of the template.

preferencesobject required

Template preferences.

author_idinteger required

Unique identifier of the author of the template.

archived_atstring nullable required

Date and time when the template was archived.

created_atstring required

The date and time when the template was created.

updated_atstring required

The date and time when the template was last updated.

source'native' | 'api' | 'embed' required

Source of the template.

external_idstring nullable required

Your application-specific unique string key to identify this template within your app.

folder_idinteger required

Unique identifier of the folder where the template is located.

folder_namestring required

Folder name where the template is located.

shared_linkboolean

Indicates if the template is accessible by link.