TemplateSpec

The template's content. type is required — pdf or html — and determines the rendering pipeline:

  • pdf — overlays declared fields (signature placements, text fields, checkboxes, etc.) onto the underlying PDF asset (contentKey + contentVersion). Field values come from JSONata expressions evaluated against the supplied inputs.
  • html — the underlying HTML asset is a Handlebars template. The supplied inputs first run through the JSONata expression in spec.data.transform to produce a viewModel — the data context Handlebars renders against. The compiled HTML is then converted to a PDF.

The remaining fields configure which entity inputs the template needs (inputs), what signing roles it exposes (roles), and which JSONata functions it can call (functions). Templates are the building blocks of blueprint envelopes.

  • type
    Type: stringenum
    required

    Template kind. pdf overlays fields on a PDF asset; html renders an HTML template (with an optional data transform).

    values
    • pdf
    • html
  • contentKey
    Type: string

    Asset key for the underlying PDF or HTML content. Pair with contentVersion.

  • contentVersion
    Type: string

    Specific version of the content asset to use.

  • data
    Type: object

    HTML-only. Configures the input → viewModel transform. The transform JSONata expression reshapes raw entity inputs into the data context the underlying Handlebars template renders against. See HtmlDataConfig.

    • transform
      Type: string
      required

      JSONata expression evaluated over the supplied inputs. The result becomes the viewModel — the object Handlebars references in the HTML via {{...}} syntax (e.g. {{candidate.fullName}}, {{#each items}}...{{/each}}). If the expression returns a non-object, it's wrapped as { "data": <result> } automatically.

  • fields
    Type: array object[] · TemplateFieldInfo[]

    Field placements on the rendered output (signature, text, checkbox, image, etc.). Each field declares its position, dimensions, optional default value (literal or expression), and optional role assignment.

    • key
      Type: string
      required

      Unique identifier for the field

    • type
      Type: stringenum
      required

      Type of the field (form field or e-signature field)

      values
      • text_field
      • check_box
      • image
      • line
      • signature
      • initial
      • signed_date
    • widgets
      Type: array object[]
      required

      Visual elements representing this field in the PDF

    • assignment
      Type: object

      Assignment for the field, indicating which participant should fill this field

    • includeIf
      Type: string

      Optional JSONata expression to control field visibility

    • value

      Optional literal value or JSONata expression to dynamically calculate field value from entity data

      • Type: string

        Optional literal value or JSONata expression to dynamically calculate field value from entity data

  • functions
    Type: array object[]

    JSONata functions referenced by expressions inside this template. Each entry pins a specific function key + version, with an optional alias used at call sites.

    • functionKey
      Type: string
      required

      Resource key of the JSONata function being referenced.

    • functionVersion
      Type: string
      required

      Specific version of the function being pinned (semver or draft).

    • alias
      Type: string Pattern: ^[a-z][a-zA-Z0-9]*$

      Optional name used in JSONata expressions to invoke this function as $<alias>(...). Defaults to functionKey when omitted.

  • inputs
    Type: array object[] · Input[]

    Entity inputs the caller (or parent blueprint) must supply when rendering this template.

    • key
      Type: string
      required

      Unique identifier for this input

    • required
      required

      Whether this entity slot must be populated (boolean literal or JSONata expression)

      • Type: boolean

        Whether this entity slot must be populated (boolean literal or JSONata expression)

    • schemaKey
      Type: string
      required

      Key of the schema that defines this entity's structure

    • schemaVersion
      Type: string
      required

      Schema version. Either a semantic version (e.g. 1.2.0) or draft while the parent blueprint is itself a draft.

    • description
      Type: string

      Description of what this input represents

    • name
      Type: string

      Human-readable name for this input

  • roles
    Type: array object[] · TemplateRole[]

    Signing roles declared by this template. Blueprint participants get assigned to these roles via document assignments at the orchestration step level.

    • key
      Type: string
      required

      Unique identifier for the role

    • name
      Type: string

      Human-readable name for the role

    • roleCategory
      Type: string

      Category or type of role (e.g., 'Signer', 'Approver')