CreateTemplateReq

Request body for creating a template. Carries the template's identity (metadata) and content (spec).

  • metadata
    Type: object
    required

    The resource's identity and human-facing labels. Shared shape across all five resource kinds (blueprints, templates, schemas, assets, functions). The pair (key, version) is the canonical handle for any resource within a namespace.

    • key
      Type: string Pattern: ^[a-z][a-z0-9]*(_[a-z0-9]+)*$
      required

      Caller-supplied identifier, unique within the namespace per kind. Stable across versions — a blueprint's key doesn't change when you publish a new version. Snake_case; must start with a lowercase letter.

    • name
      Type: string
      max length:  
      200
      required

      Human-readable display name shown in Studio, list responses, and audit trails (max 200 chars).

    • version
      Type: string
      required

      Either draft (editable; only one draft per key at a time) or a semver like 1.2.0 (immutable once published). On create you choose: pass draft to iterate, or a semver to publish directly.

    • description
      Type: string
      max length:  
      1000

      Optional longer-form description. Helps both humans and AI assistants pick the right resource when browsing the catalog (max 1000 chars).

    • labels
      Type: object

      Arbitrary key/value tags for categorization and filtering — e.g. { "team": "people-ops", "env": "prod" }. Filterable on list endpoints via ?labels[key]=value.

  • spec
    Type: object
    required

    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.

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

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

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

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

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

  • apiVersion
    Type: string

    Optional API version of the resource shape. Defaults to the current spec version.