v1

latestOpenAPI 3.1.02026-07-17220542.8 KB
Templates

Create a template from PDF

The API endpoint provides the functionality to create a fillable document template for a PDF file. Use <code>{{Field Name;role=Signer1;type=date}}</code> text tags to define fillable fields in the document. See <a href="https://www.docuseal.com/examples/fieldtags.pdf" target="_blank" class="link font-bold">https://www.docuseal.com/examples/fieldtags.pdf</a> for more text tag formats. Or specify the exact pixel coordinates of the document fields using fields param.<br><b>Related Guides</b><br><a href="https://www.docuseal.com/guides/use-embedded-text-field-tags-in-the-pdf-to-create-a-fillable-form" class="link">Use embedded text field tags to create a fillable form</a>

post/templates/pdf

Request body

namestring

Name of the template.

folder_namestring

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

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 PDF.

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.

flattenboolean

Remove PDF form fields from the documents.

remove_tagsboolean

Pass false to disable the removal of {{text}} tags from the PDF. This can be used along with transparent text tags for faster and more robust PDF processing.

Example request

{
  "name": "Test PDF",
  "external_id": "unique-key",
  "documents": [
    {
      "file": "base64",
      "fields": [
        {
          "areas": [
            {
              "page": 1
            }
          ],
          "options": [
            "Option A",
            "Option B"
          ],
          "validation": {
            "pattern": "[A-Z]{4}"
          },
          "preferences": {
            "font_size": 12,
            "format": "DD/MM/YYYY",
            "price": 99.99
          }
        }
      ]
    }
  ]
}

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.