Templates

Create Template

Create a new template with a base64-encoded PDF document. The API automatically extracts the page count from the document.

post/templates

Request body

namestring required

Template name

descriptionstring

Template description

documentstring byte required

Base64-encoded PDF or DOCX document. DOCX files are automatically converted to PDF. The API will automatically extract the page count from the document. For documents larger than 5 MB, use POST /documents and pass the document_id instead. (mutually exclusive with document_id)

expiration_hoursinteger

Hours until signing request expires

document_idstring uuid

ID of a previously uploaded document (mutually exclusive with document). Obtain by calling POST /documents first.

Example request

{
  "name": "Employment Contract Template",
  "description": "Standard employment contract for new hires",
  "document": "JVBERi0xLjQKJeLjz9MKMyAwIG9iago8PC9UeXBlIC9QYWdlCi9QYXJlbnQgMSAwIFIKL1Jlc291c...",
  "expiration_hours": 168,
  "document_id": "123e4567-e89b-12d3-a456-426614174000"
}

Response

Template created successfully

idstring uuid required

Unique identifier for the template

namestring required

Template name

descriptionstring nullable

Template description

document_urlstring uri

Pre-signed URL to the PDF document. This is a time-limited signed URL for secure access - see document_url_expires_at for expiration time. Initial URLs are valid for 7 days; refreshed URLs are valid for 1 hour. Request a new template retrieval to get a fresh URL if expired.

document_url_expires_atstring date-time nullable

ISO 8601 timestamp when the document_url will expire. After this time, the URL will return an access denied error. Fetch the template again to receive a fresh signed URL.

page_countinteger

Number of pages in the document

expiration_hoursinteger

Hours until signing requests created from this template expire

credit_costinteger

Number of credits consumed when a signing request is sent from this template. Minimum value is 1.

created_datestring date-time required

Template creation timestamp

updated_datestring date-time

Template last update timestamp

Example response

{
  "fields": [
    {
      "format_rules": {
        "dateFormat": "MMMM dd, yyyy"
      }
    }
  ]
}

Changes

No recorded changes to this endpoint across all 1 revision of this API.