Skip to Content

send_template

Send a Ready saved template to its recipients in one call: creates the document from the template's current version and emails the first recipients.

destructivewaits for confirmSends, cancels or emails people. Clients ask you before running it.

What it does

Send a Ready saved template to its recipients in one call: creates the document from the template's current version and emails the first recipients. Call list_templates FIRST: use a saved_templates[] entry with status ready, and its roles[].key values as the keys of people (one {name, email} per role; every role needs a person, two roles can't share an email). Prefill only sender_fields (by index, from get_template); the template's fixed_fields[] are filled by the template itself (override a Default one with fixed_overrides; a Locked one is refused). The template's own CCs, subject, message, reminders and expiry apply unless you override subject/message. A Draft template is refused (409 template_not_ready). Pass idempotency_key when retrying so nobody is emailed twice. Confirm the recipients with the user before sending: this sends real email. A person with delivery "embedded" is never emailed: your app signs them in its own page (POST /api/v1/embed/signing-sessions). An AppliFlo library contract no lawyer has reviewed 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 no risk_accepted. Two steps: called WITHOUT confirm: true it does nothing and returns an error saying what it would do (the details are in structuredContent); show that to the user and, once they agree, call again with the same arguments and confirm: true. Some hosted government forms (e.g. USCIS I-130, SSA SS-5, IRS 8879) are fill-and-print only: any send of them is refused (422 esign_not_allowed); download the filled PDF instead. A form whose agency may reject an e-signature needs esign_risk_acknowledged: true (422 esign_ack_required without it). Masked values (•••123) can't be sent back: ask the person for the full number.

Two calls

Called without confirm: true, it does nothing and returns an error that says what would happen. Show that to the user, then call again with the same inputs and confirm: true.

Inputs

NameTypeDescription
template_idrequiredstringsaved_templates[].template_id from list_templates.
versionintegerPin a version; defaults to the current one.At least 1
esign_risk_acknowledgedbooleanThe sender acknowledges the agency may reject an electronic signature on this form (warn-mode forms only).
peoplerequiredmap of objectOne 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.
prefillmap of string | string[]Values for the boxes the template gives the SENDER only, keyed by get_template's sender_fields[].index. A box a recipient fills can't be prefilled (refused with role_owned_field).
ccobject[]Extra copies (added to the template's fixed CCs, which always apply).Up to 20 items
emailrequiredstringFormat: email · Up to 254 characters
namestringUp to 120 characters
subjectstringDefaults to the template's subject.Up to 200 characters
messagestringDefaults to the template's message.Up to 4000 characters
idempotency_keystringSame key = same send (a retry returns the first envelope).Up to 255 characters
fixed_overridesmap of string | boolean | string[]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.
remember_defaultsinteger[]fixed_fields[].index of Default boxes whose fixed_overrides value becomes the template's default for everyone, once sent. A Locked box is refused (422 locked_field).
local_daystringThe sender's own calendar day (YYYY-MM-DD), the 'today' fixed date boxes count from. Defaults to the server's UTC day.
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.
confirmbooleantrue to really do it. Without it nothing happens: you get an error describing what would happen, to show the user.

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": "send_template",
    "arguments": {
      "template_id": "<template_id>",
      "people": {}
    }
  }
}

Input schema

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

{
  "type": "object",
  "properties": {
    "template_id": {
      "type": "string",
      "description": "saved_templates[].template_id from list_templates."
    },
    "version": {
      "type": "integer",
      "minimum": 1,
      "description": "Pin a version; defaults to the current one."
    },
    "esign_risk_acknowledged": {
      "type": "boolean",
      "description": "The sender acknowledges the agency may reject an electronic signature on this form (warn-mode forms only)."
    },
    "people": {
      "type": "object",
      "description": "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
          },
          "delivery": {
            "type": "string",
            "enum": [
              "email",
              "embedded"
            ],
            "description": "How their signing link reaches them. Default \"email\": invited, reminded (and sent any access code) by email. \"embedded\": never emailed (no invite, no reminders, no code); your app signs them in its own page with POST /api/v1/embed/signing-sessions when their turn comes. Needs the Business plan or a sandbox workspace (else 402 plan_feature). Never a cc (422 cc_not_embeddable)."
          }
        },
        "required": [
          "name",
          "email"
        ],
        "additionalProperties": false
      }
    },
    "prefill": {
      "type": "object",
      "description": "Values for the boxes the template gives the SENDER only, keyed by get_template's sender_fields[].index. A box a recipient fills can't be prefilled (refused with role_owned_field).",
      "additionalProperties": {
        "oneOf": [
          {
            "type": "string",
            "maxLength": 4000
          },
          {
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        ]
      }
    },
    "cc": {
      "type": "array",
      "maxItems": 20,
      "description": "Extra copies (added to the template's fixed CCs, which always apply).",
      "items": {
        "type": "object",
        "properties": {
          "email": {
            "type": "string",
            "format": "email",
            "maxLength": 254
          },
          "name": {
            "type": "string",
            "maxLength": 120
          }
        },
        "required": [
          "email"
        ],
        "additionalProperties": false
      }
    },
    "subject": {
      "type": "string",
      "maxLength": 200,
      "description": "Defaults to the template's subject."
    },
    "message": {
      "type": "string",
      "maxLength": 4000,
      "description": "Defaults to the template's message."
    },
    "idempotency_key": {
      "type": "string",
      "maxLength": 255,
      "description": "Same key = same send (a retry returns the first envelope)."
    },
    "fixed_overrides": {
      "type": "object",
      "description": "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"
            }
          }
        ]
      }
    },
    "remember_defaults": {
      "type": "array",
      "items": {
        "type": "integer",
        "minimum": 0
      },
      "description": "fixed_fields[].index of Default boxes whose fixed_overrides value becomes the template's default for everyone, once sent. A Locked box is refused (422 locked_field)."
    },
    "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."
    },
    "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."
    },
    "confirm": {
      "type": "boolean",
      "description": "true to really do it. Without it nothing happens: you get an error describing what would happen, to show the user."
    }
  },
  "required": [
    "template_id",
    "people"
  ],
  "additionalProperties": false
}

On this page