Skip to Content

create_from_template

Start a document from a template in list_templates (any kind) and persist it, returning document_id.

asks firstChanges something in your workspace, so clients ask you before running it.

What it does

Start a document from a template in list_templates (any kind) and persist it, returning document_id. Nothing is sent: review it with the user, then send it with send_envelope (or use send_template to create and send in one call). Call list_templates first; never guess ids or role keys. A ready template (a saved one, an AppliFlo contract or an official form AppliFlo set up): pass people, one {name, email} per roles[].key. The draft is a copy of the current version; the response's recipients[] (each role's person in signing order, then the template's fixed CCs) and fields[].recipient_index feed send_envelope directly, and fields are already placed (do NOT call detect_fields). Its fixed values (fixed_fields[]) are resolved like a send's: an empty Locked detail refuses the draft (422 missing_detail), an unanswered set-up box too (422 unanswered_ask: give it in fixed_overrides); send_envelope fills the fixed boxes without you passing values (the response's values lists them for review, a government ID number masked to its last 3 characters) and refuses a different value for a Locked box (422 locked_field). A draft saved template: people is ignored; you get a draft document whose fields[] carry their saved role label (role), and you add recipients and assignments at send_envelope. A draft official form (AppliFlo hasn't set it up): it is imported as a new document and its fields are read (like the app's Import), people is ignored; the response lists fields[] and groups[] like detect_fields: fill it with fill_document, then send_envelope with the recipients. The response says fields_read: false (with detection_skipped and a notice to relay) when only the PDF's built-in fillable fields could be read. A contract template (the workspace's own, older model): pass values (one per required_values[].key; a missing one is refused) and recipients in party order (recipients[0] = party_a, ...); fields[].recipient_index feeds send_envelope's assignments with the same recipients in the same order. An AppliFlo contract's draft carries notice ('Review before sending. This is not legal advice.'): a human MUST review it before it is sent; tell the user. An own_risk contract is refused (409 contract_risk_required) until the person accepts the own-risk terms: ask them, then call again with risk_accepted: true (a person who already accepted that contract version needs none). A fill-and-print-only government form (esign.mode block) drafts as usual (fill it, download it), but send_envelope refuses it (422 esign_not_allowed). Masked values (•••123) can't be sent back: ask the person for the full number.

Inputs

NameTypeDescription
template_idrequiredstringtemplates[].template_id from list_templates.
peoplemap of objectReady templates (required there). One person per template role, keyed by the role's `key` from list_templates' saved_templates[].roles (e.g. {"r1": {"name": "Nguyen Thi Lan", "email": "lan@example.com"}}). Every role needs a person; two roles can't share an email.
document_namestringDefaults to the template name.Up to 255 characters
fixed_overridesmap of string | boolean | string[]Ready templates only. The sender's values for the template's DEFAULT fixed boxes (get_template's fixed_fields[] with locked: false), keyed by fixed_fields[].index: text, true/false for a tick box, or option value(s) for a choice question. A LOCKED fixed box is set by the template and can't be overridden (refused with 422 locked_field). A Locked box whose workspace or My details value is empty refuses the send (422 missing_detail). A DEFAULT box the workspace answers once (an AppliFlo library form's "ask on copy" box) that nothing answered refuses the send (422 unanswered_ask): give it a value here.
local_daystringThe sender's own calendar day (YYYY-MM-DD), the 'today' fixed date boxes count from. Defaults to the server's UTC day.
valuesmap of stringkind contract only: map of required_values[].key -> string value.
recipientsobject[]kind contract only (required there): the parties, in order: index 0 is party_a, index 1 is party_b, ...Up to 4 items
namerequiredstringUp to 256 characters
emailrequiredstringFormat: email · Up to 254 characters
risk_acceptedbooleanThe person accepts AppliFlo's own-risk terms (Terms section 8A) for a library contract no lawyer has reviewed. Set it only after asking the person.
idempotency_keystringSame key = same call: a retry (e.g. after a timeout) returns the first result instead of doing it again. The same key with other arguments is refused (422 idempotency_key_reused).Up to 255 characters

Call it

Your MCP client builds this request for you. This is what it sends to https://appliflo.com/api/mcp, with the required inputs filled with placeholders.

{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "create_from_template",
    "arguments": {
      "template_id": "<template_id>"
    }
  }
}

Input schema

The JSON Schema the server lists for this tool in tools/list.

{
  "type": "object",
  "properties": {
    "template_id": {
      "type": "string",
      "description": "templates[].template_id from list_templates."
    },
    "people": {
      "type": "object",
      "description": "Ready templates (required there). One person per template role, keyed by the role's `key` from list_templates' saved_templates[].roles (e.g. {\"r1\": {\"name\": \"Nguyen Thi Lan\", \"email\": \"lan@example.com\"}}). Every role needs a person; two roles can't share an email.",
      "minProperties": 1,
      "maxProperties": 10,
      "additionalProperties": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 256
          },
          "email": {
            "type": "string",
            "format": "email",
            "maxLength": 254
          }
        },
        "required": [
          "name",
          "email"
        ],
        "additionalProperties": false
      }
    },
    "document_name": {
      "type": "string",
      "minLength": 1,
      "maxLength": 255,
      "description": "Defaults to the template name."
    },
    "fixed_overrides": {
      "type": "object",
      "description": "Ready templates only. The sender's values for the template's DEFAULT fixed boxes (get_template's fixed_fields[] with locked: false), keyed by fixed_fields[].index: text, true/false for a tick box, or option value(s) for a choice question. A LOCKED fixed box is set by the template and can't be overridden (refused with 422 locked_field). A Locked box whose workspace or My details value is empty refuses the send (422 missing_detail). A DEFAULT box the workspace answers once (an AppliFlo library form's \"ask on copy\" box) that nothing answered refuses the send (422 unanswered_ask): give it a value here.",
      "additionalProperties": {
        "oneOf": [
          {
            "type": "string",
            "maxLength": 4000
          },
          {
            "type": "boolean"
          },
          {
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        ]
      }
    },
    "local_day": {
      "type": "string",
      "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
      "description": "The sender's own calendar day (YYYY-MM-DD), the 'today' fixed date boxes count from. Defaults to the server's UTC day."
    },
    "values": {
      "type": "object",
      "description": "kind contract only: map of required_values[].key -> string value.",
      "additionalProperties": {
        "type": "string"
      }
    },
    "recipients": {
      "type": "array",
      "maxItems": 4,
      "description": "kind contract only (required there): the parties, in order: index 0 is party_a, index 1 is party_b, ...",
      "items": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 256
          },
          "email": {
            "type": "string",
            "format": "email",
            "maxLength": 254
          }
        },
        "required": [
          "name",
          "email"
        ]
      }
    },
    "risk_accepted": {
      "type": "boolean",
      "description": "The person accepts AppliFlo's own-risk terms (Terms section 8A) for a library contract no lawyer has reviewed. Set it only after asking the person."
    },
    "idempotency_key": {
      "type": "string",
      "minLength": 1,
      "maxLength": 255,
      "description": "Same key = same call: a retry (e.g. after a timeout) returns the first result instead of doing it again. The same key with other arguments is refused (422 idempotency_key_reused)."
    }
  },
  "required": [
    "template_id"
  ],
  "additionalProperties": false
}

On this page