Templates API

Manage reusable contract templates with variables.

Base URL:https://apisign.io/api

A template is markdown content with {{variables}} plus optional field definitions that say what each variable is and who fills it in. Create contracts from it with template_id on /contract/create.


Create Template

Template Variables

Write variables as {{name}}. Names are matched case-insensitively.

When you create a contract, each variable is resolved to a field:

  1. If the template's field definitions contain an entry with that name, its type and completedBy are used.
  2. Otherwise the variable is signer-completed, and its type is guessed from its name. The name is split into words at _, -, ., spaces and camelCase boundaries, words are matched whole, and the first rule that matches wins:
NameInferred typeExamples
timestamp, or a signing word (sign, signed, signature, sig) next to date/time, or signed_at/signed_ontimestampsign_date, date_signed, signature_date, signed_at
The word signature or sig (but not signature_requirements, signature_authority and similar)signaturesignature, tenant_signature, sig
The word initials, or initial as the last wordinitialsbuyer_initials, initial_2
signer followed by name or full_namesigner_namesigner_name, tenant_signer_name
The word emailemailclient_email
The word phone, mobile, tel or telephonephoneclient_phone
The word datedatestart_date
Anything elsetextfull_name, assignee_address, design_fee

Because words are matched whole, {{assignee_address}} and {{consignor_email}} are not signatures. A plain {{full_name}} is a text box the signer types into; use {{signer_name}} for the signer's name filled in automatically.


Get Template


List Templates


Update Template


Archive Template


Upload Template


Field Definitions

Send field definitions to /template/update as an array. They are stored, and returned by /template/get, wrapped in an object: { "fields": [...] }.

{
  "fields": [
    {
      "name": "company_name",
      "type": "text",
      "completedBy": "creator"
    },
    {
      "name": "client_signature",
      "type": "signature",
      "completedBy": "signer"
    },
    {
      "name": "effective_date",
      "type": "date",
      "completedBy": "creator"
    }
  ]
}

Each definition has name (the variable name without braces), type, an optional completedBy (defaults to signer), and an optional label, the prompt shown for a text field.

Field Types

TypeDescription
signatureSignature capture
initialsInitials capture
signer_nameFilled with the signer's name
timestampFilled with the time of signing
textPlain text input
emailEmail input
phonePhone number input
dateDate picker

Completed By

ValueDescription
creatorFilled from variables when creating the contract. Contract creation fails if any creator field has no value.
signerFilled by the signer during signing