Template API

Create or update a template draft

Creates a new template and its first draft when templateId is omitted. When templateId is provided, the endpoint updates only the supplied fields, using the active draft as the base or the published version if no active draft exists. Supplied content and sampleData replace their complete stored values. For parameters, only the fields you provide are updated. Every save validates the complete draft, including fields preserved during an update, without rendering a PDF or consuming conversion credits.

post/v1/templates/drafts

Request

  • Base URL: https://api.pdfbolt.com
  • URL: https://api.pdfbolt.com/v1/templates/drafts
  • Auth: API key in header PERSONAL-ACCESS-TOKEN

Request body

OR

Example request

{
  "name": "Invoice",
  "description": "Monthly invoice template",
  "templateEngine": "HANDLEBARS",
  "content": "PCFkb2N0eXBlIGh0bWw+PGh0bWw+PGJvZHk+PGgxPkludm9pY2Uge3tpbnZvaWNlTnVtYmVyfX08L2gxPjwvYm9keT48L2h0bWw+",
  "sampleData": {
    "invoiceNumber": "INV-1001"
  },
  "parameters": {
    "format": "A4",
    "waitUntil": "networkidle",
    "printBackground": true
  }
}

Response

Draft saved successfully.

templateIdstring uuid required

UUID of the template whose draft was saved.

draftVersionIdinteger required

Unique identifier of the saved draft version.

versionNumberinteger required

Sequential version number within the template.

createdTemplateboolean required

Returns true for create requests and false for updates.

Changes

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