Skip to Content

send_doc

Send a draft or ready Doc for signing, as the app's Send does: AppliFlo renders it to a PDF (checking every box lands where it should), makes the envelope and emails the first people.

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

What it does

Send a draft or ready Doc for signing, as the app's Send does: AppliFlo renders it to a PDF (checking every box lands where it should), makes the envelope and emails the first people. people gives one {name, email} per role key from get_doc's roles (every role needs a person; two who sign can't share an email); revision is get_doc's. Variables ({{client.full_name}}) are filled from the workspace and the sender; give any that are missing in typed (by key; 422 missing_values lists them). Boxes the sender fills (role sender) take sender_fills by box id; a Doc with a sender signature needs adopt_signature: true (the caller's saved signature; ask them). A refusal the sender can fix is 422 with a code (missing_person, missing_values, role_without_signature, placement, …). Two steps: called WITHOUT confirm: true it sends nothing: it renders and checks the send, and returns an error naming who would be emailed, with a confirm_token in structuredContent. Show that to the user; once they agree, call again with the same arguments plus that confirm_token and confirm: true. If anything changed since (the people, copies or email words, the doc, a value, the date) nothing is sent (422 changed_since_review, or 409 for a new revision): preview again. 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. (Here: a Doc from a contract template or drafted with AI.) Returns envelope_id and pdf_document_id (track it with the envelope and document tools).

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
doc_idrequiredstringA Doc's doc_id (from list_docs, or list_documents' kind 'doc' rows).Up to 80 characters
revisionrequiredintegerget_doc's revision: what you checked is what is sent (409 otherwise).At least 0
peoplerequiredmap of objectOne person per role key (get_doc roles[].key, e.g. r1).
ccobject[]Extra people who get a copy.Up to 10 items
emailrequiredstring
namestring
subjectstringThe email subject. Defaults to the doc's title.Up to 200 characters
messagestringUp to 2000 characters
reminderstringReminder emails: off, daily, 3d or 7d.One of: off, daily, 3d, 7d
expiry_daysinteger | nullDays until the links stop working; null: never.1 to 365
typedmap of stringValues for variables, by key (e.g. {"matter.fee_total": "4950"}).
sender_fillsmap of stringThe sender's text for boxes they fill, by box id (from get_doc format json).
local_daystringThe sender's own date today (YYYY-MM-DD).
adopt_signaturebooleanThe sender adopts their saved signature for the Doc's sender signature. Ask them first.
client_idstring | nullThe client (list_clients) the Doc, its envelope and its PDF go on.
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.
confirm_tokenstringFrom the unconfirmed call's structuredContent: what the user reviewed.
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_doc",
    "arguments": {
      "doc_id": "<doc_id>",
      "revision": 1,
      "people": {}
    }
  }
}

Input schema

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

{
  "type": "object",
  "properties": {
    "doc_id": {
      "type": "string",
      "minLength": 1,
      "maxLength": 80,
      "description": "A Doc's doc_id (from list_docs, or list_documents' kind 'doc' rows)."
    },
    "revision": {
      "type": "integer",
      "minimum": 0,
      "description": "get_doc's revision: what you checked is what is sent (409 otherwise)."
    },
    "people": {
      "type": "object",
      "description": "One person per role key (get_doc roles[].key, e.g. r1).",
      "additionalProperties": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "maxLength": 256
          },
          "email": {
            "type": "string",
            "maxLength": 254
          },
          "access_code": {
            "type": "string",
            "enum": [
              "none",
              "email"
            ],
            "description": "email: they get a code by email to open it. Default none."
          }
        },
        "required": [
          "name",
          "email"
        ],
        "additionalProperties": false
      }
    },
    "cc": {
      "type": "array",
      "maxItems": 10,
      "items": {
        "type": "object",
        "properties": {
          "email": {
            "type": "string"
          },
          "name": {
            "type": "string"
          }
        },
        "required": [
          "email"
        ],
        "additionalProperties": false
      },
      "description": "Extra people who get a copy."
    },
    "subject": {
      "type": "string",
      "maxLength": 200,
      "description": "The email subject. Defaults to the doc's title."
    },
    "message": {
      "type": "string",
      "maxLength": 2000
    },
    "reminder": {
      "type": "string",
      "enum": [
        "off",
        "daily",
        "3d",
        "7d"
      ],
      "description": "Reminder emails: off, daily, 3d or 7d."
    },
    "expiry_days": {
      "type": [
        "integer",
        "null"
      ],
      "minimum": 1,
      "maximum": 365,
      "description": "Days until the links stop working; null: never."
    },
    "typed": {
      "type": "object",
      "additionalProperties": {
        "type": "string",
        "maxLength": 2000
      },
      "description": "Values for variables, by key (e.g. {\"matter.fee_total\": \"4950\"})."
    },
    "sender_fills": {
      "type": "object",
      "additionalProperties": {
        "type": "string",
        "maxLength": 2000
      },
      "description": "The sender's text for boxes they fill, by box id (from get_doc format json)."
    },
    "local_day": {
      "type": "string",
      "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
      "description": "The sender's own date today (YYYY-MM-DD)."
    },
    "adopt_signature": {
      "type": "boolean",
      "description": "The sender adopts their saved signature for the Doc's sender signature. Ask them first."
    },
    "client_id": {
      "type": [
        "string",
        "null"
      ],
      "description": "The client (list_clients) the Doc, its envelope and its PDF go on."
    },
    "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_token": {
      "type": "string",
      "pattern": "^[0-9a-f]{64}\\.[0-9a-f]{64}$",
      "description": "From the unconfirmed call's structuredContent: what the user reviewed."
    },
    "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": [
    "doc_id",
    "revision",
    "people"
  ],
  "additionalProperties": false
}

On this page