# Overview > What you can build with the AppliFlo API and MCP server today, and where to start. AppliFlo reads a PDF form, finds its fields, fills them with your values and sends it for signature. You can do all of that from your own code with the REST API, or from a coding agent with the MCP server. ## Two ways in - **[REST API](https://dev.appliflo.com/api).** Base URL `https://appliflo.com/api/v1`. Every endpoint has a page made from the same OpenAPI file the server uses. - **[MCP server](https://dev.appliflo.com/mcp).** The same actions as tools, for Claude Code, Cursor, VS Code and other MCP clients. URL `https://appliflo.com/api/mcp`. Both use a workspace API key. API keys come with the [Business plan](https://dev.appliflo.com/guides/plans). An owner or admin makes one in [Settings, API keys](https://appliflo.com/settings/api-keys) on appliflo.com. ## What works today | Live | Coming soon | | --- | --- | | REST API with an API key | [Embed SDK](https://dev.appliflo.com/sdk) | | MCP server with an API key | [Sandbox](https://dev.appliflo.com/sandbox) | | Fill, detect, send, templates, send to many | Sign in from Claude.ai and ChatGPT | | [Webhooks](https://dev.appliflo.com/webhooks) | | ## How a call looks Send your key in the `Authorization` header. Every response is JSON with the same shape: ```json { "success": true, "data": { "...": "..." } } ``` A failed call has `success: false` and an `error`. Some failures add a stable `code`. See [Errors](https://dev.appliflo.com/guides/errors). ## Start here 1. [Quickstart](https://dev.appliflo.com/guides/quickstart): fill your first PDF in one call. 2. [API keys and scopes](https://dev.appliflo.com/guides/api-keys): what a key can do and when it stops working. 3. [Errors](https://dev.appliflo.com/guides/errors), [Rate limits](https://dev.appliflo.com/guides/rate-limits) and [Idempotency](https://dev.appliflo.com/guides/idempotency): what to handle before you go live. Then pick a guide for the task you have, such as [sending a document for signature](https://dev.appliflo.com/guides/send-for-signature) or [sending a template to many people](https://dev.appliflo.com/guides/send-to-many). ## For AI agents Every page here is also plain Markdown. Add `.md` to a page's address, read [`/llms.txt`](https://dev.appliflo.com/llms.txt) for an index, or [`/llms-full.txt`](https://dev.appliflo.com/llms-full.txt) for every page in one file. The AppliFlo Docs MCP at `https://dev.appliflo.com/docs-mcp` lets an agent search and read these docs. It is read-only, needs no key, and is separate from the product's MCP server. Source: https://dev.appliflo.com/guides --- # Quickstart > Make an API key, fill your first PDF with one call and read the result for each field. Send a PDF and the values you want on it. AppliFlo finds the fields, fits each value and returns the filled PDF with a result for every field. > **Before you start** > > API keys come with the Business plan. Keep your key on your server: anyone with it can act for your workspace. ### Make an API key An owner or admin opens [Settings, API keys](https://appliflo.com/settings/api-keys) on appliflo.com and chooses **Create key**. For this quickstart, tick **Read** and **Create drafts**. Copy the key when it is shown: it is shown once. Keys start with `aflo_live_`. Save it in your shell so the samples below can read it: ```bash export APPLIFLO_API_KEY="paste-your-key-here" ``` ### Fill a PDF in one call Send the PDF in the multipart field `file` and your values in `values`, a JSON object keyed by the label printed next to each box. Add an `Idempotency-Key` header so a retry never does the work twice. **curl** ```bash curl -X POST https://appliflo.com/api/v1/fill \ -H "Authorization: Bearer $APPLIFLO_API_KEY" \ -H "Idempotency-Key: quickstart-0001" \ -F "file=@rental-application.pdf" \ -F 'values={"Applicant full name":"Alexandra Whitfield-Harrington","Move-in date":"2026-08-01"}' ``` **Node** ```js import { readFile, writeFile } from "node:fs/promises"; const form = new FormData(); form.append("file", new Blob([await readFile("rental-application.pdf")], { type: "application/pdf" }), "rental-application.pdf"); form.append("values", JSON.stringify({ "Applicant full name": "Alexandra Whitfield-Harrington", "Move-in date": "2026-08-01", })); const res = await fetch("https://appliflo.com/api/v1/fill", { method: "POST", headers: { Authorization: `Bearer ${process.env.APPLIFLO_API_KEY}`, "Idempotency-Key": "quickstart-0001", }, body: form, }); const { data } = await res.json(); await writeFile("filled.pdf", Buffer.from(data.pdf_base64, "base64")); console.log(data.results); ``` **Python** ```python import base64, json, os, requests res = requests.post( "https://appliflo.com/api/v1/fill", headers={ "Authorization": f"Bearer {os.environ['APPLIFLO_API_KEY']}", "Idempotency-Key": "quickstart-0001", }, files={"file": open("rental-application.pdf", "rb")}, data={"values": json.dumps({ "Applicant full name": "Alexandra Whitfield-Harrington", "Move-in date": "2026-08-01", })}, ) data = res.json()["data"] open("filled.pdf", "wb").write(base64.b64decode(data["pdf_base64"])) print(data["results"]) ``` ### Read the results The reply has the filled PDF as base64 in `data.pdf_base64` and one entry per field in `data.results`: ```json { "success": true, "data": { "pdf_base64": "JVBERi0xLjcK...", "results": [ { "field_id": "field_12", "status": "filled", "rendered_text": "Alexandra Whitfield-Harrington", "font_size": 8, "lines": 1 }, { "field_id": "field_19", "status": "formatted", "rendered_text": "01/08/2026" }, { "field_id": "field_31", "status": "overflowed", "rendered_text": "...", "font_size": 6, "lines": 3 } ], "groups": [], "warnings": [], "ai_pages": { "used": 2, "limit": 1000, "remaining": 998, "exhausted": false, "resets_at": "2026-12-01T00:00:00.000Z" } } } ``` | `status` | What it means | | --- | --- | | `filled` | Written as sent. `font_size` and `lines` say how it was fitted. | | `formatted` | Changed to the form's format first, such as a date. `rendered_text` is what was written. | | `overflowed` | Too long for the box even at the smallest size. It was not written. | | `skipped` | Not written. `reason` says why: `empty`, `invalid-format`, `invalid-value`, `unsupported-type` or `not-needed`. | Check for `overflowed` and `skipped` before you pass the PDF on. Fields AppliFlo was unsure about are listed in `data.warnings` and left empty rather than guessed. Choice questions, such as a set of tick boxes, report in `data.groups`, and unsure ones in `data.group_warnings`. `data.ai_pages` shows the workspace's [AI pages](https://dev.appliflo.com/guides/plans) for this month. ## Next - [Upload, detect and fill step by step](https://dev.appliflo.com/guides/upload-detect-fill), to see each field before you fill it. - [Send a document for signature](https://dev.appliflo.com/guides/send-for-signature). - [Use AppliFlo from a coding agent](https://dev.appliflo.com/guides/coding-agent) with the MCP server. Source: https://dev.appliflo.com/guides/quickstart --- # API keys and scopes > Where to make a key, what each scope allows, and when a key stops working. Every call to the REST API and the MCP server needs a workspace API key. Send it in the `Authorization` header: ```bash curl https://appliflo.com/api/v1/envelopes \ -H "Authorization: Bearer $APPLIFLO_API_KEY" ``` ## Make a key 1. Open [Settings, API keys](https://appliflo.com/settings/api-keys) on appliflo.com. Only an owner or admin can make keys. 2. Choose **Create key**, give it a name, tick what it can do and pick when it expires. 3. Copy the key. It is shown once. AppliFlo keeps only a hash of it, so nobody can show it to you again. API keys come with the [Business plan](https://dev.appliflo.com/guides/plans). On another plan, making a key is refused with `402` and the code `plan_feature`. Keep keys on your server or in your secret store. Never put one in a web page, a mobile app or a public repository. If a key leaks, revoke it on the same page and make a new one. ## Scopes A key can do only what its scopes allow. New keys start with **Read** and **Create drafts** ticked, so no email can go out until someone ticks **Send and void**. | Scope | In Settings | Allows | | --- | --- | --- | | `read` | Read | Every list and get: documents, fields, envelopes, templates, batches, downloads. | | `draft` | Create drafts | Upload, detect, fill and correct fields, make documents from templates, save templates. Nothing is sent. | | `send` | Send and void | Send for signature, send templates and send to many, remind, void, and a batch's retry, cancel and row fix. | A call outside the key's scopes gets `403`: ```json { "success": false, "error": "insufficient_scope", "required_scope": "send", "message": "this API key needs the 'send' scope" } ``` The MCP server checks the same scope for each tool. Each tool's page under [MCP tools](https://dev.appliflo.com/mcp/tools) says what it needs. Keys made before scopes existed have full access. ## Expiry A key can expire in 30, 90 or 365 days, or never. After its expiry date, calls get `401` with `api_key_expired`, so your code can tell an old key from a wrong one: ```json { "success": false, "error": "api_key_expired" } ``` Make a new key in Settings and swap it in. A missing or wrong key gets `401` with `invalid or missing API key`. ## Who the key acts as A key acts for its workspace. Usage is counted against the workspace, and [AI pages](https://dev.appliflo.com/guides/plans) used through the API are charged to the person who made the key. A key can delete only documents it created through the API, never a person's upload. Source: https://dev.appliflo.com/guides/api-keys --- # Errors > The error shape, every status code the API returns, and the codes to branch on. A failed call returns `success: false` and a message in `error`. Many refusals add a stable `code` for your code to branch on. Plan refusals also carry `plansUrl`. ```json { "success": false, "code": "template_not_ready", "error": "This template is still a draft. An owner or admin needs to finalise it before it can be sent." } ``` Branch on `code` when it is there. A few older refusals put their stable word in `error` instead, such as `api_key_expired`, `insufficient_scope` and `idempotency_key_reused`; they are listed below. Never branch on the wording of a message: it is written for people and can change. ## Status codes | Status | When | Codes and messages | | --- | --- | --- | | `400` | The MCP server got a body that is not JSON. The REST API answers bad JSON with `422`. | JSON-RPC error `-32700` | | `401` | The key is missing, wrong or past its expiry. | `invalid or missing API key`, `api_key_expired` | | `402` | The workspace's plan does not include this. | `plan_feature`, `plan_limit` | | `403` | The key may not do this, or the workspace is not active. | `insufficient_scope`, `forbidden`, `workspace suspended`, `workspace_pending`, `workspace_unavailable`, `legal_acceptance_required` | | `404` | Not found in this workspace. Another workspace's ids are also `404`. | `not found`, `not_found` | | `409` | The request is fine, but the current state refuses it. | `request already in progress`, `contract_risk_required`, `template_not_ready`, `version_mismatch`, `too_many_running`, `batch_finished`, `not_fixable` | | `413` | The file is too big or has too many pages. | `file too large` | | `415` | The upload is not a PDF or DOCX. | `unsupported file type` | | `422` | The request failed a check. | `invalid request`, `idempotency_key_reused`, `esign_not_allowed`, `esign_ack_required` and the template codes below | | `429` | Too many calls. Wait for the `Retry-After` header's seconds. | `rate limit exceeded`, `rate_limited` | | `500` | Something went wrong on our side. Retry with the same `Idempotency-Key`. | `internal error` | Each endpoint lists its own errors on its page in the [API reference](https://dev.appliflo.com/api). ## 401: the key `invalid or missing API key` means the header is missing or the key is wrong or revoked. `api_key_expired` means the key passed the expiry date set when it was made. Make a new key in [Settings, API keys](https://appliflo.com/settings/api-keys). See [API keys and scopes](https://dev.appliflo.com/guides/api-keys). ## 402: the plan ```json { "success": false, "code": "plan_feature", "error": "The API and MCP server are on the Business plan. This workspace is on Starter.", "plansUrl": "/pricing" } ``` - `plan_feature`: the plan does not include the feature. The API and MCP server are on the Business plan. - `plan_limit`: the action would go over a plan limit, such as recipients on one envelope. `plansUrl` is a path on appliflo.com. An owner or admin changes the plan in [Settings, Billing](https://appliflo.com/settings/billing). See [Plans and AI pages](https://dev.appliflo.com/guides/plans). ## 403: scope and workspace `insufficient_scope` comes with `required_scope`, the scope the key is missing. `forbidden` means the key may not touch that item, for example deleting a document a person uploaded. A workspace that is suspended, waiting for approval or closed gets the matching message on every call. ## 409: state | Code | What to do | | --- | --- | | `request already in progress` | A call with the same `Idempotency-Key` is still running. Wait, then retry with the same key. | | `contract_risk_required` | An AppliFlo library contract that our lawyer has not reviewed. Send again with `risk_accepted: true` once your user accepts the risk. See [Send a saved template](https://dev.appliflo.com/guides/send-template#appliflo-library-contracts) and [Send to many](https://dev.appliflo.com/guides/send-to-many#appliflo-library-contracts). | | `template_not_ready` | The saved template is still a draft. An owner or admin finalises it in the app. | | `version_mismatch` | The template was finalised again since you read it. Read it again and send the new `version`. | | `too_many_running` | Two batches are already sending. Wait for one, or cancel one. | | `batch_finished` | The batch has already finished, so it cannot be cancelled. | | `not_fixable` | Only a failed row can be fixed. | Deleting a document that has been sent, and voiding an envelope whose status can't be voided, are also `409`. ## 422: checks `invalid request` means the body did not match the endpoint's schema. Read its page in the [API reference](https://dev.appliflo.com/api). Other `422` codes: | Code | Meaning | | --- | --- | | `idempotency_key_reused` | The `Idempotency-Key` was first used with a different request. Use a new key for a new request. See [Idempotency](https://dev.appliflo.com/guides/idempotency). | | `esign_not_allowed` | The form must be signed by hand, such as USCIS I-130 or SSA SS-5. Download the filled PDF instead. See [Send for signature](https://dev.appliflo.com/guides/send-for-signature). | | `esign_ack_required` | The form's agency may reject an electronic signature. Send again with the acknowledgement once your user agrees. | | `missing_person`, `unknown_role`, `duplicate_email` | A template role has no person, a role key is wrong, or two roles share an email. | | `role_owned_field`, `unknown_field`, `locked_field` | A prefill names a box a recipient fills, a box that does not exist, or a box the template locks. | | `cc_invalid`, `subject_invalid` | A copy address or the subject is not valid. | | `signature_not_adopted` | The template has a box the sender signs. Only a signed-in sender can send it, not an API key. | | `too_many_rows`, `quota_exceeded`, `nothing_to_send` | Send to many: more than 500 rows, more envelopes than the month has left, or every row needs a fix. | | `no_change` | A row fix that changes nothing. | ## 429: slow down Every key has a budget per minute. When it runs out, the reply is `429` with a `Retry-After` header in seconds: ```http HTTP/1.1 429 Too Many Requests Retry-After: 17 { "success": false, "error": "rate limit exceeded" } ``` Wait that long, then retry. See [Rate limits](https://dev.appliflo.com/guides/rate-limits). Each workspace also has a daily envelope limit, lower while the workspace is new. Going over it is a `429` too, with a message saying to try again tomorrow. ## Other server errors `502` means a connected CRM did not answer during a prefill. `503` means sending is paused on our side for a while, with a `code`. `504` means reading the form took too long; try again. For any `5xx`, retry with the same `Idempotency-Key` so nothing is done twice. Source: https://dev.appliflo.com/guides/errors --- # Rate limits > 120 calls a minute per key, and a shared 20 a minute for the calls that read, fill and send. Limits are per API key and count calls in a rolling minute. A call with a missing or wrong key is refused before it is counted, so nobody can use up your budget by guessing keys. | Budget | Limit | Counts | | --- | --- | --- | | Standard | 120 calls a minute per key | Every call to the REST API and the MCP server. | | Shared pool | 20 calls a minute per key, shared | The calls that read a form, fill it or send email, listed below. | The shared pool is one budget for all of these together, not 20 each: - `POST /api/v1/fill` - `POST /api/v1/documents/{id}/detect` - `POST /api/v1/documents/{id}/fill` - `POST /api/v1/documents/{id}/send` - `POST /api/v1/templates/{id}/create-document` - `POST /api/v1/templates/{id}/send` - `POST /api/v1/templates/{id}/bulk` - `POST /api/v1/bulk-batches/{id}/retry-failed` - `PATCH /api/v1/bulk-batches/{id}/rows/{row}` On the MCP server, these tools use the same shared pool: `detect_fields`, `fill_document`, `fill_form_oneshot`, `send_envelope`, `create_from_template`, `send_template`, `send_template_bulk` and `fix_bulk_row`. Every other tool uses the standard budget. Send to many has one more limit: a key can start at most 10 batches a minute, and a workspace can have at most 2 batches sending at once (`409 too_many_running`). ## When you hit a limit The reply is `429` with a `Retry-After` header, in seconds: ```http HTTP/1.1 429 Too Many Requests Retry-After: 17 { "success": false, "error": "rate limit exceeded" } ``` Wait that many seconds, then send the same request again with the same `Idempotency-Key`. The MCP server answers `429` the same way, with JSON-RPC error `-32029`. **Node** ```js async function withRetry(call) { for (let attempt = 0; attempt < 5; attempt++) { const res = await call(); if (res.status !== 429) return res; const wait = Number(res.headers.get("retry-after") ?? "1"); await new Promise((r) => setTimeout(r, wait * 1000)); } throw new Error("still rate limited after 5 tries"); } ``` **Python** ```python import time def with_retry(call): for _ in range(5): res = call() if res.status_code != 429: return res time.sleep(int(res.headers.get("Retry-After", "1"))) raise RuntimeError("still rate limited after 5 tries") ``` ## Staying under the limit - Fill many documents one after another rather than all at once. - To send one template to many people, use [send to many](https://dev.appliflo.com/guides/send-to-many): one call queues up to 500 envelopes, sent for you at a steady pace. - Poll an envelope or a batch every few seconds at most. Source: https://dev.appliflo.com/guides/rate-limits --- # Idempotency > Retry a call safely with the Idempotency-Key header, so nothing is uploaded, filled or sent twice. A network error can leave you unsure whether a call worked. Send an `Idempotency-Key` header and you can simply send the call again: AppliFlo returns the first answer instead of doing the work twice. ```bash curl -X POST https://appliflo.com/api/v1/documents/$DOCUMENT_ID/send \ -H "Authorization: Bearer $APPLIFLO_API_KEY" \ -H "Content-Type: application/json" \ -H "Idempotency-Key: send-order-4821" \ -d '{"subject":"Please sign your lease","routing":"parallel","recipients":[{"name":"Lan Nguyen","email":"lan@example.com","role":"signer"}]}' ``` ## How it works - The key is any string you choose, unique to the action. A UUID, or your own record id plus the action, both work. - A repeat within 24 hours with the same key and the same request returns the first response. Nothing new is uploaded, filled or sent. - A repeat while the first call is still running gets `409` with `request already in progress`. Wait a moment and retry. - The same key with a different body or target is refused with `422` and `idempotency_key_reused`. Use a new key for a new request. - If the first call failed, nothing is stored, so a retry with the same key runs again. - After 24 hours the key is forgotten and can be used again. Keys are kept per workspace and per endpoint. ## Which calls take it | Call | What a retry avoids | | --- | --- | | `POST /api/v1/documents` | A second copy of the upload. | | `POST /api/v1/fill` | Filling the PDF twice. | | `POST /api/v1/documents/{id}/detect` | Reading the form twice. | | `POST /api/v1/documents/{id}/fill` | Filling twice. | | `POST /api/v1/documents/{id}/send` | Emailing the recipients twice. | | `POST /api/v1/templates/{id}/create-document` | A second draft. | | `POST /api/v1/templates/{id}/send` | A second envelope. | | `POST /api/v1/templates/{id}/bulk` | A second batch. It returns the batch the key already made. | | `POST /api/v1/saved-templates/{id}/create-document` | A second draft. | On the MCP server, `upload_document`, `fill_document`, `send_envelope`, `create_from_template`, `send_template` and `send_template_bulk` take an `idempotency_key` input that works the same way. ## Retry rules of thumb - Always send a key on calls that email people. - Retry on network errors, `429` and `5xx`, with the same key. - Do not retry `4xx` errors other than `409 request already in progress` and `429` without changing the request, and then use a new key. Source: https://dev.appliflo.com/guides/idempotency --- # Plans and AI pages > API keys need the Business plan. What an AI page is, how many each plan has, and the prices in USD and AUD. ## The API is on Business The REST API and the MCP server come with the Business plan. On Free or Starter, making a key, and any call with a key, is refused with `402` and the code `plan_feature`: ```json { "success": false, "code": "plan_feature", "error": "The API and MCP server are on the Business plan. This workspace is on Starter.", "plansUrl": "/pricing" } ``` An owner or admin changes the plan in [Settings, Billing](https://appliflo.com/settings/billing). See every plan on [appliflo.com/pricing](https://appliflo.com/pricing). ## Prices Starter and Business are priced per user, per month. Free is free for the whole workspace. Australian workspaces pay in AUD, including GST. Everyone else pays in USD, excluding tax. | Plan | USD monthly | USD billed annually | AUD monthly, incl. GST | AUD billed annually, incl. GST | | --- | --- | --- | --- | --- | | Free | $0 | $0 | A$0 | A$0 | | Starter | $15 | $12 | A$24 | A$19 | | Business | $29 | $24 | A$45 | A$37 | The annual price is what you pay per month when billed once a year. ## AI pages An AI page is one page AppliFlo reads with AI. Official forms, saved templates and Fill as me never use AI pages. | Plan | AI pages a month | Extra pages | | --- | --- | --- | | Free | 25, for the whole workspace | None | | Starter | 300 a user | Blocks of 100, US$5 a block | | Business | 1,000 a user, shared across the workspace | Blocks of 100, US$4 a block | From the API, these calls can use AI pages: `POST /api/v1/documents/{id}/detect` and `POST /api/v1/fill`. A page with built-in fillable fields is read without AI. AI pages used through the API are charged to the person who made the API key. The reply shows where you stand in `data.ai_pages`: ```json { "used": 412, "limit": 1000, "remaining": 588, "exhausted": false, "resets_at": "2026-12-01T00:00:00.000Z" } ``` When the pages run out, calls still work: forms are read without AI, so only built-in fillable fields are found. `exhausted` is `true`, and detect also sets `vision_skipped: true`. Buy more pages in Settings, Billing, where the block price is shown in your currency, or wait for `resets_at`. Source: https://dev.appliflo.com/guides/plans --- # Fill a PDF in one call > Send a PDF and values keyed by the printed labels, get back the filled PDF and a result for every field. Use one-shot fill when you have a PDF and know what goes on it, and you do not need to keep the document in AppliFlo. Nothing is stored: the filled PDF comes back in the reply. You need a key with the `draft` scope. See [API keys and scopes](https://dev.appliflo.com/guides/api-keys). ## Send the PDF and values `POST /api/v1/fill` takes a multipart body with two fields: | Field | What it is | | --- | --- | | `file` | The PDF, up to 20 MB. | | `values` | A JSON object as a string. Keys are the labels printed on the form, values are what to write. | **curl** ```bash curl -X POST https://appliflo.com/api/v1/fill \ -H "Authorization: Bearer $APPLIFLO_API_KEY" \ -H "Idempotency-Key: fill-lease-7731" \ -F "file=@lease-application.pdf" \ -F 'values={"Full name":"Lan Nguyen","Date of birth":"1991-04-17","Email":"lan@example.com","Title":"Ms"}' ``` **Node** ```js import { readFile, writeFile } from "node:fs/promises"; const form = new FormData(); form.append("file", new Blob([await readFile("lease-application.pdf")], { type: "application/pdf" }), "lease-application.pdf"); form.append("values", JSON.stringify({ "Full name": "Lan Nguyen", "Date of birth": "1991-04-17", "Email": "lan@example.com", "Title": "Ms", })); const res = await fetch("https://appliflo.com/api/v1/fill", { method: "POST", headers: { Authorization: `Bearer ${process.env.APPLIFLO_API_KEY}`, "Idempotency-Key": "fill-lease-7731" }, body: form, }); const { success, data, error } = await res.json(); if (!success) throw new Error(error); await writeFile("lease-filled.pdf", Buffer.from(data.pdf_base64, "base64")); ``` **Python** ```python import base64, json, os, requests res = requests.post( "https://appliflo.com/api/v1/fill", headers={ "Authorization": f"Bearer {os.environ['APPLIFLO_API_KEY']}", "Idempotency-Key": "fill-lease-7731", }, files={"file": open("lease-application.pdf", "rb")}, data={"values": json.dumps({ "Full name": "Lan Nguyen", "Date of birth": "1991-04-17", "Email": "lan@example.com", "Title": "Ms", })}, ) body = res.json() if not body["success"]: raise RuntimeError(body["error"]) open("lease-filled.pdf", "wb").write(base64.b64decode(body["data"]["pdf_base64"])) ``` ## How values are matched - A key matches a field by the label printed next to the box, such as `"Full name"`. - A choice question, such as a row of tick boxes, is matched by its question label. Give one option, or a list of options for a question that allows several. Name an option by its printed text or its value. - Dates, phone numbers and similar values are changed to the form's format. Those come back as `formatted`. - Labels you send that match nothing are ignored. Fields you send nothing for are left empty. If a label is ambiguous, use the [step by step flow](https://dev.appliflo.com/guides/upload-detect-fill) instead: it gives you each field's id, and you fill by id. ## Check the results Look at every result before you use the PDF: ```js const problems = data.results.filter((r) => r.status === "overflowed" || r.status === "skipped"); const unsure = data.warnings ?? []; ``` - `overflowed`: the value did not fit even at the smallest size and was not written. Shorten it, or use the step by step flow and [correct the field](https://dev.appliflo.com/guides/correct-fields). - `skipped`: not written. `reason` is `empty`, `invalid-format`, `invalid-value`, `unsupported-type` or `not-needed` (a form rule says this box is not needed). - `data.warnings`: fields AppliFlo was unsure about. They are never guessed, so they stay empty. - `data.group_warnings`: choice questions AppliFlo was unsure about, also left empty. Field ids in a one-shot reply, such as `field_12`, only name fields within that reply. To keep a document and get it signed, [upload it](https://dev.appliflo.com/guides/upload-detect-fill) and [send it for signature](https://dev.appliflo.com/guides/send-for-signature). ## Limits and AI pages Each call counts against the shared 20 calls a minute per key, together with detect, fill and send. See [Rate limits](https://dev.appliflo.com/guides/rate-limits). Reading a form without built-in fillable fields uses [AI pages](https://dev.appliflo.com/guides/plans), one per page. `data.ai_pages` shows what is left this month. When they run out, the call still works with built-in fillable fields only. Source: https://dev.appliflo.com/guides/fill-one-call --- # Upload, detect and fill step by step > Keep the document in AppliFlo, see every field with its id, fill by id and download the filled PDF. Use this flow when you want to see the fields before filling, fill the same document more than once, or send it for signature afterwards. It takes four calls. You need a key with the `read` and `draft` scopes. ### Upload the document Send a PDF or a Word file (DOCX) in the multipart field `file`, up to 20 MB. A DOCX is turned into a PDF. **curl** ```bash curl -X POST https://appliflo.com/api/v1/documents \ -H "Authorization: Bearer $APPLIFLO_API_KEY" \ -H "Idempotency-Key: upload-lease-7731" \ -F "file=@lease-application.pdf" ``` **Node** ```js import { readFile } from "node:fs/promises"; const form = new FormData(); form.append("file", new Blob([await readFile("lease-application.pdf")], { type: "application/pdf" }), "lease-application.pdf"); const res = await fetch("https://appliflo.com/api/v1/documents", { method: "POST", headers: { Authorization: `Bearer ${process.env.APPLIFLO_API_KEY}`, "Idempotency-Key": "upload-lease-7731" }, body: form, }); const { data: doc } = await res.json(); const documentId = doc.id; ``` **Python** ```python import os, requests headers = {"Authorization": f"Bearer {os.environ['APPLIFLO_API_KEY']}"} res = requests.post( "https://appliflo.com/api/v1/documents", headers={**headers, "Idempotency-Key": "upload-lease-7731"}, files={"file": open("lease-application.pdf", "rb")}, ) document_id = res.json()["data"]["id"] ``` The reply is `201` with `data.id`, `data.name` and `data.status` (`draft`). ### Detect the fields **curl** ```bash curl -X POST https://appliflo.com/api/v1/documents/$DOCUMENT_ID/detect \ -H "Authorization: Bearer $APPLIFLO_API_KEY" ``` **Node** ```js const detect = await fetch(`https://appliflo.com/api/v1/documents/${documentId}/detect`, { method: "POST", headers: { Authorization: `Bearer ${process.env.APPLIFLO_API_KEY}` }, }); const { data: found } = await detect.json(); console.log(found.fields.length, "fields,", found.flagged_count, "to check"); ``` **Python** ```python found = requests.post( f"https://appliflo.com/api/v1/documents/{document_id}/detect", headers=headers, ).json()["data"] print(len(found["fields"]), "fields,", found["flagged_count"], "to check") ``` The reply lists `data.fields` and the choice questions in `data.groups`. Each field has: | Key | What it tells you | | --- | --- | | `id` | The id you fill and correct it by. | | `label_text` | The label printed on the form. | | `semantic_type` | What kind of value it takes, such as `date`, `email`, `checkbox` or `signature`. | | `flagged` | `true` when AppliFlo is unsure about it. Check it before you fill. | | `page`, `bbox` | Where it is. | `data.flagged_count` says how many fields need a look. `data.vision_skipped` is `true` when the month's [AI pages](https://dev.appliflo.com/guides/plans) ran out and only built-in fillable fields were found. You can read the fields again later with `GET /api/v1/documents/{id}/fields`. ### Fill by field id Send `values` keyed by field id. For a choice question, use its group id from `groups[].id` and give one option, or a list for a question that allows several. **curl** ```bash curl -X POST https://appliflo.com/api/v1/documents/$DOCUMENT_ID/fill \ -H "Authorization: Bearer $APPLIFLO_API_KEY" \ -H "Content-Type: application/json" \ -d '{"values":{"fld_full_name":"Lan Nguyen","fld_dob":"1991-04-17","grp_title":"Ms"}}' ``` **Node** ```js const fill = await fetch(`https://appliflo.com/api/v1/documents/${documentId}/fill`, { method: "POST", headers: { Authorization: `Bearer ${process.env.APPLIFLO_API_KEY}`, "Content-Type": "application/json", }, body: JSON.stringify({ values: { fld_full_name: "Lan Nguyen", fld_dob: "1991-04-17", grp_title: "Ms", }, }), }); const { data: filled } = await fill.json(); console.log(filled.results, filled.groups); ``` **Python** ```python filled = requests.post( f"https://appliflo.com/api/v1/documents/{document_id}/fill", headers=headers, json={"values": { "fld_full_name": "Lan Nguyen", "fld_dob": "1991-04-17", "grp_title": "Ms", }}, ).json()["data"] print(filled["results"], filled["groups"]) ``` Use the real ids from step 2 in place of `fld_full_name` and the others. `data.results` has one entry per field, with the same statuses as [one-shot fill](https://dev.appliflo.com/guides/fill-one-call#check-the-results). `data.groups` has one entry per choice question. If a choice answer is not one of the question's options, the call is refused with `422` and nothing is written. ### Download the filled PDF Ask for a download link with `artifact=filled`. The link is short-lived, so fetch the file straight away. **curl** ```bash curl "https://appliflo.com/api/v1/documents/$DOCUMENT_ID/download?artifact=filled" \ -H "Authorization: Bearer $APPLIFLO_API_KEY" ``` **Node** ```js const link = await fetch(`https://appliflo.com/api/v1/documents/${documentId}/download?artifact=filled`, { headers: { Authorization: `Bearer ${process.env.APPLIFLO_API_KEY}` }, }); const { data: download } = await link.json(); const pdf = Buffer.from(await (await fetch(download.url)).arrayBuffer()); ``` **Python** ```python url = requests.get( f"https://appliflo.com/api/v1/documents/{document_id}/download?artifact=filled", headers=headers, ).json()["data"]["url"] open("lease-filled.pdf", "wb").write(requests.get(url).content) ``` ## Next - Fix a field AppliFlo got wrong: [Correct fields](https://dev.appliflo.com/guides/correct-fields). - Send the document for signature: [Send for signature](https://dev.appliflo.com/guides/send-for-signature). - Use it again and again: save it as a template with `POST /api/v1/saved-templates`, then [send the template](https://dev.appliflo.com/guides/send-template). Source: https://dev.appliflo.com/guides/upload-detect-fill --- # Send a document for signature > Pick recipients, give each one their fields, prefill what you know and send. Includes the rules for official agency forms. Sending turns a draft document into an envelope and emails the first recipients a signing link. You need a key with the `send` scope, and a document with its fields detected. See [Upload, detect and fill](https://dev.appliflo.com/guides/upload-detect-fill). ## Send it **curl** ```bash curl -X POST https://appliflo.com/api/v1/documents/$DOCUMENT_ID/send \ -H "Authorization: Bearer $APPLIFLO_API_KEY" \ -H "Content-Type: application/json" \ -H "Idempotency-Key: send-lease-7731" \ -d '{ "subject": "Please sign your lease application", "message": "Hi Lan, please check the details and sign.", "routing": "sequential", "recipients": [ { "name": "Lan Nguyen", "email": "lan@example.com", "role": "signer" }, { "name": "Sam Patel", "email": "sam@example.com", "role": "signer" }, { "name": "Office", "email": "office@example.com", "role": "cc" } ], "assignments": [ { "fieldId": "fld_tenant_signature", "recipientIndex": 0 }, { "fieldId": "fld_agent_signature", "recipientIndex": 1 } ], "values": { "fld_property_address": "12 Rose St, Parramatta NSW 2150" } }' ``` **Node** ```js const res = await fetch(`https://appliflo.com/api/v1/documents/${documentId}/send`, { method: "POST", headers: { Authorization: `Bearer ${process.env.APPLIFLO_API_KEY}`, "Content-Type": "application/json", "Idempotency-Key": "send-lease-7731", }, body: JSON.stringify({ subject: "Please sign your lease application", message: "Hi Lan, please check the details and sign.", routing: "sequential", recipients: [ { name: "Lan Nguyen", email: "lan@example.com", role: "signer" }, { name: "Sam Patel", email: "sam@example.com", role: "signer" }, { name: "Office", email: "office@example.com", role: "cc" }, ], assignments: [ { fieldId: "fld_tenant_signature", recipientIndex: 0 }, { fieldId: "fld_agent_signature", recipientIndex: 1 }, ], values: { fld_property_address: "12 Rose St, Parramatta NSW 2150" }, }), }); const { data } = await res.json(); console.log(data.envelopeId, data.invited); ``` **Python** ```python import os, requests headers = {"Authorization": f"Bearer {os.environ['APPLIFLO_API_KEY']}"} res = requests.post( f"https://appliflo.com/api/v1/documents/{document_id}/send", headers={**headers, "Idempotency-Key": "send-lease-7731"}, json={ "subject": "Please sign your lease application", "message": "Hi Lan, please check the details and sign.", "routing": "sequential", "recipients": [ {"name": "Lan Nguyen", "email": "lan@example.com", "role": "signer"}, {"name": "Sam Patel", "email": "sam@example.com", "role": "signer"}, {"name": "Office", "email": "office@example.com", "role": "cc"}, ], "assignments": [ {"fieldId": "fld_tenant_signature", "recipientIndex": 0}, {"fieldId": "fld_agent_signature", "recipientIndex": 1}, ], "values": {"fld_property_address": "12 Rose St, Parramatta NSW 2150"}, }, ) data = res.json()["data"] print(data["envelopeId"], data["invited"]) ``` The reply is `201` with `data.envelopeId`, `data.invited` (people emailed now) and `data.prefilled`. Keep the envelope id to [track it](https://dev.appliflo.com/guides/track-envelopes). ## What each part does | Key | What it does | | --- | --- | | `routing` | `parallel` emails everyone at once. `sequential` emails one recipient at a time, in list order. | | `recipients[].role` | `signer` fills their fields and signs. `filler` fills their fields without signing. `cc` gets the finished copy and can never have fields. At least one signer is needed. | | `recipients[].accessCode` | `email` (the default) emails each signer and filler a one-time code to enter before signing. `none` turns it off for that person. | | `assignments` | Gives a field to a recipient, by field id and the recipient's place in `recipients` (0 is the first). | | `values` | What you know already, by field id, or by group id for a choice question. Signature fields and fields you give to a recipient can't be prefilled. | | `reminderCadence` | Automatic reminders. By default they are on, every 24 hours. You can only make them less frequent. | ## Official agency forms AppliFlo knows the official government forms it hosts, and some agencies do not accept an electronic signature on them. - **Fill and print only.** Some forms must be signed by hand: USCIS forms such as I-130, I-485, I-765, I-864, I-864A, I-134 and G-28, SSA SS-5, IRS 8879 and 4506-C, and the Commonwealth statutory declaration. Any send of these is refused with `422 esign_not_allowed`, whatever else you send. Fill the form, [download the filled PDF](https://dev.appliflo.com/guides/upload-detect-fill#download-the-filled-pdf), and have it printed and signed by hand. - **Acknowledge first.** For a form whose agency may reject an electronic signature, the send needs `"esignRiskAcknowledged": true`, or it is refused with `422 esign_ack_required`. Only set it after your user has agreed. AppliFlo records the acknowledgement on the envelope. No form needs this today, but handle the code so your integration keeps working if one is added. Sending a template uses `esign_risk_acknowledged` for the same thing. See [Send a saved template](https://dev.appliflo.com/guides/send-template). ## Common refusals | Status | Code or message | Fix | | --- | --- | --- | | `422` | a field given to a `cc` | Give it to a signer or filler. | | `422` | `esign_not_allowed` | Download the filled PDF instead of sending. | | `422` | `esign_ack_required` | Ask your user, then send `esignRiskAcknowledged: true`. | | `403` | `insufficient_scope` | The key needs the `send` scope. | | `409` | `request already in progress` | The same `Idempotency-Key` is still running. Wait and retry. | Source: https://dev.appliflo.com/guides/send-for-signature --- # Send a saved template > Find a Ready saved template, put a person in each role, prefill the sender's boxes and send it in one call. A saved template is a form your workspace has set up once in AppliFlo: its fields, its recipient roles in signing order, and the boxes the sender fills. Sending one is a single call. You need a key with the `read` and `send` scopes. ### Find the template and its roles **curl** ```bash curl "https://appliflo.com/api/v1/saved-templates?q=lease" \ -H "Authorization: Bearer $APPLIFLO_API_KEY" ``` **Node** ```js const res = await fetch("https://appliflo.com/api/v1/saved-templates?q=lease", { headers: { Authorization: `Bearer ${process.env.APPLIFLO_API_KEY}` }, }); const { data } = await res.json(); const template = data.saved_templates.find((t) => t.status === "ready"); console.log(template.template_id, template.roles, template.sender_fields); ``` **Python** ```python import os, requests headers = {"Authorization": f"Bearer {os.environ['APPLIFLO_API_KEY']}"} templates = requests.get( "https://appliflo.com/api/v1/saved-templates?q=lease", headers=headers, ).json()["data"]["saved_templates"] template = next(t for t in templates if t["status"] == "ready") ``` Each item in `data.saved_templates` has what you need to send it: | Key | What it is | | --- | --- | | `template_id` | The id to send. | | `status` | Only `ready` templates can be sent. A `draft` is refused with `409 template_not_ready`. | | `version` | The current version. A send uses it unless you pin another. | | `roles` | One per recipient, in signing order. Each has a `key` such as `r1`, a `label` such as `Client`, and a `kind`: `signer` or `filler`. | | `sender_fields` | The boxes you fill, each by its `index`. | | `fixed_fields` | Boxes the template fills itself. `locked: false` ones can be changed with `fixed_overrides`. | `GET /api/v1/templates/{id}` returns one template in the same shape. To start from AppliFlo's own templates too, use `GET /api/v1/templates`: its `items` list your saved templates, AppliFlo's contract templates (`kind: "library"`) and the official government forms (`kind: "official"`, with `official_form` and `country`). Filter with `kind`, `q` (a name or a form code such as `956`) and `country`. A `ready` item with a `lib_` id sends the same way. One with `status: "draft"` is a form AppliFlo hasn't set up: `POST /api/v1/templates/{id}/create-document` imports it as a document with its fields read, and you send that document. ### Send it Give one person per role in `recipients`, by role key or label, and prefill the sender's boxes by index. **curl** ```bash curl -X POST https://appliflo.com/api/v1/templates/$TEMPLATE_ID/send \ -H "Authorization: Bearer $APPLIFLO_API_KEY" \ -H "Content-Type: application/json" \ -H "Idempotency-Key: lease-send-7731" \ -d '{ "recipients": [ { "role": "r1", "name": "Lan Nguyen", "email": "lan@example.com" }, { "role": "r2", "name": "Sam Patel", "email": "sam@example.com" } ], "prefill": { "3": "12 Rose St, Parramatta NSW 2150", "4": "2026-08-01" }, "cc": [{ "email": "office@example.com", "name": "Office" }] }' ``` **Node** ```js const send = await fetch(`https://appliflo.com/api/v1/templates/${templateId}/send`, { method: "POST", headers: { Authorization: `Bearer ${process.env.APPLIFLO_API_KEY}`, "Content-Type": "application/json", "Idempotency-Key": "lease-send-7731", }, body: JSON.stringify({ recipients: [ { role: "r1", name: "Lan Nguyen", email: "lan@example.com" }, { role: "r2", name: "Sam Patel", email: "sam@example.com" }, ], prefill: { "3": "12 Rose St, Parramatta NSW 2150", "4": "2026-08-01" }, cc: [{ email: "office@example.com", name: "Office" }], }), }); const { data: sent } = await send.json(); console.log(sent.envelope_id, sent.template_version); ``` **Python** ```python sent = requests.post( f"https://appliflo.com/api/v1/templates/{template_id}/send", headers={**headers, "Idempotency-Key": "lease-send-7731"}, json={ "recipients": [ {"role": "r1", "name": "Lan Nguyen", "email": "lan@example.com"}, {"role": "r2", "name": "Sam Patel", "email": "sam@example.com"}, ], "prefill": {"3": "12 Rose St, Parramatta NSW 2150", "4": "2026-08-01"}, "cc": [{"email": "office@example.com", "name": "Office"}], }, ).json()["data"] print(sent["envelope_id"], sent["template_version"]) ``` The reply is `201` with `data.envelope_id`, `data.invited` and `data.template_version`. The template's own copies, reminders and expiry apply. The template itself never changes, and the envelope keeps the version it was sent from. ## Options | Key | What it does | | --- | --- | | `version` | Send an older finalised version. `GET /api/v1/templates/{id}/versions` lists them. | | `subject`, `message` | Replace the template's email. Placeholders such as `{{Recipient first name}}` are filled for each person. | | `fixed_overrides` | Change a template box that is not locked, by `fixed_fields[].index`. A locked box is refused with `422 locked_field`. | | `local_day` | Your own date (`YYYY-MM-DD`) for boxes that print the date it was sent. | | `esign_risk_acknowledged` | For a form whose agency may reject an electronic signature. See [official agency forms](https://dev.appliflo.com/guides/send-for-signature#official-agency-forms). | | `risk_accepted` | For an AppliFlo library contract our lawyer has not reviewed. See [below](#appliflo-library-contracts). | | `recipients[].accessCode` | `email` (default) or `none`, as for a [document send](https://dev.appliflo.com/guides/send-for-signature#what-each-part-does). | A template with a box the sender signs can only be sent by a signed-in person, so an API key gets `422 signature_not_adopted`. ## AppliFlo library contracts Some contracts in the AppliFlo library have not been reviewed by our lawyer yet. Sending one is at your own risk, under section 8A of the [Terms](https://appliflo.com/terms). If you have not accepted that for this version of the contract, in the app or on an earlier send, the send is refused with `409 contract_risk_required`. Once your user has read and accepted it, send again with `"risk_accepted": true`. AppliFlo records the acceptance only when the send goes ahead. ## Make a draft instead of sending To change something before sending, make a draft document from the template with `POST /api/v1/saved-templates/{id}/create-document`. Its fields are already placed, so skip detection and [send it](https://dev.appliflo.com/guides/send-for-signature) when ready. ## Refusals | Status | Code | Fix | | --- | --- | --- | | `409` | `template_not_ready` | An owner or admin finalises the template in the app. | | `409` | `contract_risk_required` | See [AppliFlo library contracts](#appliflo-library-contracts). | | `422` | `missing_person`, `unknown_role`, `duplicate_email` | One person per role, a real role key or label, a different email for each role. | | `422` | `role_owned_field`, `unknown_field` | Prefill only `sender_fields` by their `index`. | | `422` | `esign_not_allowed`, `esign_ack_required` | See [official agency forms](https://dev.appliflo.com/guides/send-for-signature#official-agency-forms). | Source: https://dev.appliflo.com/guides/send-template --- # Send to many > Send one Ready template to up to 500 people in one call, watch the batch, and fix the rows that fail. Send to many makes one envelope per row from a Ready saved template, and sends them in the background at a steady pace. You need a key with the `read` and `send` scopes. Read the template first, as in [Send a saved template](https://dev.appliflo.com/guides/send-template): you need its `template_id`, its current `version`, its role keys and its `sender_fields`. ### Start the batch Each row has `people`, one person per role key, and an optional `prefill` for that row's sender boxes. **curl** ```bash curl -X POST https://appliflo.com/api/v1/templates/$TEMPLATE_ID/bulk \ -H "Authorization: Bearer $APPLIFLO_API_KEY" \ -H "Content-Type: application/json" \ -H "Idempotency-Key: renewals-2026-11" \ -d '{ "version": 3, "time_zone": "Australia/Sydney", "rows": [ { "people": { "r1": { "name": "Lan Nguyen", "email": "lan@example.com" } }, "prefill": { "3": "Unit 4, 12 Rose St" } }, { "people": { "r1": { "name": "Omar Haddad", "email": "omar@example.com" } }, "prefill": { "3": "Unit 9, 12 Rose St" } } ] }' ``` **Node** ```js const res = await fetch(`https://appliflo.com/api/v1/templates/${templateId}/bulk`, { method: "POST", headers: { Authorization: `Bearer ${process.env.APPLIFLO_API_KEY}`, "Content-Type": "application/json", "Idempotency-Key": "renewals-2026-11", }, body: JSON.stringify({ version: 3, time_zone: "Australia/Sydney", rows: [ { people: { r1: { name: "Lan Nguyen", email: "lan@example.com" } }, prefill: { "3": "Unit 4, 12 Rose St" } }, { people: { r1: { name: "Omar Haddad", email: "omar@example.com" } }, prefill: { "3": "Unit 9, 12 Rose St" } }, ], }), }); const { data: batch } = await res.json(); console.log(batch.batch_id, batch.counts); ``` **Python** ```python import os, requests headers = {"Authorization": f"Bearer {os.environ['APPLIFLO_API_KEY']}"} batch = requests.post( f"https://appliflo.com/api/v1/templates/{template_id}/bulk", headers={**headers, "Idempotency-Key": "renewals-2026-11"}, json={ "version": 3, "time_zone": "Australia/Sydney", "rows": [ {"people": {"r1": {"name": "Lan Nguyen", "email": "lan@example.com"}}, "prefill": {"3": "Unit 4, 12 Rose St"}}, {"people": {"r1": {"name": "Omar Haddad", "email": "omar@example.com"}}, "prefill": {"3": "Unit 9, 12 Rose St"}}, ], }, ).json()["data"] print(batch["batch_id"], batch["counts"]) ``` The reply is `202` with `data.batch_id`, `data.counts` and a report for each row in `data.rows`. A row with a problem, such as a blank row, a missing or invalid email, or two roles sharing an email, is left out with `status: "excluded"` and its `issues`. The rest are queued. `time_zone` makes date boxes such as "Date it's sent" use your own day. It defaults to UTC. ### Watch the batch Poll `GET /api/v1/bulk-batches/{id}` every few seconds until `status` is `done` or `cancelled`. **Node** ```js let state; do { await new Promise((r) => setTimeout(r, 5000)); const poll = await fetch(`https://appliflo.com/api/v1/bulk-batches/${batchId}`, { headers: { Authorization: `Bearer ${process.env.APPLIFLO_API_KEY}` }, }); state = (await poll.json()).data; console.log(state.status, state.counts); } while (state.status !== "done" && state.status !== "cancelled"); ``` **Python** ```python import time while True: time.sleep(5) state = requests.get( f"https://appliflo.com/api/v1/bulk-batches/{batch_id}", headers=headers, ).json()["data"] print(state["status"], state["counts"]) if state["status"] in ("done", "cancelled"): break ``` | `status` | Meaning | | --- | --- | | `queued`, `sending` | Envelopes are going out. | | `paused` | Waiting. `pause_reason` is `quota` (this month's envelopes ran out) or `suspended`. It carries on by itself. | | `done` | Every row was sent, failed or left out. | | `cancelled` | Stopped. Envelopes already sent are kept. | Each row in `data.rows` has its `status`, its `envelope_id` once sent, and for a failure its `error`, `error_code` and `needs_fix`. ### Retry or fix failed rows - `POST /api/v1/bulk-batches/{id}/retry-failed` sends every failed row again. It is safe to repeat: no envelope is sent twice. Use it when `error_code` is `transient`. - When `needs_fix` is `true`, the email provider refused the address or it bounced, so retrying as is can't help. Change the row with `PATCH /api/v1/bulk-batches/{id}/rows/{row}`, which checks it again and sends it. ```bash curl -X PATCH https://appliflo.com/api/v1/bulk-batches/$BATCH_ID/rows/2 \ -H "Authorization: Bearer $APPLIFLO_API_KEY" \ -H "Content-Type: application/json" \ -d '{"people":{"r1":{"name":"Omar Haddad","email":"omar.haddad@example.com"}}}' ``` To stop a batch, `POST /api/v1/bulk-batches/{id}/cancel`. Rows not sent yet are cancelled. Envelopes already sent stay sent; [void them](https://dev.appliflo.com/guides/track-envelopes#void-an-envelope) one by one if needed. Retry, row fixes and cancel act on the first call. There is no confirm step on the REST API. ## AppliFlo library contracts Some contracts in the AppliFlo library have not been reviewed by our lawyer yet. Sending one to many is at your own risk, under section 8A of the [Terms](https://appliflo.com/terms). Without your confirmation the batch is refused with `409 contract_risk_required`. Once your user has read and accepted that, send `"risk_accepted": true` with the batch. It is needed on every batch you start. ## Limits - At most 500 rows a call (`422 too_many_rows`). - The batch must fit the envelopes left this month (`422 quota_exceeded`). - At most 2 batches sending at once per workspace (`409 too_many_running`). - At most 10 batches started a minute per key (`429` with `Retry-After`). - `version` must be the template's current version (`409 version_mismatch`). Read the template again and retry. - If every row has a problem, the call is refused with `422 nothing_to_send` and the report for every row. Each envelope sent counts once, like a single send. Source: https://dev.appliflo.com/guides/send-to-many --- # Track and download envelopes > List envelopes, see who has signed, send a reminder, void one, and download the signed PDF and its certificate. An envelope is one document sent for signature. You need a key with the `read` scope to look, and `send` to remind or void. ## List envelopes **curl** ```bash curl "https://appliflo.com/api/v1/envelopes?status=awaiting&limit=20" \ -H "Authorization: Bearer $APPLIFLO_API_KEY" ``` **Node** ```js const res = await fetch("https://appliflo.com/api/v1/envelopes?status=awaiting&limit=20", { headers: { Authorization: `Bearer ${process.env.APPLIFLO_API_KEY}` }, }); const { data, meta } = await res.json(); for (const env of data) console.log(env.id, env.subject, `${env.recipients.signed}/${env.recipients.total} signed`); ``` **Python** ```python import os, requests headers = {"Authorization": f"Bearer {os.environ['APPLIFLO_API_KEY']}"} page = requests.get( "https://appliflo.com/api/v1/envelopes?status=awaiting&limit=20", headers=headers, ).json() for env in page["data"]: print(env["id"], env["subject"], env["recipients"]["signed"], "of", env["recipients"]["total"]) ``` `limit` is 20 by default and at most 100. Use `offset` for the next page; `meta.total` says how many there are. | `status` | Meaning | | --- | --- | | `draft` | Not sent yet. | | `awaiting` | Waiting for recipients. | | `completing` | Everyone has signed and the signed PDF is being sealed. | | `completed` | Signed and sealed. Ready to download. | | `declined` | A recipient declined to sign. | | `expired` | Passed its expiry date. | | `voided` | Cancelled by the sender. | ## See one envelope `GET /api/v1/envelopes/{id}` returns each recipient with their `status`, when they `viewedAt`, `consentedAt`, `identityVerifiedAt` and `signedAt`, and a `timeline` of what happened. `hasSealedDocument` is `true` once the signed PDF can be downloaded. To hear when an envelope changes without polling, add a [webhook](https://dev.appliflo.com/webhooks). Otherwise, poll an envelope every minute or so while you wait for it. ## Send a reminder `POST /api/v1/envelopes/{id}/remind` emails everyone who still has to act. Each person gets at most one reminder a day; the reply says how many were `reminded` and how many were held back by that limit (`rateLimited`). Reminders also go out by themselves every 24 hours unless the sender changed that. ## Void an envelope ```bash curl -X POST https://appliflo.com/api/v1/envelopes/$ENVELOPE_ID/void \ -H "Authorization: Bearer $APPLIFLO_API_KEY" \ -H "Content-Type: application/json" \ -d '{"reason":"Sent to the wrong address"}' ``` Recipients can no longer sign it. An envelope that is already completed, or already voided, can't be voided (`409`). ## Download the signed PDF When the envelope is `completed`, ask for a download link. `artifact=sealed` is the signed PDF. `artifact=certificate` is the completion certificate: who signed, when, how they were identified, and the document's fingerprint. **curl** ```bash curl "https://appliflo.com/api/v1/envelopes/$ENVELOPE_ID/download?artifact=sealed" \ -H "Authorization: Bearer $APPLIFLO_API_KEY" ``` **Node** ```js import { writeFile } from "node:fs/promises"; const link = await fetch(`https://appliflo.com/api/v1/envelopes/${envelopeId}/download?artifact=sealed`, { headers: { Authorization: `Bearer ${process.env.APPLIFLO_API_KEY}` }, }); const { data } = await link.json(); await writeFile("signed.pdf", Buffer.from(await (await fetch(data.url)).arrayBuffer())); ``` **Python** ```python url = requests.get( f"https://appliflo.com/api/v1/envelopes/{envelope_id}/download?artifact=sealed", headers=headers, ).json()["data"]["url"] open("signed.pdf", "wb").write(requests.get(url).content) ``` The link is short-lived. Fetch the file straight away and keep your own copy. Ask for a new link each time you need one. Source: https://dev.appliflo.com/guides/track-envelopes --- # Correct fields and read each box > What AppliFlo tells you about every box on a form, how to spot the unsure ones, correct a field and add help for the person filling it. Detection finds each box on the form and says what it thinks the box is for. Most are right. This guide shows how to read what AppliFlo found and fix the rest before you fill or send. You need a key with the `read` and `draft` scopes, and a document you have [uploaded and detected](https://dev.appliflo.com/guides/upload-detect-fill). ## Read the fields ```bash curl https://appliflo.com/api/v1/documents/$DOCUMENT_ID/fields \ -H "Authorization: Bearer $APPLIFLO_API_KEY" ``` Each field in `data.fields` describes one box: | Key | What it tells you | | --- | --- | | `label_text` | The label printed by the box. `label_source` says where it came from: the page text, the PDF's own field name or tooltip, AI, or a person. | | `section` | The heading the box sits under, such as "Part 2. Information about you". | | `semantic_type` | What it takes: `name`, `date`, `email`, `phone`, `address`, `currency`, `checkbox`, `signature`, `initials`, `comb` and others. | | `format` | The format the form asks for, such as a date pattern. Values are changed to it when filled. | | `comb` | For a row of single-letter boxes, `cells` is how many there are. | | `multiline` | `true` when the box takes more than one line. | | `role_hint` | `signer` for a signature box and its date, which a recipient fills. | | `help` | A short line of help shown to the person filling the box, under its question. Absent when there is none. | | `confidence` | How sure AppliFlo is, from 0 to 1. | | `flagged` | `true` when AppliFlo is unsure. Check these first. | | `source` | `acroform` for a fillable field built into the PDF, `vision` for a box AppliFlo found by reading the page. | Choice questions are in `data.groups`: the question's `label`, whether one or several options can be picked (`kind`, `min`, `max`), the form's own `instruction` such as "Check only one", and its `options`, each with the `field_id` of its box. ## Correct a field Send only what you want to change. Every key is optional: | Key | What it changes | | --- | --- | | `label` | The box's label. | | `semanticType` | What it takes, such as `date` or `email`. | | `fieldType` | `text`, `checkbox` or `signature`. | | `bbox` | The box's position, as four numbers. | | `help` | Help for the person filling the box, up to 160 characters. `null` or an empty string removes it. | **curl** ```bash curl -X PATCH https://appliflo.com/api/v1/documents/$DOCUMENT_ID/fields/$FIELD_ID \ -H "Authorization: Bearer $APPLIFLO_API_KEY" \ -H "Content-Type: application/json" \ -d '{"label":"Date of birth","semanticType":"date","help":"As shown on your passport."}' ``` **Node** ```js const res = await fetch(`https://appliflo.com/api/v1/documents/${documentId}/fields/${fieldId}`, { method: "PATCH", headers: { Authorization: `Bearer ${process.env.APPLIFLO_API_KEY}`, "Content-Type": "application/json", }, body: JSON.stringify({ label: "Date of birth", semanticType: "date", help: "As shown on your passport." }), }); const { data: field } = await res.json(); ``` **Python** ```python import os, requests headers = {"Authorization": f"Bearer {os.environ['APPLIFLO_API_KEY']}"} field = requests.patch( f"https://appliflo.com/api/v1/documents/{document_id}/fields/{field_id}", headers=headers, json={"label": "Date of birth", "semanticType": "date", "help": "As shown on your passport."}, ).json()["data"] ``` The reply is the corrected field. Everything is checked before anything is saved, so a refused change leaves the field as it was. Corrections also help AppliFlo read the same form better next time. The `correct_field` MCP tool takes the same keys in its `patch` input. ## A good order of work 1. Detect, then read `flagged_count`. If it is 0, fill straight away. 2. For each flagged field, check `label_text`, `semantic_type` and `section` against the form, and correct what is wrong. 3. For a value that came back `overflowed` after a fill, check `multiline` and `comb`. If the box is bigger than AppliFlo thought, correct its `bbox` and fill again. 4. Fill by field id, as in [Upload, detect and fill](https://dev.appliflo.com/guides/upload-detect-fill#fill-by-field-id). Source: https://dev.appliflo.com/guides/correct-fields --- # Use AppliFlo from a coding agent > Connect Claude Code, Cursor or VS Code to the AppliFlo MCP server with a key, choose its scopes, and understand the confirm step before anything is sent. The AppliFlo MCP server gives a coding agent the same actions as the REST API, as tools. It is at `https://appliflo.com/api/mcp` and takes your API key in the `Authorization` header. Signing in from Claude.ai and ChatGPT is coming soon; today you connect with a key. ## 1. Make a key with the right scopes Make a key in [Settings, API keys](https://appliflo.com/settings/api-keys). Give the agent only what it needs: | The agent should | Tick | | --- | --- | | Look at documents, envelopes and templates | Read | | Upload, detect and fill | Read, Create drafts | | Also send, remind and void | Read, Create drafts, Send and void | A tool outside the key's scopes answers with an error starting `403: insufficient_scope`, and does nothing. See [API keys and scopes](https://dev.appliflo.com/guides/api-keys). ## 2. Connect your client For Claude Code, run this with your key in place of `aflo_live_...`: ```bash claude mcp add appliflo --transport http https://appliflo.com/api/mcp --header "Authorization: Bearer aflo_live_..." ``` Setup for Cursor, VS Code and other clients is on [Connect a client](https://dev.appliflo.com/mcp/connect). Then ask the agent to list your envelopes: it calls `list_envelopes`, which only reads. ## 3. The confirm step Four tools email people or cancel a send, so they take two calls: `send_envelope`, `void_envelope`, `send_template` and `send_template_bulk`. 1. The agent calls the tool without `confirm: true`. Nothing is sent. AppliFlo runs every real check first, then answers with an error result that says what would happen, such as who would be emailed, with the details in `structuredContent`. 2. The agent shows that to you. Once you agree, it calls the tool again with the same arguments and `confirm: true`. The raw calls look like this: ```json { "jsonrpc": "2.0", "id": 7, "method": "tools/call", "params": { "name": "send_template", "arguments": { "template_id": "tpl_lease", "people": { "r1": { "name": "Lan Nguyen", "email": "lan@example.com" } }, "prefill": { "3": "12 Rose St, Parramatta NSW 2150" }, "idempotency_key": "lease-send-7731" } } } ``` ```json { "jsonrpc": "2.0", "id": 8, "method": "tools/call", "params": { "name": "send_template", "arguments": { "template_id": "tpl_lease", "people": { "r1": { "name": "Lan Nguyen", "email": "lan@example.com" } }, "prefill": { "3": "12 Rose St, Parramatta NSW 2150" }, "idempotency_key": "lease-send-7731", "confirm": true } } } ``` Pass the same `idempotency_key` on both calls, so a retry never emails anyone twice. Only those four tools have a `confirm` input. `remind_envelope`, `cancel_bulk_batch` and `fix_bulk_row` act on the first call, so your client asks you before it runs them, as it does for every tool that changes something. A refused send, such as a form that must be signed by hand, is refused on the first call, so you are never asked to confirm something that can't be sent. ## What each tool does Every tool has a page under [MCP tools](https://dev.appliflo.com/mcp/tools) with its inputs. Tools are marked by what a client does before running them: - **read** tools only look, such as `list_envelopes` and `get_envelope`. - **asks first** tools change your workspace without emailing anyone, such as `upload_document`, `detect_fields` and `fill_document`. - **destructive** tools email people or cancel a send, such as `send_envelope` and `remind_envelope`. ## Official forms and contracts - Forms that must be signed by hand are refused with `esign_not_allowed`. Ask the agent to fill the form and download it instead. - A form whose agency may reject an electronic signature needs `esign_risk_acknowledged: true`, which the agent should set only after you agree. See [official agency forms](https://dev.appliflo.com/guides/send-for-signature#official-agency-forms). - `send_template` and `send_template_bulk` on an AppliFlo library contract our lawyer has not reviewed are refused with `contract_risk_required` until they are sent with `risk_accepted: true`, which the agent should set only after you accept the risk. See [Send a saved template](https://dev.appliflo.com/guides/send-template#appliflo-library-contracts). ## Let the agent read these docs So the agent writes correct calls, point it at these docs: - `https://dev.appliflo.com/llms.txt`: an index of every page. - `https://dev.appliflo.com/llms-full.txt`: every page in one Markdown file. - Any page as Markdown: add `.md`, for example `https://dev.appliflo.com/guides/quickstart.md`. - The AppliFlo Docs MCP at `https://dev.appliflo.com/docs-mcp`, with `search_docs` and `get_doc` tools. It is read-only, needs no key, and only reads these docs. To add the AppliFlo Docs MCP to Claude Code: ```bash claude mcp add appliflo-docs --transport http https://dev.appliflo.com/docs-mcp ``` The AppliFlo Docs MCP is separate from the AppliFlo MCP server at `appliflo.com/api/mcp`. Only the AppliFlo MCP server acts on your workspace. Source: https://dev.appliflo.com/guides/coding-agent --- # API reference > Every endpoint of the AppliFlo REST API, made from the OpenAPI file the server serves. The base URL is `https://appliflo.com/api/v1`. Every call takes a workspace API key in the `Authorization` header, and every response has the shape `{ success, data, error }`. The machine-readable spec is at [`/api/v1/openapi.json`](https://appliflo.com/api/v1/openapi.json). Each page has a **Try it** panel that calls the live API from your browser with your key. The key stays in the page's memory and is forgotten when you reload. ## Documents - [Get a document with its fields and choice groups](https://dev.appliflo.com/api/documents/get-document): `GET /api/v1/documents/{id}` - [Delete a draft document (move it to the Trash)](https://dev.appliflo.com/api/documents/delete-document): `DELETE /api/v1/documents/{id}` - [Upload a document](https://dev.appliflo.com/api/documents/create-document): `POST /api/v1/documents` - [Run field detection on a document](https://dev.appliflo.com/api/documents/detect-fields): `POST /api/v1/documents/{id}/detect` - [List a document's fields](https://dev.appliflo.com/api/documents/list-fields): `GET /api/v1/documents/{id}/fields` - [Correct a detected field (flywheel input)](https://dev.appliflo.com/api/documents/correct-field): `PATCH /api/v1/documents/{id}/fields/{fieldId}` - [Fill a document's fields with values](https://dev.appliflo.com/api/documents/fill-document): `POST /api/v1/documents/{id}/fill` - [Download a document artifact](https://dev.appliflo.com/api/documents/download-document-artifact): `GET /api/v1/documents/{id}/download` - [Send a document for signature](https://dev.appliflo.com/api/documents/send-document): `POST /api/v1/documents/{id}/send` ## Fill - [One-shot fill (multipart: file + values in, filled PDF + results out)](https://dev.appliflo.com/api/fill/fill-one-shot): `POST /api/v1/fill` ## Envelopes - [List envelopes in the workspace](https://dev.appliflo.com/api/envelopes/list-envelopes): `GET /api/v1/envelopes` - [Get envelope detail](https://dev.appliflo.com/api/envelopes/get-envelope): `GET /api/v1/envelopes/{id}` - [Void an envelope](https://dev.appliflo.com/api/envelopes/void-envelope): `POST /api/v1/envelopes/{id}/void` - [Send a reminder to recipients blocking signature](https://dev.appliflo.com/api/envelopes/remind-envelope): `POST /api/v1/envelopes/{id}/remind` - [Download the sealed (completed) document or its completion certificate](https://dev.appliflo.com/api/envelopes/download-envelope): `GET /api/v1/envelopes/{id}/download` ## Templates - [List the template library available to this workspace](https://dev.appliflo.com/api/templates/list-templates): `GET /api/v1/templates` - [Draft a document from a template](https://dev.appliflo.com/api/templates/create-document-from-template): `POST /api/v1/templates/{id}/create-document` ## Saved templates - [Get one template](https://dev.appliflo.com/api/saved-templates/get-template): `GET /api/v1/templates/{id}` - [Send a Ready saved template](https://dev.appliflo.com/api/saved-templates/send-from-template): `POST /api/v1/templates/{id}/send` - [List a saved template's versions](https://dev.appliflo.com/api/saved-templates/list-template-versions): `GET /api/v1/templates/{id}/versions` - [Get one version of a saved template](https://dev.appliflo.com/api/saved-templates/get-template-version): `GET /api/v1/templates/{id}/versions/{n}` - [Send a Ready saved template to many](https://dev.appliflo.com/api/saved-templates/send-template-bulk): `POST /api/v1/templates/{id}/bulk` - [Get a send-to-many batch](https://dev.appliflo.com/api/saved-templates/get-bulk-batch): `GET /api/v1/bulk-batches/{id}` - [Retry a batch's failed rows](https://dev.appliflo.com/api/saved-templates/retry-bulk-batch-failed): `POST /api/v1/bulk-batches/{id}/retry-failed` - [Cancel a batch](https://dev.appliflo.com/api/saved-templates/cancel-bulk-batch): `POST /api/v1/bulk-batches/{id}/cancel` - [Fix a failed row and send it again](https://dev.appliflo.com/api/saved-templates/fix-bulk-batch-row): `PATCH /api/v1/bulk-batches/{id}/rows/{row}` - [List the workspace's saved templates](https://dev.appliflo.com/api/saved-templates/list-saved-templates): `GET /api/v1/saved-templates` - [Save a draft document as a template](https://dev.appliflo.com/api/saved-templates/create-saved-template-from-document): `POST /api/v1/saved-templates` - [Create a document from a saved template](https://dev.appliflo.com/api/saved-templates/create-document-from-saved-template): `POST /api/v1/saved-templates/{id}/create-document` Source: https://dev.appliflo.com/api --- # Get a document with its fields and choice groups > GET /api/v1/documents/{id}: Get a document with its fields and choice groups. `GET https://appliflo.com/api/v1/documents/{id}` Send your API key in the `Authorization: Bearer` header. Every response is JSON: `{ success, data, error }`. ## Parameters | Name | In | Required | Description | | --- | --- | --- | --- | | `id` | path | yes | Document id | ## Responses | Status | Description | | --- | --- | | 200 | The document, its current fields and its choice questions. | | 401 | Missing or invalid API key, or `api_key_expired` for a key past its expiry. | | 403 | The API key's workspace does not have access to this resource, or `insufficient_scope` (with `required_scope`) for a key without the scope this route needs. | | 404 | Resource not found in this workspace. | | 422 | Request failed validation. | | 500 | Internal error. | ## 200 response | Field | Type | Required | Description | | --- | --- | --- | --- | | `success` | true | yes | | | `data` | object | yes | | | `data.id` | string | yes | | | `data.name` | string | yes | | | `data.status` | string | yes | | | `data.fields` | object[] | yes | | | `data.fields[].id` | string | yes | | | `data.fields[].page` | integer | yes | | | `data.fields[].bbox` | number[] \| null | yes | | | `data.fields[].type` | string | yes | | | `data.fields[].label_text` | string \| null | yes | | | `data.fields[].semantic_type` | string | yes | One of: date, phone, ssn, ein, currency, name, address, email, generic-text, checkbox, radio, signature, initials, comb | | `data.fields[].format` | string | no | | | `data.fields[].comb` | object | no | | | `data.fields[].comb.cells` | integer | no | | | `data.fields[].multiline` | boolean | no | | | `data.fields[].confidence` | number \| null | yes | | | `data.fields[].flagged` | boolean | yes | | | `data.fields[].source` | string | yes | One of: acroform, vision | | `data.fields[].recipient_id` | string \| null | yes | | | `data.fields[].group_id` | string | no | The choice group (groups[].id) this box is an option of | | `data.fields[].option_value` | string | no | What choosing this box stamps (the form's own on-state, e.g. "ms" or "2") | | `data.fields[].option_label` | string | no | The option's printed text ("Ms", "C corporation") | | `data.fields[].section` | string | no | The printed heading the field sits under | | `data.fields[].label_source` | string | no | One of: page_text, tooltip, name, provider, llm, manual | | `data.fields[].role_hint` | string | no | Who fills it by default: "signer" for a signature box and its date | | `data.fields[].help` | string | no | Help for the client, shown under the box's question when they fill it in (absent: none) | | `data.groups` | object[] | yes | | | `data.groups[].id` | string | yes | | | `data.groups[].label` | string | yes | | | `data.groups[].kind` | string | yes | One of: single, multi | | `data.groups[].min` | integer \| null | yes | | | `data.groups[].max` | integer \| null | yes | | | `data.groups[].instruction` | string \| null | yes | The form's own words, e.g. "Check only one of the following seven boxes" | | `data.groups[].confidence` | number \| null | yes | | | `data.groups[].source` | string | yes | One of: radio, parent, name_pattern, geometry, llm, manual | | `data.groups[].section` | string \| null | yes | | | `data.groups[].options` | object[] | yes | At least 2 items | | `data.groups[].options[].field_id` | string | yes | | | `data.groups[].options[].value` | string | yes | | | `data.groups[].options[].label` | string | yes | | See also: [Errors](https://dev.appliflo.com/guides/errors), [Rate limits](https://dev.appliflo.com/guides/rate-limits), [Idempotency](https://dev.appliflo.com/guides/idempotency). Source: https://dev.appliflo.com/api/documents/get-document --- # Delete a draft document (move it to the Trash) > DELETE /api/v1/documents/{id}: Delete a draft document (move it to the Trash). `DELETE https://appliflo.com/api/v1/documents/{id}` Moves a draft document to the workspace Trash. It disappears from every list and read (404 from then on) and can be restored in the web app for 30 days, after which it is permanently deleted with its fields and files. Only drafts can be deleted: a document with any envelope that is not a draft (sent, completed, sealed, voided...) is refused with 409 and is never deleted. An API key acts as a workspace integration, so it may delete only documents that no person uploaded (documents created through the API); a person's upload returns 403. Permanent deletion is not available on the API. Send your API key in the `Authorization: Bearer` header. Every response is JSON: `{ success, data, error }`. ## Parameters | Name | In | Required | Description | | --- | --- | --- | --- | | `id` | path | yes | Document id | ## Responses | Status | Description | | --- | --- | | 200 | Moved to the Trash. | | 401 | Missing or invalid API key, or `api_key_expired` for a key past its expiry. | | 403 | The API key's workspace does not have access to this resource, or `insufficient_scope` (with `required_scope`) for a key without the scope this route needs. | | 404 | Resource not found in this workspace. | | 409 | Only drafts can be deleted: this document has been sent for signature. | | 422 | Request failed validation. | | 500 | Internal error. | ## 200 response | Field | Type | Required | Description | | --- | --- | --- | --- | | `success` | true | yes | | | `data` | object | yes | | | `data.id` | string | yes | | | `data.name` | string | yes | | | `data.deleted_at` | string | yes | Format: date-time | | `data.days_left` | integer | yes | Days until the document is permanently deleted (30 on a fresh delete) | See also: [Errors](https://dev.appliflo.com/guides/errors), [Rate limits](https://dev.appliflo.com/guides/rate-limits), [Idempotency](https://dev.appliflo.com/guides/idempotency). Source: https://dev.appliflo.com/api/documents/delete-document --- # Upload a document > POST /api/v1/documents: Upload a document. `POST https://appliflo.com/api/v1/documents` Send your API key in the `Authorization: Bearer` header. Every response is JSON: `{ success, data, error }`. ## Parameters | Name | In | Required | Description | | --- | --- | --- | --- | | `Idempotency-Key` | header | no | A client-generated key scoping this request as a retry of a prior identical request. A replay within 24h returns the first response instead of repeating the side effect (e.g. a second send). The key is bound to the request it was first used with: the same key with a different body or target is refused (422, code idempotency_key_reused) | ## Request body (multipart/form-data) | Field | Type | Required | Description | | --- | --- | --- | --- | | `file` | string | yes | Format: binary | | `name` | string | no | | ## Request body (application/json) | Field | Type | Required | Description | | --- | --- | --- | --- | | `name` | string | yes | Up to 255 characters | | `content_base64` | string | no | The PDF or DOCX, base64-encoded | | `file_url` | string | no | A public https:// link to the file, downloaded by AppliFlo: no private or internal addresses, at most 3 redirects, 20 MB and 20 seconds. The type is read from the bytes, never the link. Up to 2048 characters | ## Responses | Status | Description | | --- | --- | | 201 | Document created. | | 401 | Missing or invalid API key, or `api_key_expired` for a key past its expiry. | | 403 | The API key's workspace does not have access to this resource, or `insufficient_scope` (with `required_scope`) for a key without the scope this route needs. | | 404 | Resource not found in this workspace. | | 422 | Request failed validation. | | 500 | Internal error. | ## 201 response | Field | Type | Required | Description | | --- | --- | --- | --- | | `success` | true | yes | | | `data` | object | yes | | | `data.id` | string | yes | | | `data.name` | string | yes | | | `data.status` | string | yes | | See also: [Errors](https://dev.appliflo.com/guides/errors), [Rate limits](https://dev.appliflo.com/guides/rate-limits), [Idempotency](https://dev.appliflo.com/guides/idempotency). Source: https://dev.appliflo.com/api/documents/create-document --- # Run field detection on a document > POST /api/v1/documents/{id}/detect: Run field detection on a document. `POST https://appliflo.com/api/v1/documents/{id}/detect` Send your API key in the `Authorization: Bearer` header. Every response is JSON: `{ success, data, error }`. ## Parameters | Name | In | Required | Description | | --- | --- | --- | --- | | `id` | path | yes | Document id | | `Idempotency-Key` | header | no | A client-generated key scoping this request as a retry of a prior identical request. A replay within 24h returns the first response instead of repeating the side effect (e.g. a second send). The key is bound to the request it was first used with: the same key with a different body or target is refused (422, code idempotency_key_reused) | ## Responses | Status | Description | | --- | --- | | 200 | Detected fields. vision_skipped=true means the result is partial (monthly AI-reading limit reached). | | 401 | Missing or invalid API key, or `api_key_expired` for a key past its expiry. | | 403 | The API key's workspace does not have access to this resource, or `insufficient_scope` (with `required_scope`) for a key without the scope this route needs. | | 404 | Resource not found in this workspace. | | 422 | Request failed validation. | | 500 | Internal error. | ## 200 response | Field | Type | Required | Description | | --- | --- | --- | --- | | `success` | true | yes | | | `data` | object | yes | | | `data.fields` | object[] | yes | | | `data.fields[].id` | string | yes | | | `data.fields[].page` | integer | yes | | | `data.fields[].bbox` | number[] \| null | yes | | | `data.fields[].type` | string | yes | | | `data.fields[].label_text` | string \| null | yes | | | `data.fields[].semantic_type` | string | yes | One of: date, phone, ssn, ein, currency, name, address, email, generic-text, checkbox, radio, signature, initials, comb | | `data.fields[].format` | string | no | | | `data.fields[].comb` | object | no | | | `data.fields[].comb.cells` | integer | no | | | `data.fields[].multiline` | boolean | no | | | `data.fields[].confidence` | number \| null | yes | | | `data.fields[].flagged` | boolean | yes | | | `data.fields[].source` | string | yes | One of: acroform, vision | | `data.fields[].recipient_id` | string \| null | yes | | | `data.fields[].group_id` | string | no | The choice group (groups[].id) this box is an option of | | `data.fields[].option_value` | string | no | What choosing this box stamps (the form's own on-state, e.g. "ms" or "2") | | `data.fields[].option_label` | string | no | The option's printed text ("Ms", "C corporation") | | `data.fields[].section` | string | no | The printed heading the field sits under | | `data.fields[].label_source` | string | no | One of: page_text, tooltip, name, provider, llm, manual | | `data.fields[].role_hint` | string | no | Who fills it by default: "signer" for a signature box and its date | | `data.fields[].help` | string | no | Help for the client, shown under the box's question when they fill it in (absent: none) | | `data.groups` | object[] | yes | Choice questions over the fields (FieldSchema 1.2) | | `data.groups[].id` | string | yes | | | `data.groups[].label` | string | yes | | | `data.groups[].kind` | string | yes | One of: single, multi | | `data.groups[].min` | integer \| null | yes | | | `data.groups[].max` | integer \| null | yes | | | `data.groups[].instruction` | string \| null | yes | The form's own words, e.g. "Check only one of the following seven boxes" | | `data.groups[].confidence` | number \| null | yes | | | `data.groups[].source` | string | yes | One of: radio, parent, name_pattern, geometry, llm, manual | | `data.groups[].section` | string \| null | yes | | | `data.groups[].options` | object[] | yes | At least 2 items | | `data.groups[].options[].field_id` | string | yes | | | `data.groups[].options[].value` | string | yes | | | `data.groups[].options[].label` | string | yes | | | `data.flagged_count` | integer | yes | Fields flagged for human review (low confidence) | | `data.vision_skipped` | boolean | yes | True when pages needing AI (vision) reading were left unread because the monthly limit was reached: built-in fillable fields only | | `data.vision_pages` | integer | yes | Pages read by AI (vision) for this detection | | `data.ai_pages` | object | no | The workspace's AI pages this period. exhausted=true: this call was read without AI because the allowance ran out (built-in fillable fields only). API use is charged to the API key's creator | | `data.ai_pages.used` | integer | yes | | | `data.ai_pages.limit` | integer | yes | | | `data.ai_pages.remaining` | integer | yes | | | `data.ai_pages.exhausted` | boolean | yes | | | `data.ai_pages.resets_at` | string | yes | Format: date-time | See also: [Errors](https://dev.appliflo.com/guides/errors), [Rate limits](https://dev.appliflo.com/guides/rate-limits), [Idempotency](https://dev.appliflo.com/guides/idempotency). Source: https://dev.appliflo.com/api/documents/detect-fields --- # List a document's fields > GET /api/v1/documents/{id}/fields: List a document's fields. `GET https://appliflo.com/api/v1/documents/{id}/fields` Send your API key in the `Authorization: Bearer` header. Every response is JSON: `{ success, data, error }`. ## Parameters | Name | In | Required | Description | | --- | --- | --- | --- | | `id` | path | yes | Document id | ## Responses | Status | Description | | --- | --- | | 200 | Fields for this document, and its choice questions. | | 401 | Missing or invalid API key, or `api_key_expired` for a key past its expiry. | | 403 | The API key's workspace does not have access to this resource, or `insufficient_scope` (with `required_scope`) for a key without the scope this route needs. | | 404 | Resource not found in this workspace. | | 422 | Request failed validation. | | 500 | Internal error. | ## 200 response | Field | Type | Required | Description | | --- | --- | --- | --- | | `success` | true | yes | | | `data` | object | yes | | | `data.fields` | object[] | yes | | | `data.fields[].id` | string | yes | | | `data.fields[].page` | integer | yes | | | `data.fields[].bbox` | number[] \| null | yes | | | `data.fields[].type` | string | yes | | | `data.fields[].label_text` | string \| null | yes | | | `data.fields[].semantic_type` | string | yes | One of: date, phone, ssn, ein, currency, name, address, email, generic-text, checkbox, radio, signature, initials, comb | | `data.fields[].format` | string | no | | | `data.fields[].comb` | object | no | | | `data.fields[].comb.cells` | integer | no | | | `data.fields[].multiline` | boolean | no | | | `data.fields[].confidence` | number \| null | yes | | | `data.fields[].flagged` | boolean | yes | | | `data.fields[].source` | string | yes | One of: acroform, vision | | `data.fields[].recipient_id` | string \| null | yes | | | `data.fields[].group_id` | string | no | The choice group (groups[].id) this box is an option of | | `data.fields[].option_value` | string | no | What choosing this box stamps (the form's own on-state, e.g. "ms" or "2") | | `data.fields[].option_label` | string | no | The option's printed text ("Ms", "C corporation") | | `data.fields[].section` | string | no | The printed heading the field sits under | | `data.fields[].label_source` | string | no | One of: page_text, tooltip, name, provider, llm, manual | | `data.fields[].role_hint` | string | no | Who fills it by default: "signer" for a signature box and its date | | `data.fields[].help` | string | no | Help for the client, shown under the box's question when they fill it in (absent: none) | | `data.groups` | object[] | yes | | | `data.groups[].id` | string | yes | | | `data.groups[].label` | string | yes | | | `data.groups[].kind` | string | yes | One of: single, multi | | `data.groups[].min` | integer \| null | yes | | | `data.groups[].max` | integer \| null | yes | | | `data.groups[].instruction` | string \| null | yes | The form's own words, e.g. "Check only one of the following seven boxes" | | `data.groups[].confidence` | number \| null | yes | | | `data.groups[].source` | string | yes | One of: radio, parent, name_pattern, geometry, llm, manual | | `data.groups[].section` | string \| null | yes | | | `data.groups[].options` | object[] | yes | At least 2 items | | `data.groups[].options[].field_id` | string | yes | | | `data.groups[].options[].value` | string | yes | | | `data.groups[].options[].label` | string | yes | | See also: [Errors](https://dev.appliflo.com/guides/errors), [Rate limits](https://dev.appliflo.com/guides/rate-limits), [Idempotency](https://dev.appliflo.com/guides/idempotency). Source: https://dev.appliflo.com/api/documents/list-fields --- # Correct a detected field (flywheel input) > PATCH /api/v1/documents/{id}/fields/{fieldId}: Correct a detected field (flywheel input). `PATCH https://appliflo.com/api/v1/documents/{id}/fields/{fieldId}` Every key is optional; only the keys sent change. label, semanticType, bbox and fieldType correct the detection (each correction is kept as training input). help sets the box's help for the client, shown under its question when they fill it in (at most 160 characters after trimming, 422 beyond; null or blank removes it). Send your API key in the `Authorization: Bearer` header. Every response is JSON: `{ success, data, error }`. ## Parameters | Name | In | Required | Description | | --- | --- | --- | --- | | `id` | path | yes | Document id | | `fieldId` | path | yes | Field id | ## Request body (application/json) | Field | Type | Required | Description | | --- | --- | --- | --- | | `label` | string \| null | no | Up to 500 characters | | `semanticType` | string | no | One of: date, phone, ssn, ein, currency, name, address, email, generic-text, checkbox, radio, signature, initials, comb | | `bbox` | number[] | no | 4 to 4 items | | `fieldType` | string | no | One of: text, checkbox, signature | | `help` | string \| null | no | Help for the client under this box's question (0073): at most 160 characters after trimming; null or blank removes it. Up to 160 characters | ## Responses | Status | Description | | --- | --- | | 200 | Corrected field. | | 401 | Missing or invalid API key, or `api_key_expired` for a key past its expiry. | | 403 | The API key's workspace does not have access to this resource, or `insufficient_scope` (with `required_scope`) for a key without the scope this route needs. | | 404 | Resource not found in this workspace. | | 422 | Request failed validation. | | 500 | Internal error. | ## 200 response | Field | Type | Required | Description | | --- | --- | --- | --- | | `success` | true | yes | | | `data` | object | yes | FieldSchema v2 (see architecture spec §2), snake_case wire keys | | `data.id` | string | yes | | | `data.page` | integer | yes | | | `data.bbox` | number[] \| null | yes | | | `data.type` | string | yes | | | `data.label_text` | string \| null | yes | | | `data.semantic_type` | string | yes | One of: date, phone, ssn, ein, currency, name, address, email, generic-text, checkbox, radio, signature, initials, comb | | `data.format` | string | no | | | `data.comb` | object | no | | | `data.comb.cells` | integer | no | | | `data.multiline` | boolean | no | | | `data.confidence` | number \| null | yes | | | `data.flagged` | boolean | yes | | | `data.source` | string | yes | One of: acroform, vision | | `data.recipient_id` | string \| null | yes | | | `data.group_id` | string | no | The choice group (groups[].id) this box is an option of | | `data.option_value` | string | no | What choosing this box stamps (the form's own on-state, e.g. "ms" or "2") | | `data.option_label` | string | no | The option's printed text ("Ms", "C corporation") | | `data.section` | string | no | The printed heading the field sits under | | `data.label_source` | string | no | One of: page_text, tooltip, name, provider, llm, manual | | `data.role_hint` | string | no | Who fills it by default: "signer" for a signature box and its date | | `data.help` | string | no | Help for the client, shown under the box's question when they fill it in (absent: none) | See also: [Errors](https://dev.appliflo.com/guides/errors), [Rate limits](https://dev.appliflo.com/guides/rate-limits), [Idempotency](https://dev.appliflo.com/guides/idempotency). Source: https://dev.appliflo.com/api/documents/correct-field --- # Fill a document's fields with values > POST /api/v1/documents/{id}/fill: Fill a document's fields with values. `POST https://appliflo.com/api/v1/documents/{id}/fill` Send your API key in the `Authorization: Bearer` header. Every response is JSON: `{ success, data, error }`. ## Parameters | Name | In | Required | Description | | --- | --- | --- | --- | | `id` | path | yes | Document id | | `Idempotency-Key` | header | no | A client-generated key scoping this request as a retry of a prior identical request. A replay within 24h returns the first response instead of repeating the side effect (e.g. a second send). The key is bound to the request it was first used with: the same key with a different body or target is refused (422, code idempotency_key_reused) | ## Request body (application/json) | Field | Type | Required | Description | | --- | --- | --- | --- | | `values` | map of string \| number \| boolean \| string[] | yes | Keyed by field id (the field's value) or by choice-group id (groups[].id: one option for a single question, a list for multi, each named by the option's value or label) | | `deterministic` | boolean | no | | ## Responses | Status | Description | | --- | --- | | 200 | Per-field fill results, and one result per choice group. An answer a group refuses is a 422 and nothing is stamped. | | 401 | Missing or invalid API key, or `api_key_expired` for a key past its expiry. | | 403 | The API key's workspace does not have access to this resource, or `insufficient_scope` (with `required_scope`) for a key without the scope this route needs. | | 404 | Resource not found in this workspace. | | 422 | Request failed validation. | | 500 | Internal error. | ## 200 response | Field | Type | Required | Description | | --- | --- | --- | --- | | `success` | true | yes | | | `data` | object | yes | | | `data.results` | object[] | yes | | | `data.results[].field_id` | string | yes | | | `data.results[].status` | string | yes | One of: filled, formatted, overflowed, skipped | | `data.results[].rendered_text` | string | no | | | `data.results[].font_size` | number | no | | | `data.results[].lines` | integer | no | | | `data.results[].reason` | string | no | | | `data.groups` | object[] | yes | | | `data.groups[].group_id` | string | yes | | | `data.groups[].status` | string | yes | One of: filled, skipped | | `data.groups[].chosen` | string[] | yes | The chosen options' values | | `data.groups[].field_ids` | string[] | yes | The option boxes that were stamped | | `data.download` | object | no | | | `data.download.artifact` | string | no | One of: filled | See also: [Errors](https://dev.appliflo.com/guides/errors), [Rate limits](https://dev.appliflo.com/guides/rate-limits), [Idempotency](https://dev.appliflo.com/guides/idempotency). Source: https://dev.appliflo.com/api/documents/fill-document --- # Download a document artifact > GET /api/v1/documents/{id}/download: Download a document artifact. `GET https://appliflo.com/api/v1/documents/{id}/download` Send your API key in the `Authorization: Bearer` header. Every response is JSON: `{ success, data, error }`. ## Parameters | Name | In | Required | Description | | --- | --- | --- | --- | | `id` | path | yes | Document id | | `artifact` | query | yes | Which rendered artifact to download. One of: filled, sealed | ## Responses | Status | Description | | --- | --- | | 200 | Signed download URL. | | 401 | Missing or invalid API key, or `api_key_expired` for a key past its expiry. | | 403 | The API key's workspace does not have access to this resource, or `insufficient_scope` (with `required_scope`) for a key without the scope this route needs. | | 404 | Resource not found in this workspace. | | 422 | Request failed validation. | | 500 | Internal error. | ## 200 response | Field | Type | Required | Description | | --- | --- | --- | --- | | `success` | true | yes | | | `data` | object | yes | | | `data.url` | string | yes | Format: uri | See also: [Errors](https://dev.appliflo.com/guides/errors), [Rate limits](https://dev.appliflo.com/guides/rate-limits), [Idempotency](https://dev.appliflo.com/guides/idempotency). Source: https://dev.appliflo.com/api/documents/download-document-artifact --- # Send a document for signature > POST /api/v1/documents/{id}/send: Send a document for signature. `POST https://appliflo.com/api/v1/documents/{id}/send` Creates the envelope, sets recipients, assigns fields, pre-fills any CRM-mapped fields, then invites the initial signing wave. A field assigned to a CC recipient is rejected (422) — CC recipients never sign. Since November 2026 each signer and filler is emailed a one-time code to enter before signing (accessCode defaults to "email"); pass accessCode "none" on a recipient to switch it off. A recipient with delivery "embedded" is never emailed: your app signs them with POST /api/v1/embed/signing-sessions (Business plan or a sandbox). Send your API key in the `Authorization: Bearer` header. Every response is JSON: `{ success, data, error }`. ## Parameters | Name | In | Required | Description | | --- | --- | --- | --- | | `id` | path | yes | Document id | | `Idempotency-Key` | header | no | A client-generated key scoping this request as a retry of a prior identical request. A replay within 24h returns the first response instead of repeating the side effect (e.g. a second send). The key is bound to the request it was first used with: the same key with a different body or target is refused (422, code idempotency_key_reused) | ## Request body (application/json) | Field | Type | Required | Description | | --- | --- | --- | --- | | `subject` | string | yes | Up to 998 characters | | `message` | string | no | Up to 4096 characters | | `routing` | string | yes | One of: parallel, sequential | | `recipients` | object[] | yes | 1 to 50 items | | `recipients[].name` | string | yes | Up to 256 characters | | `recipients[].email` | string | yes | Format: email. Up to 254 characters | | `recipients[].role` | string | yes | One of: signer, filler, cc | | `recipients[].accessCode` | string | no | Identity check before signing. Default "email": the person is emailed a one-time code to enter after opening their link. "none" switches it off. Ignored for cc and for an embedded recipient. One of: email, none | | `recipients[].delivery` | string | no | How the signing link reaches them. "email" (default): invited, reminded and sent any access code by email. "embedded": never emailed (no invite, no reminders, no access code); when their turn comes, your app signs them in its own page with POST /api/v1/embed/signing-sessions, and the document's activity reads "Waiting for to sign in your app". Needs the Business plan or a sandbox workspace (402 `plan_feature`). A cc can't be embedded (422 `cc_not_embeddable`). One of: email, embedded. Default: "email" | | `assignments` | object[] | no | Up to 500 items | | `assignments[].fieldId` | string | yes | | | `assignments[].recipientIndex` | integer | yes | At least 0 | | `prefill` | object | no | | | `prefill.connector` | string | yes | | | `prefill.entity` | string | yes | | | `prefill.recordId` | string | yes | | | `values` | map of string \| string[] | no | Resolved values keyed by field id, stored exactly as given (max 500 values, 4000 chars each). When present the prefill connector is not re-read. Signature fields and fields assigned to a recipient are refused (422). A key may also be a choice-group id (groups[] from GET .../fields): one option for a single question, or a list (max 50) for multi, each named by the option's value or label; the chosen boxes are stored ticked. A group with a box assigned to a recipient in this request, an unknown option, or too many options is refused (422), as is answering a group and also setting one of its boxes | | `reminderCadence` | object | no | Automatic reminder policy for recipients still blocking signature. Omit to accept the default (reminders on, every 24h). everyHours may only slow reminders down, never speed them up | | `reminderCadence.enabled` | boolean | no | Default: true | | `reminderCadence.everyHours` | integer | no | 24 to 720. Default: 24 | | `esignRiskAcknowledged` | boolean | no | Some hosted government forms (USCIS I-130 and others, SSA SS-5, IRS 8879 and 4506-C, the Commonwealth statutory declaration) are fill-and-print only: a send of one is refused (422 esign_not_allowed) whatever this says; download the filled PDF instead. A form whose agency may reject an e-signature needs true (422 esign_ack_required without it) | ## Responses | Status | Description | | --- | --- | | 201 | Envelope sent. | | 401 | Missing or invalid API key, or `api_key_expired` for a key past its expiry. | | 402 | `plan_feature`: a recipient with delivery "embedded" needs the Business plan (or a sandbox workspace). | | 403 | The API key's workspace does not have access to this resource, or `insufficient_scope` (with `required_scope`) for a key without the scope this route needs. | | 404 | Resource not found in this workspace. | | 409 | A request with this Idempotency-Key is already in progress. | | 422 | Request failed validation, or `cc_not_embeddable` (a cc with delivery "embedded"). | | 500 | Internal error. | ## 201 response | Field | Type | Required | Description | | --- | --- | --- | --- | | `success` | true | yes | | | `data` | object | yes | | | `data.envelopeId` | string | yes | | | `data.invited` | integer | yes | | | `data.prefilled` | integer | yes | | See also: [Errors](https://dev.appliflo.com/guides/errors), [Rate limits](https://dev.appliflo.com/guides/rate-limits), [Idempotency](https://dev.appliflo.com/guides/idempotency). Source: https://dev.appliflo.com/api/documents/send-document --- # One-shot fill (multipart: file + values in, filled PDF + results out) > POST /api/v1/fill: One-shot fill (multipart: file + values in, filled PDF + results out). `POST https://appliflo.com/api/v1/fill` Send your API key in the `Authorization: Bearer` header. Every response is JSON: `{ success, data, error }`. ## Parameters | Name | In | Required | Description | | --- | --- | --- | --- | | `Idempotency-Key` | header | no | A client-generated key scoping this request as a retry of a prior identical request. A replay within 24h returns the first response instead of repeating the side effect (e.g. a second send). The key is bound to the request it was first used with: the same key with a different body or target is refused (422, code idempotency_key_reused) | ## Request body (multipart/form-data) | Field | Type | Required | Description | | --- | --- | --- | --- | | `file` | string | yes | The PDF (or DOCX, converted to PDF) to fill. Format: binary | | `values` | string | yes | JSON-encoded values keyed by a field's label text, or by a choice question's label (one option, or a list for multi) | ## Request body (application/json) | Field | Type | Required | Description | | --- | --- | --- | --- | | `content_base64` | string | no | The PDF or DOCX, base64-encoded | | `file_url` | string | no | A public https:// link to the file, downloaded by AppliFlo: no private or internal addresses, at most 3 redirects, 20 MB and 20 seconds. The type is read from the bytes, never the link. Up to 2048 characters | | `values` | object | no | Values keyed by a field's label text, or by a choice question's label (one option, or a list for multi) | | `deterministic` | boolean | no | | ## Responses | Status | Description | | --- | --- | | 200 | Filled PDF (base64) + per-field results. | | 401 | Missing or invalid API key, or `api_key_expired` for a key past its expiry. | | 403 | The API key's workspace does not have access to this resource, or `insufficient_scope` (with `required_scope`) for a key without the scope this route needs. | | 404 | Resource not found in this workspace. | | 422 | Request failed validation. | | 500 | Internal error. | ## 200 response | Field | Type | Required | Description | | --- | --- | --- | --- | | `success` | true | yes | | | `data` | object | yes | | | `data.pdf_base64` | string | yes | | | `data.results` | object[] | yes | | | `data.results[].field_id` | string | yes | | | `data.results[].status` | string | yes | One of: filled, formatted, overflowed, skipped | | `data.results[].rendered_text` | string | no | | | `data.results[].font_size` | number | no | | | `data.results[].lines` | integer | no | | | `data.results[].reason` | string | no | | | `data.groups` | object[] | yes | | | `data.groups[].group_id` | string | yes | | | `data.groups[].status` | string | yes | One of: filled, skipped | | `data.groups[].chosen` | string[] | yes | The chosen options' values | | `data.groups[].field_ids` | string[] | yes | The option boxes that were stamped | | `data.warnings` | object[] | no | Low-confidence fields left unfilled | | `data.warnings[].id` | string | yes | | | `data.warnings[].page` | integer | yes | | | `data.warnings[].bbox` | number[] \| null | yes | | | `data.warnings[].type` | string | yes | | | `data.warnings[].label_text` | string \| null | yes | | | `data.warnings[].semantic_type` | string | yes | One of: date, phone, ssn, ein, currency, name, address, email, generic-text, checkbox, radio, signature, initials, comb | | `data.warnings[].format` | string | no | | | `data.warnings[].comb` | object | no | | | `data.warnings[].comb.cells` | integer | no | | | `data.warnings[].multiline` | boolean | no | | | `data.warnings[].confidence` | number \| null | yes | | | `data.warnings[].flagged` | boolean | yes | | | `data.warnings[].source` | string | yes | One of: acroform, vision | | `data.warnings[].recipient_id` | string \| null | yes | | | `data.warnings[].group_id` | string | no | The choice group (groups[].id) this box is an option of | | `data.warnings[].option_value` | string | no | What choosing this box stamps (the form's own on-state, e.g. "ms" or "2") | | `data.warnings[].option_label` | string | no | The option's printed text ("Ms", "C corporation") | | `data.warnings[].section` | string | no | The printed heading the field sits under | | `data.warnings[].label_source` | string | no | One of: page_text, tooltip, name, provider, llm, manual | | `data.warnings[].role_hint` | string | no | Who fills it by default: "signer" for a signature box and its date | | `data.warnings[].help` | string | no | Help for the client, shown under the box's question when they fill it in (absent: none) | | `data.group_warnings` | object[] | no | Choice questions too unsure to fill, left unfilled | | `data.group_warnings[].id` | string | yes | | | `data.group_warnings[].label` | string | yes | | | `data.group_warnings[].kind` | string | yes | One of: single, multi | | `data.group_warnings[].min` | integer \| null | yes | | | `data.group_warnings[].max` | integer \| null | yes | | | `data.group_warnings[].instruction` | string \| null | yes | The form's own words, e.g. "Check only one of the following seven boxes" | | `data.group_warnings[].confidence` | number \| null | yes | | | `data.group_warnings[].source` | string | yes | One of: radio, parent, name_pattern, geometry, llm, manual | | `data.group_warnings[].section` | string \| null | yes | | | `data.group_warnings[].options` | object[] | yes | At least 2 items | | `data.group_warnings[].options[].field_id` | string | yes | | | `data.group_warnings[].options[].value` | string | yes | | | `data.group_warnings[].options[].label` | string | yes | | | `data.ai_pages` | object | no | The workspace's AI pages this period. exhausted=true: this call was read without AI because the allowance ran out (built-in fillable fields only). API use is charged to the API key's creator | | `data.ai_pages.used` | integer | yes | | | `data.ai_pages.limit` | integer | yes | | | `data.ai_pages.remaining` | integer | yes | | | `data.ai_pages.exhausted` | boolean | yes | | | `data.ai_pages.resets_at` | string | yes | Format: date-time | See also: [Errors](https://dev.appliflo.com/guides/errors), [Rate limits](https://dev.appliflo.com/guides/rate-limits), [Idempotency](https://dev.appliflo.com/guides/idempotency). Source: https://dev.appliflo.com/api/fill/fill-one-shot --- # List envelopes in the workspace > GET /api/v1/envelopes: List envelopes in the workspace. `GET https://appliflo.com/api/v1/envelopes` Send your API key in the `Authorization: Bearer` header. Every response is JSON: `{ success, data, error }`. ## Parameters | Name | In | Required | Description | | --- | --- | --- | --- | | `status` | query | no | Filter by envelope status. One of: draft, awaiting, completing, completed, declined, expired, voided | | `limit` | query | no | Page size (default 20, max 100) | | `offset` | query | no | Number of envelopes to skip | ## Responses | Status | Description | | --- | --- | | 200 | A page of envelopes. | | 401 | Missing or invalid API key, or `api_key_expired` for a key past its expiry. | | 403 | The API key's workspace does not have access to this resource, or `insufficient_scope` (with `required_scope`) for a key without the scope this route needs. | | 404 | Resource not found in this workspace. | | 422 | Request failed validation. | | 500 | Internal error. | ## 200 response | Field | Type | Required | Description | | --- | --- | --- | --- | | `success` | true | yes | | | `data` | object[] | yes | | | `data[].id` | string | yes | | | `data[].subject` | string | yes | | | `data[].status` | string | yes | One of: draft, awaiting, completing, completed, declined, expired, voided | | `data[].createdAt` | string | yes | Format: date-time | | `data[].recipients` | object | yes | | | `data[].recipients.total` | integer | yes | | | `data[].recipients.signed` | integer | yes | | | `meta` | object | yes | | | `meta.total` | integer | yes | At least 0 | | `meta.page` | integer | yes | At least 1 | | `meta.limit` | integer | yes | At least 1 | See also: [Errors](https://dev.appliflo.com/guides/errors), [Rate limits](https://dev.appliflo.com/guides/rate-limits), [Idempotency](https://dev.appliflo.com/guides/idempotency). Source: https://dev.appliflo.com/api/envelopes/list-envelopes --- # Get envelope detail > GET /api/v1/envelopes/{id}: Get envelope detail. `GET https://appliflo.com/api/v1/envelopes/{id}` Send your API key in the `Authorization: Bearer` header. Every response is JSON: `{ success, data, error }`. ## Parameters | Name | In | Required | Description | | --- | --- | --- | --- | | `id` | path | yes | Envelope id | ## Responses | Status | Description | | --- | --- | | 200 | Envelope detail: recipients, progress, timeline. | | 401 | Missing or invalid API key, or `api_key_expired` for a key past its expiry. | | 403 | The API key's workspace does not have access to this resource, or `insufficient_scope` (with `required_scope`) for a key without the scope this route needs. | | 404 | Resource not found in this workspace. | | 422 | Request failed validation. | | 500 | Internal error. | ## 200 response | Field | Type | Required | Description | | --- | --- | --- | --- | | `success` | true | yes | | | `data` | object | yes | | | `data.id` | string | yes | | | `data.documentId` | string | yes | | | `data.documentName` | string | no | | | `data.senderName` | string | no | | | `data.subject` | string | yes | | | `data.message` | string \| null | no | | | `data.status` | string | yes | One of: draft, awaiting, completing, completed, declined, expired, voided | | `data.routing` | string | yes | One of: parallel, sequential | | `data.expiresAt` | string \| null | no | Format: date-time | | `data.voidReason` | string \| null | no | | | `data.hasSealedDocument` | boolean | no | | | `data.completedAt` | string \| null | no | Format: date-time | | `data.createdAt` | string | no | Format: date-time | | `data.updatedAt` | string | no | Format: date-time | | `data.recipients` | object[] | yes | | | `data.recipients[].id` | string | yes | | | `data.recipients[].name` | string | yes | | | `data.recipients[].email` | string | yes | | | `data.recipients[].role` | string | yes | One of: signer, filler, cc | | `data.recipients[].status` | string | yes | | | `data.recipients[].routingOrder` | integer | yes | | | `data.recipients[].viewedAt` | string \| null | no | Format: date-time | | `data.recipients[].consentedAt` | string \| null | no | Format: date-time | | `data.recipients[].identityVerifiedAt` | string \| null | no | Format: date-time | | `data.recipients[].signedAt` | string \| null | no | Format: date-time | | `data.recipients[].delivery` | string | yes | How their signing link reaches them: "email", or "embedded" (never emailed or reminded; your app signs them with POST /api/v1/embed/signing-sessions). One of: email, embedded | | `data.timeline` | object[] | yes | | | `data.timeline[].type` | string | yes | | | `data.timeline[].at` | string | yes | Format: date-time | | `data.timeline[].actor` | string | no | | See also: [Errors](https://dev.appliflo.com/guides/errors), [Rate limits](https://dev.appliflo.com/guides/rate-limits), [Idempotency](https://dev.appliflo.com/guides/idempotency). Source: https://dev.appliflo.com/api/envelopes/get-envelope --- # Void an envelope > POST /api/v1/envelopes/{id}/void: Void an envelope. `POST https://appliflo.com/api/v1/envelopes/{id}/void` Send your API key in the `Authorization: Bearer` header. Every response is JSON: `{ success, data, error }`. ## Parameters | Name | In | Required | Description | | --- | --- | --- | --- | | `id` | path | yes | Envelope id | ## Request body (application/json) | Field | Type | Required | Description | | --- | --- | --- | --- | | `reason` | string | yes | Up to 1000 characters | ## Responses | Status | Description | | --- | --- | | 200 | Envelope voided. | | 401 | Missing or invalid API key, or `api_key_expired` for a key past its expiry. | | 403 | The API key's workspace does not have access to this resource, or `insufficient_scope` (with `required_scope`) for a key without the scope this route needs. | | 404 | Resource not found in this workspace. | | 409 | The envelope's current status cannot transition to voided. | | 422 | Request failed validation. | | 500 | Internal error. | ## 200 response | Field | Type | Required | Description | | --- | --- | --- | --- | | `success` | true | yes | | | `data` | object | yes | | | `data.status` | string | yes | One of: voided | See also: [Errors](https://dev.appliflo.com/guides/errors), [Rate limits](https://dev.appliflo.com/guides/rate-limits), [Idempotency](https://dev.appliflo.com/guides/idempotency). Source: https://dev.appliflo.com/api/envelopes/void-envelope --- # Send a reminder to recipients blocking signature > POST /api/v1/envelopes/{id}/remind: Send a reminder to recipients blocking signature. `POST https://appliflo.com/api/v1/envelopes/{id}/remind` Send your API key in the `Authorization: Bearer` header. Every response is JSON: `{ success, data, error }`. ## Parameters | Name | In | Required | Description | | --- | --- | --- | --- | | `id` | path | yes | Envelope id | ## Responses | Status | Description | | --- | --- | | 200 | Reminders sent (rate-limited to one per recipient per 24h). | | 401 | Missing or invalid API key, or `api_key_expired` for a key past its expiry. | | 403 | The API key's workspace does not have access to this resource, or `insufficient_scope` (with `required_scope`) for a key without the scope this route needs. | | 404 | Resource not found in this workspace. | | 422 | Request failed validation. | | 500 | Internal error. | ## 200 response | Field | Type | Required | Description | | --- | --- | --- | --- | | `success` | true | yes | | | `data` | object | yes | | | `data.reminded` | integer | yes | | | `data.rateLimited` | integer | yes | | See also: [Errors](https://dev.appliflo.com/guides/errors), [Rate limits](https://dev.appliflo.com/guides/rate-limits), [Idempotency](https://dev.appliflo.com/guides/idempotency). Source: https://dev.appliflo.com/api/envelopes/remind-envelope --- # Download the sealed (completed) document or its completion certificate > GET /api/v1/envelopes/{id}/download: Download the sealed (completed) document or its completion certificate. `GET https://appliflo.com/api/v1/envelopes/{id}/download` Send your API key in the `Authorization: Bearer` header. Every response is JSON: `{ success, data, error }`. ## Parameters | Name | In | Required | Description | | --- | --- | --- | --- | | `id` | path | yes | Envelope id | | `artifact` | query | yes | "sealed" is the signed PDF; "certificate" is the Completion Certificate (signers, timestamps, identity method, document hash, seal details). A certificate that was never generated returns 404. One of: sealed, certificate | ## Responses | Status | Description | | --- | --- | | 200 | Short-lived signed download URL. | | 401 | Missing or invalid API key, or `api_key_expired` for a key past its expiry. | | 403 | The API key's workspace does not have access to this resource, or `insufficient_scope` (with `required_scope`) for a key without the scope this route needs. | | 404 | Resource not found in this workspace. | | 422 | Request failed validation. | | 500 | Internal error. | ## 200 response | Field | Type | Required | Description | | --- | --- | --- | --- | | `success` | true | yes | | | `data` | object | yes | | | `data.url` | string | yes | Format: uri | See also: [Errors](https://dev.appliflo.com/guides/errors), [Rate limits](https://dev.appliflo.com/guides/rate-limits), [Idempotency](https://dev.appliflo.com/guides/idempotency). Source: https://dev.appliflo.com/api/envelopes/download-envelope --- # List the template library available to this workspace > GET /api/v1/templates: List the template library available to this workspace. `GET https://appliflo.com/api/v1/templates` `items` is one list of everything the workspace can start a document from (as the app's Templates page and the MCP list_templates tool): its saved templates first, then AppliFlo's contract templates (kind library), then the official government forms (kind official), filtered by kind, q, country and category and paged with limit/offset (`total` counts every match). `templates` (the old contract-template model, superseded by the library's lib_ items) and `saved_templates` are unchanged for existing integrations. Send your API key in the `Authorization: Bearer` header. Every response is JSON: `{ success, data, error }`. ## Parameters | Name | In | Required | Description | | --- | --- | --- | --- | | `category` | query | no | Filter to one category | | `kind` | query | no | items[] of this kind only. One of: saved, contract, library, official | | `q` | query | no | Words in the name, or an official form's code ("956", "W-9") | | `country` | query | no | items[] for this country only (official forms and saved copies of them). One of: US, AU | | `limit` | query | no | | | `offset` | query | no | | ## Responses | Status | Description | | --- | --- | | 200 | The one list (`items`, `total`, `limit`, `offset`); the workspace's own contract templates plus the curated system ones (`templates`, deprecated); and its saved templates with recipient roles (`saved_templates`: status, current version, roles, sender boxes; empty when a category is given). | | 401 | Missing or invalid API key, or `api_key_expired` for a key past its expiry. | | 403 | The API key's workspace does not have access to this resource, or `insufficient_scope` (with `required_scope`) for a key without the scope this route needs. | | 404 | Resource not found in this workspace. | | 422 | Request failed validation. | | 500 | Internal error. | ## 200 response | Field | Type | Required | Description | | --- | --- | --- | --- | | `success` | true | yes | | | `data` | object | yes | | | `data.templates` | object[] | yes | | | `data.templates[].template_id` | string | yes | | | `data.templates[].name` | string | yes | | | `data.templates[].category` | string | yes | | | `data.templates[].version` | integer | yes | | | `data.templates[].status` | string | yes | One of: draft, published, archived | | `data.templates[].lawyer_reviewed` | boolean | yes | false means the base text has not been reviewed by counsel. Surface this to the user before they send — every draft also carries a review notice | | `data.templates[].scope` | string | yes | One of: system, workspace | | `data.templates[].recipients_required` | integer | yes | How many recipients the template's party roles need, in order | | `data.templates[].required_values` | object[] | yes | One entry per {{placeholder}} in the prose. Every key must be supplied to create-document | | `data.templates[].required_values[].key` | string | yes | | | `data.templates[].required_values[].label` | string | yes | | | `data.templates[].required_values[].semantic_type` | string | yes | | | `data.templates[].party_fields` | object[] | yes | Signature/name/date fields bound to a party role, pre-assigned to recipients positionally | | `data.templates[].party_fields[].slot_id` | string | yes | | | `data.templates[].party_fields[].label` | string | yes | | | `data.templates[].party_fields[].semantic_type` | string | yes | | | `data.templates[].party_fields[].party` | string | yes | | | `data.saved_templates` | object[] | yes | | | `data.saved_templates[].template_id` | string | yes | | | `data.saved_templates[].kind` | "saved" | yes | | | `data.saved_templates[].name` | string | yes | | | `data.saved_templates[].status` | string | yes | Only a ready template can be sent; a draft is refused with 409 template_not_ready. One of: draft, ready | | `data.saved_templates[].version` | integer \| null | yes | The current version (null while draft). POST /templates/{id}/bulk requires it | | `data.saved_templates[].field_count` | integer | yes | At least 0 | | `data.saved_templates[].pages` | integer | yes | At least 1 | | `data.saved_templates[].roles` | object[] | yes | Recipient roles, in signing order (the current version's; a draft's planned ones) | | `data.saved_templates[].roles[].key` | string | yes | The key send and bulk take in `people` / `recipients[].role`, e.g. "r1" | | `data.saved_templates[].roles[].label` | string | yes | The role's name, e.g. "Client" | | `data.saved_templates[].roles[].kind` | string | yes | signer: fills and signs; filler: fills only. One of: signer, filler | | `data.saved_templates[].roles[].order` | integer | yes | Signing order. At least 1 | | `data.saved_templates[].sender_fields` | object[] | yes | The boxes the sender fills (empty while draft) | | `data.saved_templates[].sender_fields[].index` | integer | yes | The prefill key. At least 0 | | `data.saved_templates[].sender_fields[].label` | string \| null | yes | | | `data.saved_templates[].sender_fields[].type` | string | yes | One of: text, checkbox, signature | | `data.saved_templates[].sender_fields[].semantic_type` | string | yes | | | `data.saved_templates[].sender_fields[].group_key` | string \| null | yes | The choice question this box is an option of (answer with an option value) | | `data.saved_templates[].sender_fields[].option_value` | string \| null | yes | | | `data.saved_templates[].sender_fields[].bulk` | boolean | yes | A plain text box a bulk row's prefill may set | | `data.saved_templates[].fixed_fields` | object[] | yes | The boxes the template fills itself (empty while draft) | | `data.saved_templates[].fixed_fields[].index` | integer | yes | The fixed_overrides key. At least 0 | | `data.saved_templates[].fixed_fields[].label` | string \| null | yes | | | `data.saved_templates[].fixed_fields[].type` | string | yes | One of: text, checkbox, signature | | `data.saved_templates[].fixed_fields[].locked` | boolean | yes | True: set by the template, an override is 422 locked_field | | `data.saved_templates[].fixed_fields[].bulk` | boolean | yes | A Default text box a bulk row's prefill may set (its value becomes that row's override) | | `data.saved_templates[].source` | string | yes | doc: saved from a Docs doc (no PDF; send it to many, or use it from Docs). One of: document, official, upload, doc | | `data.saved_templates[].official_form_slug` | string \| null | yes | | | `data.saved_templates[].created_at` | string | yes | Format: date-time | | `data.saved_templates[].updated_at` | string | yes | Format: date-time | | `data.items` | object[] | yes | | | `data.items[].template_id` | string | yes | | | `data.items[].kind` | string | yes | One of: saved, contract, library, official | | `data.items[].name` | string | yes | | | `data.items[].status` | string | yes | ready: set up with roles (send it, or create a document with each role's person). draft: a saved template an owner or admin hasn't finalised, or an official form AppliFlo hasn't set up (POST /templates/{id}/create-document imports it as a document with its fields read; it can't be sent from a template). One of: draft, ready | | `data.items[].version` | integer \| null | yes | The current version (null while draft). POST /templates/{id}/bulk requires it | | `data.items[].field_count` | integer | yes | At least 0 | | `data.items[].pages` | integer \| null | yes | At least 1 | | `data.items[].roles` | object[] | yes | Recipient roles, in signing order (the current version's; a draft's planned ones) | | `data.items[].roles[].key` | string | yes | The key send and bulk take in `people` / `recipients[].role`, e.g. "r1" | | `data.items[].roles[].label` | string | yes | The role's name, e.g. "Client" | | `data.items[].roles[].kind` | string | yes | signer: fills and signs; filler: fills only. One of: signer, filler | | `data.items[].roles[].order` | integer | yes | Signing order. At least 1 | | `data.items[].sender_fields` | object[] | yes | The boxes the sender fills (empty while draft) | | `data.items[].sender_fields[].index` | integer | yes | The prefill key. At least 0 | | `data.items[].sender_fields[].label` | string \| null | yes | | | `data.items[].sender_fields[].type` | string | yes | One of: text, checkbox, signature | | `data.items[].sender_fields[].semantic_type` | string | yes | | | `data.items[].sender_fields[].group_key` | string \| null | yes | The choice question this box is an option of (answer with an option value) | | `data.items[].sender_fields[].option_value` | string \| null | yes | | | `data.items[].sender_fields[].bulk` | boolean | yes | A plain text box a bulk row's prefill may set | | `data.items[].fixed_fields` | object[] | yes | The boxes the template fills itself (empty while draft) | | `data.items[].fixed_fields[].index` | integer | yes | The fixed_overrides key. At least 0 | | `data.items[].fixed_fields[].label` | string \| null | yes | | | `data.items[].fixed_fields[].type` | string | yes | One of: text, checkbox, signature | | `data.items[].fixed_fields[].locked` | boolean | yes | True: set by the template, an override is 422 locked_field | | `data.items[].fixed_fields[].bulk` | boolean | yes | A Default text box a bulk row's prefill may set (its value becomes that row's override) | | `data.items[].source` | string | no | doc: saved from a Docs doc (no PDF; send it to many, or use it from Docs). One of: document, official, upload, doc | | `data.items[].official_form_slug` | string \| null | yes | | | `data.items[].created_at` | string | no | Format: date-time | | `data.items[].updated_at` | string | no | Format: date-time | | `data.items[].summary` | string \| null | yes | | | `data.items[].category` | string \| null | yes | | | `data.items[].country` | string \| null | yes | An official form's country (or a saved copy of one). One of: US, AU, null | | `data.items[].official_form` | object \| null | yes | | | `data.items[].official_form.slug` | string | yes | | | `data.items[].official_form.code` | string | yes | As printed: "956", "W-9" | | `data.items[].official_form.label` | string | yes | "Form 956" for Home Affairs, else the code | | `data.items[].official_form.title` | string | yes | | | `data.items[].official_form.agency` | string | yes | | | `data.items[].official_form.agency_name` | string | yes | | | `data.items[].esign` | object \| null | yes | The agency's e-sign rule. block: fill and print only (every send is refused with 422 esign_not_allowed). warn: send with esign_risk_acknowledged: true | | `data.items[].esign.mode` | string | yes | One of: block, warn | | `data.items[].esign.notice` | string | yes | | | `data.items[].recipients_required` | integer | no | kind contract: how many parties (recipients, in order) a draft needs. At least 0 | | `data.items[].required_values` | object[] | no | kind contract: one value per key, required by create-document | | `data.items[].party_fields` | object[] | no | kind contract: the signature/name/date blocks bound to each party | | `data.items[].lawyer_reviewed` | boolean | no | kind contract: whether the base text has been through legal review | | `data.items[].own_risk` | boolean | yes | An AppliFlo contract no lawyer has reviewed: sent or drafted only with risk_accepted: true (Terms 8A) unless the person already accepted that version | | `data.items[].setup_required` | boolean | yes | The app asks this workspace's one-time set-up of the form (business details, who sends it) before the first use. Without it, a box the set-up answers is refused with 422 unanswered_ask or missing_detail: give it in fixed_overrides, or have an owner or admin set the form up in the app | | `data.total` | integer | yes | At least 0 | | `data.limit` | integer | yes | At least 1 | | `data.offset` | integer | yes | At least 0 | See also: [Errors](https://dev.appliflo.com/guides/errors), [Rate limits](https://dev.appliflo.com/guides/rate-limits), [Idempotency](https://dev.appliflo.com/guides/idempotency). Source: https://dev.appliflo.com/api/templates/list-templates --- # Draft a document from a template > POST /api/v1/templates/{id}/create-document: Draft a document from a template. `POST https://appliflo.com/api/v1/templates/{id}/create-document` An AppliFlo library item or official form (a lib_ id from items[]) is the app's Use: a ready item drafts with each role's person bound (an unreviewed contract needs risk_accepted: true unless the person already accepted that version); a form AppliFlo hasn't set up is imported as a new document and its fields are read, and recipients are added when you send. The e-sign rule applies at send (a fill-and-print-only form drafts, but every send refuses it). Any other id is the older contract-template model (values + recipients in party order). Saved templates: POST /saved-templates/{id}/create-document. Send your API key in the `Authorization: Bearer` header. Every response is JSON: `{ success, data, error }`. ## Parameters | Name | In | Required | Description | | --- | --- | --- | --- | | `id` | path | yes | Template id from GET /templates (items[].template_id for a lib_ item) | | `Idempotency-Key` | header | no | A client-generated key scoping this request as a retry of a prior identical request. A replay within 24h returns the first response instead of repeating the side effect (e.g. a second send). The key is bound to the request it was first used with: the same key with a different body or target is refused (422, code idempotency_key_reused) | ## Request body (application/json) ## Responses | Status | Description | | --- | --- | | 201 | Drafted document, with its fields already placed and bound to the recipients (an imported form: its fields as read). | | 400 | invalid_json: a lib_ request body that isn't JSON (an empty body counts as {}). | | 401 | Missing or invalid API key, or `api_key_expired` for a key past its expiry. | | 403 | The API key's workspace does not have access to this resource, or `insufficient_scope` (with `required_scope`) for a key without the scope this route needs. | | 404 | Resource not found in this workspace. | | 409 | contract_risk_required: an unreviewed AppliFlo contract the person hasn't accepted (send risk_accepted: true after asking them). | | 410 | retired: the official form was retired. | | 422 | Request failed validation. | | 429 | rate_limited: more than 20 official forms imported by this key in 10 minutes (as the app's import). Retry-After says when. | | 500 | Internal error. | | 503 | form_unavailable: the form's hosted copy is unavailable. Retry-After: 300. | ## 201 response | Field | Type | Required | Description | | --- | --- | --- | --- | | `success` | true | yes | | | `data` | object \| object | yes | | See also: [Errors](https://dev.appliflo.com/guides/errors), [Rate limits](https://dev.appliflo.com/guides/rate-limits), [Idempotency](https://dev.appliflo.com/guides/idempotency). Source: https://dev.appliflo.com/api/templates/create-document-from-template --- # Get one template > GET /api/v1/templates/{id}: Get one template. `GET https://appliflo.com/api/v1/templates/{id}` The template as GET /templates lists it in items[] (and MCP get_template returns it): a saved template (every saved_templates[] field), an AppliFlo contract or an official form (a lib_ id). Its status (only `ready` sends), current version, each role's key, label, kind and signing order, and the boxes the sender may prefill. Another workspace's template is a 404. Send your API key in the `Authorization: Bearer` header. Every response is JSON: `{ success, data, error }`. ## Parameters | Name | In | Required | Description | | --- | --- | --- | --- | | `id` | path | yes | Saved template id (saved_templates[].template_id from GET /templates) | ## Responses | Status | Description | | --- | --- | | 200 | The template. | | 401 | Missing or invalid API key, or `api_key_expired` for a key past its expiry. | | 403 | The API key's workspace does not have access to this resource, or `insufficient_scope` (with `required_scope`) for a key without the scope this route needs. | | 404 | Resource not found in this workspace. | | 422 | Request failed validation. | | 500 | Internal error. | ## 200 response | Field | Type | Required | Description | | --- | --- | --- | --- | | `success` | true | yes | | | `data` | object | yes | | | `data.template` | object | yes | A saved template (kind saved, every saved_templates[] field), a contract template the workspace wrote in the older model (kind contract: drafted with values + recipients in party order), an AppliFlo contract template (kind library) or an official government form (kind official). Library and official ids are "lib_" | | `data.template.template_id` | string | yes | | | `data.template.kind` | string | yes | One of: saved, contract, library, official | | `data.template.name` | string | yes | | | `data.template.status` | string | yes | ready: set up with roles (send it, or create a document with each role's person). draft: a saved template an owner or admin hasn't finalised, or an official form AppliFlo hasn't set up (POST /templates/{id}/create-document imports it as a document with its fields read; it can't be sent from a template). One of: draft, ready | | `data.template.version` | integer \| null | yes | The current version (null while draft). POST /templates/{id}/bulk requires it | | `data.template.field_count` | integer | yes | At least 0 | | `data.template.pages` | integer \| null | yes | At least 1 | | `data.template.roles` | object[] | yes | Recipient roles, in signing order (the current version's; a draft's planned ones) | | `data.template.roles[].key` | string | yes | The key send and bulk take in `people` / `recipients[].role`, e.g. "r1" | | `data.template.roles[].label` | string | yes | The role's name, e.g. "Client" | | `data.template.roles[].kind` | string | yes | signer: fills and signs; filler: fills only. One of: signer, filler | | `data.template.roles[].order` | integer | yes | Signing order. At least 1 | | `data.template.sender_fields` | object[] | yes | The boxes the sender fills (empty while draft) | | `data.template.sender_fields[].index` | integer | yes | The prefill key. At least 0 | | `data.template.sender_fields[].label` | string \| null | yes | | | `data.template.sender_fields[].type` | string | yes | One of: text, checkbox, signature | | `data.template.sender_fields[].semantic_type` | string | yes | | | `data.template.sender_fields[].group_key` | string \| null | yes | The choice question this box is an option of (answer with an option value) | | `data.template.sender_fields[].option_value` | string \| null | yes | | | `data.template.sender_fields[].bulk` | boolean | yes | A plain text box a bulk row's prefill may set | | `data.template.fixed_fields` | object[] | yes | The boxes the template fills itself (empty while draft) | | `data.template.fixed_fields[].index` | integer | yes | The fixed_overrides key. At least 0 | | `data.template.fixed_fields[].label` | string \| null | yes | | | `data.template.fixed_fields[].type` | string | yes | One of: text, checkbox, signature | | `data.template.fixed_fields[].locked` | boolean | yes | True: set by the template, an override is 422 locked_field | | `data.template.fixed_fields[].bulk` | boolean | yes | A Default text box a bulk row's prefill may set (its value becomes that row's override) | | `data.template.source` | string | no | doc: saved from a Docs doc (no PDF; send it to many, or use it from Docs). One of: document, official, upload, doc | | `data.template.official_form_slug` | string \| null | yes | | | `data.template.created_at` | string | no | Format: date-time | | `data.template.updated_at` | string | no | Format: date-time | | `data.template.summary` | string \| null | yes | | | `data.template.category` | string \| null | yes | | | `data.template.country` | string \| null | yes | An official form's country (or a saved copy of one). One of: US, AU, null | | `data.template.official_form` | object \| null | yes | | | `data.template.official_form.slug` | string | yes | | | `data.template.official_form.code` | string | yes | As printed: "956", "W-9" | | `data.template.official_form.label` | string | yes | "Form 956" for Home Affairs, else the code | | `data.template.official_form.title` | string | yes | | | `data.template.official_form.agency` | string | yes | | | `data.template.official_form.agency_name` | string | yes | | | `data.template.esign` | object \| null | yes | The agency's e-sign rule. block: fill and print only (every send is refused with 422 esign_not_allowed). warn: send with esign_risk_acknowledged: true | | `data.template.esign.mode` | string | yes | One of: block, warn | | `data.template.esign.notice` | string | yes | | | `data.template.recipients_required` | integer | no | kind contract: how many parties (recipients, in order) a draft needs. At least 0 | | `data.template.required_values` | object[] | no | kind contract: one value per key, required by create-document | | `data.template.party_fields` | object[] | no | kind contract: the signature/name/date blocks bound to each party | | `data.template.lawyer_reviewed` | boolean | no | kind contract: whether the base text has been through legal review | | `data.template.own_risk` | boolean | yes | An AppliFlo contract no lawyer has reviewed: sent or drafted only with risk_accepted: true (Terms 8A) unless the person already accepted that version | | `data.template.setup_required` | boolean | yes | The app asks this workspace's one-time set-up of the form (business details, who sends it) before the first use. Without it, a box the set-up answers is refused with 422 unanswered_ask or missing_detail: give it in fixed_overrides, or have an owner or admin set the form up in the app | See also: [Errors](https://dev.appliflo.com/guides/errors), [Rate limits](https://dev.appliflo.com/guides/rate-limits), [Idempotency](https://dev.appliflo.com/guides/idempotency). Source: https://dev.appliflo.com/api/saved-templates/get-template --- # Send a Ready saved template > POST /api/v1/templates/{id}/send: Send a Ready saved template. `POST https://appliflo.com/api/v1/templates/{id}/send` Creates a document from the template's finalised version (its own copy of the PDF and every box) and sends it in one call: each role's person, in the template's signing order, fills and signs only their boxes; the template's fixed CCs, reminders and expiry apply. The template is never modified, and the envelope keeps its version. A person with delivery "embedded" is never emailed: your app signs them with POST /api/v1/embed/signing-sessions (Business plan or a sandbox). Send your API key in the `Authorization: Bearer` header. Every response is JSON: `{ success, data, error }`. ## Parameters | Name | In | Required | Description | | --- | --- | --- | --- | | `id` | path | yes | A Ready template's id from GET /templates items[]: a saved template, or an AppliFlo contract or official form AppliFlo set up (lib_). A form AppliFlo hasn't set up can't be sent this way: create a document from it (POST /templates/{id}/create-document), then send that | | `Idempotency-Key` | header | no | A client-generated key scoping this request as a retry of a prior identical request. A replay within 24h returns the first response instead of repeating the side effect (e.g. a second send). The key is bound to the request it was first used with: the same key with a different body or target is refused (422, code idempotency_key_reused) | ## Request body (application/json) | Field | Type | Required | Description | | --- | --- | --- | --- | | `version` | integer | no | Pin a version. Defaults to the template's current version. At least 1 | | `recipients` | object[] | yes | One person per template role. Every role needs a person; two roles can't share an email. 1 to 10 items | | `recipients[].role` | string | yes | The role's key ("r1") or its label ("Client", case-insensitive). Up to 60 characters | | `recipients[].name` | string | yes | Up to 256 characters | | `recipients[].email` | string | yes | Format: email. Up to 254 characters | | `recipients[].accessCode` | string | no | Identity check before signing. Default "email": a one-time code is emailed with the invite. "none" switches it off. Ignored for an embedded recipient. One of: email, none | | `recipients[].delivery` | string | no | How the signing link reaches them. "email" (default): invited, reminded and sent any access code by email. "embedded": never emailed (no invite, no reminders, no access code); when their turn comes, your app signs them in its own page with POST /api/v1/embed/signing-sessions, and the document's activity reads "Waiting for to sign in your app". Needs the Business plan or a sandbox workspace (402 `plan_feature`). A cc can't be embedded (422 `cc_not_embeddable`). One of: email, embedded. Default: "email" | | `cc` | object[] | no | Extra copies, added to the template's fixed CCs (which can't be removed). Duplicates are dropped. Up to 20 items | | `cc[].email` | string | yes | Format: email | | `cc[].name` | string | no | Up to 120 characters | | `prefill` | map of string \| string[] | no | Values for the boxes the template gives the SENDER, keyed by the version's field index. A box in a choice question takes the question's answer (an option value, or a list for a multi-choice question). A key for a box a recipient fills is refused with role_owned_field | | `fixed_overrides` | map of string \| boolean \| string[] | no | The sender's values for the template's DEFAULT fixed boxes (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 box is set by the template: an override is refused with 422 locked_field. A Locked box whose workspace or My details value is empty is refused with 422 missing_detail. An AppliFlo library form's Ask on copy box that nothing answers is refused with 422 unanswered_ask: give it a value here | | `remember_defaults` | integer[] | no | fixed_fields[].index of Default boxes whose fixed_overrides value is saved as the template's default for everyone, once the envelope is sent. A Locked box is refused (422 locked_field) | | `local_day` | string | no | The sender's own calendar day (YYYY-MM-DD) for fixed date boxes; defaults to the server's UTC day | | `esign_risk_acknowledged` | boolean | no | Some hosted government forms (USCIS I-130 and others, SSA SS-5, IRS 8879 and 4506-C, the Commonwealth statutory declaration) are fill-and-print only: a send of one is refused (422 esign_not_allowed) whatever this says; download the filled PDF instead. A form whose agency may reject an e-signature needs true (422 esign_ack_required without it) | | `risk_accepted` | boolean | no | An AppliFlo library contract that AppliFlo's lawyer hasn't reviewed is sent at your own risk (Terms section 8A). Not needed when the sender already accepted this contract version (in the app or an earlier send); otherwise send true to confirm it, or such a contract is refused with 409 contract_risk_required. The confirmation is recorded (with the request's IP and browser) only when the send goes ahead | | `adopt_signature` | boolean | no | The sender adopts their saved signature for this envelope. A template with a Sender-signs box needs a signed-in sender who adopts it: sent with an API key, such a template is refused (422 signature_not_adopted, "Sender signatures need a signed-in sender.") | | `subject` | string | no | Defaults to the template's subject. Placeholders such as {{Recipient 1 name}} are resolved. Up to 200 characters | | `message` | string | no | Defaults to the template's message. {{Recipient first name}} becomes each recipient's own first name. Up to 4000 characters | ## Responses | Status | Description | | --- | --- | | 201 | The envelope was created and its first recipients emailed. | | 401 | Missing or invalid API key, or `api_key_expired` for a key past its expiry. | | 402 | `plan_feature`: a person with delivery "embedded" needs the Business plan (or a sandbox workspace). | | 403 | The API key's workspace does not have access to this resource, or `insufficient_scope` (with `required_scope`) for a key without the scope this route needs. | | 404 | Resource not found in this workspace. | | 409 | Refused, with a `code`: template_not_ready (still a Draft: an owner or admin must finalise it in the app) or contract_risk_required (an unreviewed AppliFlo library contract the sender hasn't accepted yet: send risk_accepted: true). | | 422 | Refused, with a `code`: missing_person, unknown_role, duplicate_email, role_owned_field, unknown_field, cc_invalid, subject_invalid, cc_not_embeddable, invalid. | | 500 | Internal error. | ## 201 response | Field | Type | Required | Description | | --- | --- | --- | --- | | `success` | true | yes | | | `data` | object | yes | | | `data.envelope_id` | string | yes | | | `data.invited` | integer | yes | Recipients emailed now (sequential routing emails the first role only). At least 0 | | `data.template_version` | integer | yes | The version the envelope was made from; it keeps it. At least 1 | See also: [Errors](https://dev.appliflo.com/guides/errors), [Rate limits](https://dev.appliflo.com/guides/rate-limits), [Idempotency](https://dev.appliflo.com/guides/idempotency). Source: https://dev.appliflo.com/api/saved-templates/send-from-template --- # List a saved template's versions > GET /api/v1/templates/{id}/versions: List a saved template's versions. `GET https://appliflo.com/api/v1/templates/{id}/versions` Finalised versions, newest first, with how many envelopes each sent. A Draft that was never finalised has none. Send your API key in the `Authorization: Bearer` header. Every response is JSON: `{ success, data, error }`. ## Parameters | Name | In | Required | Description | | --- | --- | --- | --- | | `id` | path | yes | Saved template id (saved_templates[].template_id from GET /templates) | ## Responses | Status | Description | | --- | --- | | 200 | Versions, newest first. | | 401 | Missing or invalid API key, or `api_key_expired` for a key past its expiry. | | 403 | The API key's workspace does not have access to this resource, or `insufficient_scope` (with `required_scope`) for a key without the scope this route needs. | | 404 | Resource not found in this workspace. | | 422 | Request failed validation. | | 500 | Internal error. | ## 200 response | Field | Type | Required | Description | | --- | --- | --- | --- | | `success` | true | yes | | | `data` | object | yes | | | `data.versions` | object[] | yes | | | `data.versions[].version` | integer | yes | At least 1 | | `data.versions[].current` | boolean | yes | | | `data.versions[].note` | string \| null | yes | | | `data.versions[].field_count` | integer | yes | At least 0 | | `data.versions[].envelope_count` | integer | yes | Envelopes sent from this version. At least 0 | | `data.versions[].created_at` | string | yes | Format: date-time | See also: [Errors](https://dev.appliflo.com/guides/errors), [Rate limits](https://dev.appliflo.com/guides/rate-limits), [Idempotency](https://dev.appliflo.com/guides/idempotency). Source: https://dev.appliflo.com/api/saved-templates/list-template-versions --- # Get one version of a saved template > GET /api/v1/templates/{id}/versions/{n}: Get one version of a saved template. `GET https://appliflo.com/api/v1/templates/{id}/versions/{n}` Its roles in signing order, the boxes the sender fills (prefill keys) and the send settings. A finalised version never changes. Send your API key in the `Authorization: Bearer` header. Every response is JSON: `{ success, data, error }`. ## Parameters | Name | In | Required | Description | | --- | --- | --- | --- | | `id` | path | yes | Saved template id (saved_templates[].template_id from GET /templates) | | `n` | path | yes | Version number | ## Responses | Status | Description | | --- | --- | | 200 | The version. | | 401 | Missing or invalid API key, or `api_key_expired` for a key past its expiry. | | 403 | The API key's workspace does not have access to this resource, or `insufficient_scope` (with `required_scope`) for a key without the scope this route needs. | | 404 | Resource not found in this workspace. | | 422 | Request failed validation. | | 500 | Internal error. | ## 200 response | Field | Type | Required | Description | | --- | --- | --- | --- | | `success` | true | yes | | | `data` | object | yes | | | `data.version` | object | yes | | | `data.version.template_id` | string | yes | | | `data.version.version` | integer | yes | At least 1 | | `data.version.current` | boolean | yes | | | `data.version.note` | string \| null | yes | | | `data.version.field_count` | integer | yes | At least 0 | | `data.version.created_at` | string | yes | Format: date-time | | `data.version.roles` | object[] | yes | | | `data.version.roles[].key` | string | yes | The key send and bulk take in `people` / `recipients[].role`, e.g. "r1" | | `data.version.roles[].label` | string | yes | The role's name, e.g. "Client" | | `data.version.roles[].kind` | string | yes | signer: fills and signs; filler: fills only. One of: signer, filler | | `data.version.roles[].order` | integer | yes | Signing order. At least 1 | | `data.version.sender_fields` | object[] | yes | | | `data.version.sender_fields[].index` | integer | yes | The prefill key. At least 0 | | `data.version.sender_fields[].label` | string \| null | yes | | | `data.version.sender_fields[].type` | string | yes | One of: text, checkbox, signature | | `data.version.sender_fields[].semantic_type` | string | yes | | | `data.version.sender_fields[].group_key` | string \| null | yes | The choice question this box is an option of (answer with an option value) | | `data.version.sender_fields[].option_value` | string \| null | yes | | | `data.version.sender_fields[].bulk` | boolean | yes | A plain text box a bulk row's prefill may set | | `data.version.fixed_fields` | object[] | yes | | | `data.version.fixed_fields[].index` | integer | yes | The fixed_overrides key. At least 0 | | `data.version.fixed_fields[].label` | string \| null | yes | | | `data.version.fixed_fields[].type` | string | yes | One of: text, checkbox, signature | | `data.version.fixed_fields[].locked` | boolean | yes | True: set by the template, an override is 422 locked_field | | `data.version.fixed_fields[].bulk` | boolean | yes | A Default text box a bulk row's prefill may set (its value becomes that row's override) | | `data.version.routing` | string | yes | One of: sequential, parallel | | `data.version.subject` | string | yes | | | `data.version.message` | string | yes | | | `data.version.cc` | object[] | yes | | | `data.version.cc[].email` | string | yes | | | `data.version.cc[].name` | string \| null | yes | | | `data.version.expiry_days` | integer \| null | yes | | See also: [Errors](https://dev.appliflo.com/guides/errors), [Rate limits](https://dev.appliflo.com/guides/rate-limits), [Idempotency](https://dev.appliflo.com/guides/idempotency). Source: https://dev.appliflo.com/api/saved-templates/get-template-version --- # Send a Ready saved template to many > POST /api/v1/templates/{id}/bulk: Send a Ready saved template to many. `POST https://appliflo.com/api/v1/templates/{id}/bulk` One envelope per row. Every row is checked like the app's review step: a blank row, a missing or invalid email, the same person twice for a role, or two roles sharing an email leaves that row out (reported in rows[]); the rest are queued and sent in the background, paced under the email limit. Each sent envelope is metered once, like a single send (envelope.sent, source api). Poll GET /bulk-batches/{id}. An Idempotency-Key returns the batch the key already made. Limits: the batch must fit this month's envelopes (quota_exceeded), a workspace runs at most 2 batches at once (too_many_running), and a key starts at most 10 batches a minute (429). A batch pauses if the month's envelopes run out or the workspace is suspended, and resumes on its own. Send your API key in the `Authorization: Bearer` header. Every response is JSON: `{ success, data, error }`. ## Parameters | Name | In | Required | Description | | --- | --- | --- | --- | | `id` | path | yes | Saved template id (saved_templates[].template_id from GET /templates) | | `Idempotency-Key` | header | no | A client-generated key scoping this request as a retry of a prior identical request. A replay within 24h returns the first response instead of repeating the side effect (e.g. a second send). The key is bound to the request it was first used with: the same key with a different body or target is refused (422, code idempotency_key_reused) | ## Request body (application/json) | Field | Type | Required | Description | | --- | --- | --- | --- | | `version` | integer | yes | The template's current version (from GET /templates). A stale one is refused with 409 version_mismatch. At least 1 | | `rows` | object[] | yes | One envelope per row; at most 500 per request (more is 422 too_many_rows). 1 to 500 items | | `rows[].people` | map of object | yes | roleKey -> person, one per role | | `rows[].prefill` | map of string | no | sender_fields[].index or fixed_fields[].index (with bulk: true) -> text. A Default fixed box's value is that row's override; a Locked one is refused (422 locked_field) | | `rows[].cc` | object[] | no | Extra copies for this row's envelope. Up to 20 items | | `rows[].cc[].email` | string | yes | Format: email | | `rows[].cc[].name` | string | no | Up to 120 characters | | `subject` | string | no | Defaults to the template's subject; placeholders resolve per row. Up to 200 characters | | `message` | string | no | Up to 4000 characters | | `time_zone` | string | no | The sender's IANA time zone (e.g. Australia/Sydney): fixed date boxes such as "Date it's sent" count from the sender's own day, per row at its send time. Defaults to UTC; an unknown zone is 422. Up to 64 characters | | `esign_risk_acknowledged` | boolean | no | Some hosted government forms (USCIS I-130 and others, SSA SS-5, IRS 8879 and 4506-C, the Commonwealth statutory declaration) are fill-and-print only: a send of one is refused (422 esign_not_allowed) whatever this says; download the filled PDF instead. A form whose agency may reject an e-signature needs true (422 esign_ack_required without it) | | `adopt_signature` | boolean | no | The starter adopts their saved signature for every envelope (a template with a Sender-signs box). Only a signed-in sender can: with an API key such a template is refused (422 signature_not_adopted, "Sender signatures need a signed-in sender.") | | `risk_accepted` | boolean | no | An AppliFlo library contract that AppliFlo's lawyer hasn't reviewed is sent at your own risk (Terms section 8A). Send true to confirm it, on every start. Without it, such a contract is refused with 409 contract_risk_required | ## Responses | Status | Description | | --- | --- | | 202 | The batch is queued; rows[] reports each row. | | 401 | Missing or invalid API key, or `api_key_expired` for a key past its expiry. | | 403 | The API key's workspace does not have access to this resource, or `insufficient_scope` (with `required_scope`) for a key without the scope this route needs. | | 404 | Resource not found in this workspace. | | 409 | Refused, with a `code`: template_not_ready (still a Draft), version_mismatch (the template was finalised again; read GET /templates and retry), too_many_running (2 batches are already sending: wait or cancel one) or contract_risk_required (an unreviewed AppliFlo library contract: send risk_accepted: true). | | 422 | Refused, with a `code`: too_many_rows, quota_exceeded (more envelopes than this month has left), nothing_to_send (with rows[]: every row needs a fix), unknown_role, role_owned_field, unknown_field, cc_invalid, subject_invalid, invalid. A row-level refusal names the row ("Row 3: …"). | | 429 | Too many batches started in the last minute (10 per key). Retry after the Retry-After header's seconds. | | 500 | Internal error. | ## 202 response | Field | Type | Required | Description | | --- | --- | --- | --- | | `success` | true | yes | | | `data` | object | yes | | | `data.batch_id` | string | yes | | | `data.status` | string | yes | One of: queued, sending, paused, cancelled, done | | `data.template_version` | integer | yes | | | `data.counts` | object | yes | | | `data.counts.total` | integer | yes | | | `data.counts.queued` | integer | yes | | | `data.counts.sent` | integer | yes | | | `data.counts.failed` | integer | yes | | | `data.counts.excluded` | integer | yes | | | `data.counts.cancelled` | integer | yes | | | `data.rows` | object[] | yes | | | `data.rows[].row` | integer | yes | 1-based position in the request's rows. At least 1 | | `data.rows[].status` | string | yes | One of: queued, excluded | | `data.rows[].issues` | object[] | yes | | | `data.rows[].issues[].code` | string | yes | One of: blank, missing_name, missing_email, invalid_email, duplicate, same_email | | `data.rows[].issues[].role` | string \| null | yes | | | `data.rows[].issues[].message` | string | yes | | See also: [Errors](https://dev.appliflo.com/guides/errors), [Rate limits](https://dev.appliflo.com/guides/rate-limits), [Idempotency](https://dev.appliflo.com/guides/idempotency). Source: https://dev.appliflo.com/api/saved-templates/send-template-bulk --- # Get a send-to-many batch > GET /api/v1/bulk-batches/{id}: Get a send-to-many batch. `GET https://appliflo.com/api/v1/bulk-batches/{id}` Status, counts, and each row's status, envelope id and last error. Polling while rows are queued also nudges sending along. Send your API key in the `Authorization: Bearer` header. Every response is JSON: `{ success, data, error }`. ## Parameters | Name | In | Required | Description | | --- | --- | --- | --- | | `id` | path | yes | batch_id from POST /templates/{id}/bulk | ## Responses | Status | Description | | --- | --- | | 200 | The batch. | | 401 | Missing or invalid API key, or `api_key_expired` for a key past its expiry. | | 403 | The API key's workspace does not have access to this resource, or `insufficient_scope` (with `required_scope`) for a key without the scope this route needs. | | 404 | Resource not found in this workspace. | | 422 | Request failed validation. | | 500 | Internal error. | ## 200 response | Field | Type | Required | Description | | --- | --- | --- | --- | | `success` | true | yes | | | `data` | object | yes | | | `data.batch_id` | string | yes | | | `data.template_id` | string | yes | | | `data.template_version` | integer | yes | | | `data.status` | string | yes | One of: queued, sending, paused, cancelled, done | | `data.pause_reason` | string \| null | yes | Why a paused batch waits: this month's envelopes ran out, or the workspace is suspended. It resumes on its own. One of: quota, suspended, null | | `data.source` | string | yes | One of: web, api, mcp | | `data.created_at` | string | yes | Format: date-time | | `data.finished_at` | string \| null | yes | Format: date-time | | `data.counts` | object | yes | | | `data.counts.total` | integer | yes | | | `data.counts.queued` | integer | yes | | | `data.counts.sent` | integer | yes | | | `data.counts.failed` | integer | yes | | | `data.counts.excluded` | integer | yes | | | `data.counts.cancelled` | integer | yes | | | `data.rows` | object[] | yes | | | `data.rows[].row` | integer | yes | | | `data.rows[].status` | string | yes | One of: queued, sent, failed, excluded, cancelled | | `data.rows[].envelope_id` | string \| null | yes | | | `data.rows[].error` | string \| null | yes | | | `data.rows[].error_code` | string \| null | yes | Why it failed: transient (retry-failed can help), permanent (the email provider refused it) or bounced. One of: transient, permanent, bounced, null | | `data.rows[].needs_fix` | boolean | yes | Retrying as is can't help: PATCH /bulk-batches/{id}/rows/{row} with a change first | | `data.rows[].attempts` | integer | yes | | See also: [Errors](https://dev.appliflo.com/guides/errors), [Rate limits](https://dev.appliflo.com/guides/rate-limits), [Idempotency](https://dev.appliflo.com/guides/idempotency). Source: https://dev.appliflo.com/api/saved-templates/get-bulk-batch --- # Retry a batch's failed rows > POST /api/v1/bulk-batches/{id}/retry-failed: Retry a batch's failed rows. `POST https://appliflo.com/api/v1/bulk-batches/{id}/retry-failed` Every failed row goes back in the queue with fresh attempts. Safe to repeat: queued and sent rows are never touched, and no envelope is sent twice. Send your API key in the `Authorization: Bearer` header. Every response is JSON: `{ success, data, error }`. ## Parameters | Name | In | Required | Description | | --- | --- | --- | --- | | `id` | path | yes | batch_id from POST /templates/{id}/bulk | ## Responses | Status | Description | | --- | --- | | 200 | How many rows were requeued. | | 401 | Missing or invalid API key, or `api_key_expired` for a key past its expiry. | | 403 | The API key's workspace does not have access to this resource, or `insufficient_scope` (with `required_scope`) for a key without the scope this route needs. | | 404 | Resource not found in this workspace. | | 422 | Request failed validation. | | 500 | Internal error. | ## 200 response | Field | Type | Required | Description | | --- | --- | --- | --- | | `success` | true | yes | | | `data` | object | yes | | | `data.batch_id` | string | yes | | | `data.requeued` | integer | yes | At least 0 | See also: [Errors](https://dev.appliflo.com/guides/errors), [Rate limits](https://dev.appliflo.com/guides/rate-limits), [Idempotency](https://dev.appliflo.com/guides/idempotency). Source: https://dev.appliflo.com/api/saved-templates/retry-bulk-batch-failed --- # Cancel a batch > POST /api/v1/bulk-batches/{id}/cancel: Cancel a batch. `POST https://appliflo.com/api/v1/bulk-batches/{id}/cancel` Every row not sent yet is cancelled; envelopes already sent are untouched (void them one by one if needed). A batch that already finished is refused. Send your API key in the `Authorization: Bearer` header. Every response is JSON: `{ success, data, error }`. ## Parameters | Name | In | Required | Description | | --- | --- | --- | --- | | `id` | path | yes | batch_id from POST /templates/{id}/bulk | ## Responses | Status | Description | | --- | --- | | 200 | The batch, cancelled. | | 401 | Missing or invalid API key, or `api_key_expired` for a key past its expiry. | | 403 | The API key's workspace does not have access to this resource, or `insufficient_scope` (with `required_scope`) for a key without the scope this route needs. | | 404 | Resource not found in this workspace. | | 409 | The batch already finished (code batch_finished). | | 422 | Request failed validation. | | 500 | Internal error. | ## 200 response | Field | Type | Required | Description | | --- | --- | --- | --- | | `success` | true | yes | | | `data` | object | yes | | | `data.batch_id` | string | yes | | | `data.status` | string | yes | One of: cancelled | | `data.cancelled` | integer | yes | At least 0 | | `data.counts` | object | yes | | | `data.counts.total` | integer | yes | | | `data.counts.queued` | integer | yes | | | `data.counts.sent` | integer | yes | | | `data.counts.failed` | integer | yes | | | `data.counts.excluded` | integer | yes | | | `data.counts.cancelled` | integer | yes | | See also: [Errors](https://dev.appliflo.com/guides/errors), [Rate limits](https://dev.appliflo.com/guides/rate-limits), [Idempotency](https://dev.appliflo.com/guides/idempotency). Source: https://dev.appliflo.com/api/saved-templates/cancel-bulk-batch --- # Fix a failed row and send it again > PATCH /api/v1/bulk-batches/{id}/rows/{row}: Fix a failed row and send it again. `PATCH https://appliflo.com/api/v1/bulk-batches/{id}/rows/{row}` Change a failed row's people (by role key: name and/or email) or prefilled boxes (by index), then it is checked like the review step and sent as a new envelope. A change is required: a row the email provider refused or that bounced (needs_fix) would fail the same way again. Send your API key in the `Authorization: Bearer` header. Every response is JSON: `{ success, data, error }`. ## Parameters | Name | In | Required | Description | | --- | --- | --- | --- | | `id` | path | yes | batch_id from POST /templates/{id}/bulk | | `row` | path | yes | The row number GET /bulk-batches/{id} reports | ## Request body (application/json) | Field | Type | Required | Description | | --- | --- | --- | --- | | `people` | map of object | no | | | `prefill` | map of string | no | | ## Responses | Status | Description | | --- | --- | | 200 | The row, queued again. | | 401 | Missing or invalid API key, or `api_key_expired` for a key past its expiry. | | 403 | The API key's workspace does not have access to this resource, or `insufficient_scope` (with `required_scope`) for a key without the scope this route needs. | | 404 | Resource not found in this workspace. | | 409 | Only a failed row can be fixed (code not_fixable). | | 422 | Refused, with a `code`: no_change (nothing changed), invalid (a missing name, an invalid or shared email), unknown_role, unknown_field. | | 500 | Internal error. | ## 200 response | Field | Type | Required | Description | | --- | --- | --- | --- | | `success` | true | yes | | | `data` | object | yes | | | `data.row` | integer | yes | | | `data.status` | string | yes | One of: queued, sent, failed, excluded, cancelled | | `data.envelope_id` | string \| null | yes | | | `data.error` | string \| null | yes | | | `data.error_code` | string \| null | yes | Why it failed: transient (retry-failed can help), permanent (the email provider refused it) or bounced. One of: transient, permanent, bounced, null | | `data.needs_fix` | boolean | yes | Retrying as is can't help: PATCH /bulk-batches/{id}/rows/{row} with a change first | | `data.attempts` | integer | yes | | See also: [Errors](https://dev.appliflo.com/guides/errors), [Rate limits](https://dev.appliflo.com/guides/rate-limits), [Idempotency](https://dev.appliflo.com/guides/idempotency). Source: https://dev.appliflo.com/api/saved-templates/fix-bulk-batch-row --- # List the workspace's saved templates > GET /api/v1/saved-templates: List the workspace's saved templates. `GET https://appliflo.com/api/v1/saved-templates` Saved templates are reusable documents the workspace keeps: a PDF plus its reviewed fields and recipient roles. The MCP list_templates tool returns the same items as saved_templates. Send your API key in the `Authorization: Bearer` header. Every response is JSON: `{ success, data, error }`. ## Parameters | Name | In | Required | Description | | --- | --- | --- | --- | | `q` | query | no | Case-insensitive name search | ## Responses | Status | Description | | --- | --- | | 200 | Saved templates, most recently changed first. | | 401 | Missing or invalid API key, or `api_key_expired` for a key past its expiry. | | 403 | The API key's workspace does not have access to this resource, or `insufficient_scope` (with `required_scope`) for a key without the scope this route needs. | | 404 | Resource not found in this workspace. | | 422 | Request failed validation. | | 500 | Internal error. | ## 200 response | Field | Type | Required | Description | | --- | --- | --- | --- | | `success` | true | yes | | | `data` | object | yes | | | `data.saved_templates` | object[] | yes | | | `data.saved_templates[].template_id` | string | yes | | | `data.saved_templates[].kind` | "saved" | yes | | | `data.saved_templates[].name` | string | yes | | | `data.saved_templates[].status` | string | yes | Only a ready template can be sent; a draft is refused with 409 template_not_ready. One of: draft, ready | | `data.saved_templates[].version` | integer \| null | yes | The current version (null while draft). POST /templates/{id}/bulk requires it | | `data.saved_templates[].field_count` | integer | yes | At least 0 | | `data.saved_templates[].pages` | integer | yes | At least 1 | | `data.saved_templates[].roles` | object[] | yes | Recipient roles, in signing order (the current version's; a draft's planned ones) | | `data.saved_templates[].roles[].key` | string | yes | The key send and bulk take in `people` / `recipients[].role`, e.g. "r1" | | `data.saved_templates[].roles[].label` | string | yes | The role's name, e.g. "Client" | | `data.saved_templates[].roles[].kind` | string | yes | signer: fills and signs; filler: fills only. One of: signer, filler | | `data.saved_templates[].roles[].order` | integer | yes | Signing order. At least 1 | | `data.saved_templates[].sender_fields` | object[] | yes | The boxes the sender fills (empty while draft) | | `data.saved_templates[].sender_fields[].index` | integer | yes | The prefill key. At least 0 | | `data.saved_templates[].sender_fields[].label` | string \| null | yes | | | `data.saved_templates[].sender_fields[].type` | string | yes | One of: text, checkbox, signature | | `data.saved_templates[].sender_fields[].semantic_type` | string | yes | | | `data.saved_templates[].sender_fields[].group_key` | string \| null | yes | The choice question this box is an option of (answer with an option value) | | `data.saved_templates[].sender_fields[].option_value` | string \| null | yes | | | `data.saved_templates[].sender_fields[].bulk` | boolean | yes | A plain text box a bulk row's prefill may set | | `data.saved_templates[].fixed_fields` | object[] | yes | The boxes the template fills itself (empty while draft) | | `data.saved_templates[].fixed_fields[].index` | integer | yes | The fixed_overrides key. At least 0 | | `data.saved_templates[].fixed_fields[].label` | string \| null | yes | | | `data.saved_templates[].fixed_fields[].type` | string | yes | One of: text, checkbox, signature | | `data.saved_templates[].fixed_fields[].locked` | boolean | yes | True: set by the template, an override is 422 locked_field | | `data.saved_templates[].fixed_fields[].bulk` | boolean | yes | A Default text box a bulk row's prefill may set (its value becomes that row's override) | | `data.saved_templates[].source` | string | yes | doc: saved from a Docs doc (no PDF; send it to many, or use it from Docs). One of: document, official, upload, doc | | `data.saved_templates[].official_form_slug` | string \| null | yes | | | `data.saved_templates[].created_at` | string | yes | Format: date-time | | `data.saved_templates[].updated_at` | string | yes | Format: date-time | See also: [Errors](https://dev.appliflo.com/guides/errors), [Rate limits](https://dev.appliflo.com/guides/rate-limits), [Idempotency](https://dev.appliflo.com/guides/idempotency). Source: https://dev.appliflo.com/api/saved-templates/list-saved-templates --- # Save a draft document as a template > POST /api/v1/saved-templates: Save a draft document as a template. `POST https://appliflo.com/api/v1/saved-templates` Copies the document's PDF and its fields into a new saved template, and carries over any saved mappings the document's form has. The document itself is not changed. Send your API key in the `Authorization: Bearer` header. Every response is JSON: `{ success, data, error }`. ## Request body (application/json) | Field | Type | Required | Description | | --- | --- | --- | --- | | `document_id` | string | yes | A draft document with its fields detected or placed | | `name` | string | no | Defaults to the document's name. Up to 120 characters | | `roles` | string[] | no | Recipient role labels in signing order, e.g. ["Client", "Agent"]. Up to 4 items | ## Responses | Status | Description | | --- | --- | | 201 | The new saved template. | | 401 | Missing or invalid API key, or `api_key_expired` for a key past its expiry. | | 403 | The API key's workspace does not have access to this resource, or `insufficient_scope` (with `required_scope`) for a key without the scope this route needs. | | 404 | Resource not found in this workspace. | | 422 | Request failed validation. | | 500 | Internal error. | ## 201 response | Field | Type | Required | Description | | --- | --- | --- | --- | | `success` | true | yes | | | `data` | object | yes | | | `data.saved_template` | object | yes | | | `data.saved_template.template_id` | string | yes | | | `data.saved_template.kind` | "saved" | yes | | | `data.saved_template.name` | string | yes | | | `data.saved_template.status` | string | yes | Only a ready template can be sent; a draft is refused with 409 template_not_ready. One of: draft, ready | | `data.saved_template.version` | integer \| null | yes | The current version (null while draft). POST /templates/{id}/bulk requires it | | `data.saved_template.field_count` | integer | yes | At least 0 | | `data.saved_template.pages` | integer | yes | At least 1 | | `data.saved_template.roles` | object[] | yes | Recipient roles, in signing order (the current version's; a draft's planned ones) | | `data.saved_template.roles[].key` | string | yes | The key send and bulk take in `people` / `recipients[].role`, e.g. "r1" | | `data.saved_template.roles[].label` | string | yes | The role's name, e.g. "Client" | | `data.saved_template.roles[].kind` | string | yes | signer: fills and signs; filler: fills only. One of: signer, filler | | `data.saved_template.roles[].order` | integer | yes | Signing order. At least 1 | | `data.saved_template.sender_fields` | object[] | yes | The boxes the sender fills (empty while draft) | | `data.saved_template.sender_fields[].index` | integer | yes | The prefill key. At least 0 | | `data.saved_template.sender_fields[].label` | string \| null | yes | | | `data.saved_template.sender_fields[].type` | string | yes | One of: text, checkbox, signature | | `data.saved_template.sender_fields[].semantic_type` | string | yes | | | `data.saved_template.sender_fields[].group_key` | string \| null | yes | The choice question this box is an option of (answer with an option value) | | `data.saved_template.sender_fields[].option_value` | string \| null | yes | | | `data.saved_template.sender_fields[].bulk` | boolean | yes | A plain text box a bulk row's prefill may set | | `data.saved_template.fixed_fields` | object[] | yes | The boxes the template fills itself (empty while draft) | | `data.saved_template.fixed_fields[].index` | integer | yes | The fixed_overrides key. At least 0 | | `data.saved_template.fixed_fields[].label` | string \| null | yes | | | `data.saved_template.fixed_fields[].type` | string | yes | One of: text, checkbox, signature | | `data.saved_template.fixed_fields[].locked` | boolean | yes | True: set by the template, an override is 422 locked_field | | `data.saved_template.fixed_fields[].bulk` | boolean | yes | A Default text box a bulk row's prefill may set (its value becomes that row's override) | | `data.saved_template.source` | string | yes | doc: saved from a Docs doc (no PDF; send it to many, or use it from Docs). One of: document, official, upload, doc | | `data.saved_template.official_form_slug` | string \| null | yes | | | `data.saved_template.created_at` | string | yes | Format: date-time | | `data.saved_template.updated_at` | string | yes | Format: date-time | | `data.mappings_copied` | integer | yes | At least 0 | See also: [Errors](https://dev.appliflo.com/guides/errors), [Rate limits](https://dev.appliflo.com/guides/rate-limits), [Idempotency](https://dev.appliflo.com/guides/idempotency). Source: https://dev.appliflo.com/api/saved-templates/create-saved-template-from-document --- # Create a document from a saved template > POST /api/v1/saved-templates/{id}/create-document: Create a document from a saved template. `POST https://appliflo.com/api/v1/saved-templates/{id}/create-document` Creates a fresh draft document with a copy of the template's file and fields (already placed: do not call detect). The template is never modified. Pass the result to POST /documents/{id}/send. Send your API key in the `Authorization: Bearer` header. Every response is JSON: `{ success, data, error }`. ## Parameters | Name | In | Required | Description | | --- | --- | --- | --- | | `id` | path | yes | Saved template id from GET /saved-templates | | `Idempotency-Key` | header | no | A client-generated key scoping this request as a retry of a prior identical request. A replay within 24h returns the first response instead of repeating the side effect (e.g. a second send). The key is bound to the request it was first used with: the same key with a different body or target is refused (422, code idempotency_key_reused) | ## Request body (application/json) | Field | Type | Required | Description | | --- | --- | --- | --- | | `name` | string | no | Defaults to the template's name. Up to 255 characters | ## Responses | Status | Description | | --- | --- | | 201 | The new draft document. | | 401 | Missing or invalid API key, or `api_key_expired` for a key past its expiry. | | 403 | The API key's workspace does not have access to this resource, or `insufficient_scope` (with `required_scope`) for a key without the scope this route needs. | | 404 | Resource not found in this workspace. | | 422 | Request failed validation. | | 500 | Internal error. | ## 201 response | Field | Type | Required | Description | | --- | --- | --- | --- | | `success` | true | yes | | | `data` | object | yes | | | `data.document_id` | string | yes | | | `data.template_id` | string | yes | | | `data.name` | string | yes | | | `data.field_count` | integer | yes | At least 0 | | `data.roles` | object[] | yes | | | `data.roles[].key` | string | yes | | | `data.roles[].label` | string | yes | | | `data.fields` | object[] | yes | | | `data.fields[].field_id` | string | yes | | | `data.fields[].label` | string \| null | yes | | | `data.fields[].semantic_type` | string | yes | | | `data.fields[].page` | integer | yes | | | `data.fields[].role` | string \| null | yes | The template role this field belongs to, when set | See also: [Errors](https://dev.appliflo.com/guides/errors), [Rate limits](https://dev.appliflo.com/guides/rate-limits), [Idempotency](https://dev.appliflo.com/guides/idempotency). Source: https://dev.appliflo.com/api/saved-templates/create-document-from-saved-template --- # MCP server > Let a coding agent fill and send forms with the AppliFlo MCP server. The AppliFlo MCP server is at `https://appliflo.com/api/mcp`. It speaks Streamable HTTP and takes your workspace API key in an `Authorization` header, so it works in clients that let you set a header, such as Claude Code, Cursor and VS Code. Sign-in from Claude.ai and ChatGPT is coming soon. [Connect a client](https://dev.appliflo.com/mcp/connect) to get started. ## Tools 86 tools today. This list is made from the server's `tools/list`, so it always matches what your client sees. - **read** tools only look. Clients can run them without asking. - **asks first** tools change something in your workspace, so clients ask you first. - **destructive** tools send, cancel or email people. Clients ask you first. - **waits for confirm** marks the tools that do nothing on the first call. They return what would happen, and act only when called again with `confirm: true`. The others act on the first call. | Tool | What it does | Kind | | --- | --- | --- | | [`upload_document`](https://dev.appliflo.com/mcp/tools/upload_document) | Upload a PDF or Word (.docx) file into the workspace as a persisted document, returning its document_id for use by detect_fields/fill_document/send_envelope. | asks first | | [`request_upload`](https://dev.appliflo.com/mcp/tools/request_upload) | When you can't pass the user's file to upload_document (no file content or link available in this chat), get a one-time upload link for them instead. | asks first | | [`detect_fields`](https://dev.appliflo.com/mcp/tools/detect_fields) | Run field detection on a previously uploaded document and persist the detected fields, exactly as the AppliFlo app does: the form's sections and skip rules are saved, block-letter forms are noted, and corrections the workspace made to this same form before come back (remembered = how many). | destructive | | [`list_fields`](https://dev.appliflo.com/mcp/tools/list_fields) | List a document's current fields (post-detection, including any corrections already applied via correct_field). | read | | [`correct_field`](https://dev.appliflo.com/mcp/tools/correct_field) | Apply a correction to one detected field (label, semantic_type, bbox, and/or field type — every patch key is optional, only the keys you send are changed). | destructive | | [`fill_document`](https://dev.appliflo.com/mcp/tools/fill_document) | Stamp caller-supplied values into a document's detected fields (keyed by field_id from list_fields/detect_fields) and store the filled PDF. | destructive | | [`fill_form_oneshot`](https://dev.appliflo.com/mcp/tools/fill_form_oneshot) | One-shot demo/quick-fill: upload a PDF (or a Word DOCX, converted to PDF; as content_base64 OR file_url, exactly one; at most 20 MB) and a values map keyed by each field's detected label text (the only thing knowable before detection runs), and get back a filled PDF in one call — no persisted document_id, no separate detect_fields/fill_document round trip. | asks first | | [`send_envelope`](https://dev.appliflo.com/mcp/tools/send_envelope) | Create an envelope for document_id, set recipients + field assignments, and send the initial signing invitations. | destructive | | [`list_envelopes`](https://dev.appliflo.com/mcp/tools/list_envelopes) | List envelopes in the workspace, optionally filtered by status, paginated with limit/offset (default limit 20, max 100). | read | | [`get_envelope`](https://dev.appliflo.com/mcp/tools/get_envelope) | Get full envelope detail: document, recipients (with per-recipient view/consent/sign timestamps and delivery: "email", or "embedded" for one your app signs and nobody emails), status, and the audit timeline. | read | | [`remind_envelope`](https://dev.appliflo.com/mcp/tools/remind_envelope) | Send a reminder email to every recipient still blocking signature on an envelope. | destructive | | [`void_envelope`](https://dev.appliflo.com/mcp/tools/void_envelope) | Permanently cancel an envelope (a reason is required and is stored on the audit trail). | destructive | | [`download_document`](https://dev.appliflo.com/mcp/tools/download_document) | Get a short-lived signed download URL for a PDF artifact. | read | | [`list_templates`](https://dev.appliflo.com/mcp/tools/list_templates) | List everything this workspace can start a document from, in one list (the app's Templates page): the workspace's saved templates first, then AppliFlo's contract templates, then the official government forms (e.g. | read | | [`get_template`](https://dev.appliflo.com/mcp/tools/get_template) | Read ONE template from list_templates by its template_id (a saved template, an AppliFlo contract or an official form, "lib_...") with its full detail: everything list_templates shows, plus the boxes (sender_fields[], fixed_fields[], a contract's required_values[] and party_fields[]) and the e-sign notice. | read | | [`create_from_template`](https://dev.appliflo.com/mcp/tools/create_from_template) | Start a document from a template in list_templates (any kind) and persist it, returning document_id. | asks first | | [`send_template`](https://dev.appliflo.com/mcp/tools/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. | destructive | | [`send_template_bulk`](https://dev.appliflo.com/mcp/tools/send_template_bulk) | Send a Ready saved template to many people: one envelope per row (up to 500 rows). | destructive | | [`get_bulk_batch`](https://dev.appliflo.com/mcp/tools/get_bulk_batch) | Progress of a send started with send_template_bulk: the batch status (queued \| sending \| paused \| cancelled \| done; paused has a pause_reason, quota or suspended, and resumes on its own), counts, and each row's status (queued \| sent \| failed \| excluded \| cancelled) with its envelope_id (use get_envelope for signing progress), last error and needs_fix (fix it with fix_bulk_row). | read | | [`cancel_bulk_batch`](https://dev.appliflo.com/mcp/tools/cancel_bulk_batch) | Stop a send started with send_template_bulk: every row not sent yet is cancelled; envelopes already sent are untouched (void_envelope them one by one if needed). | destructive | | [`fix_bulk_row`](https://dev.appliflo.com/mcp/tools/fix_bulk_row) | Fix one failed row of a send_template_bulk batch and send it again. get_bulk_batch shows each row's `needs_fix` (the email provider refused it or it bounced: retrying as is can't help). | destructive | | [`list_documents`](https://dev.appliflo.com/mcp/tools/list_documents) | The Documents list exactly as the web app shows it: PDFs and Docs in one list, newest first, only the ones the caller may see. scope 'mine' (created by or sent to the caller; the default for a person) or 'workspace' (the default for an API key, which owns no documents); filter by status group (needs_you, drafts, waiting, completed, declined, expired, voided, expiring), sent_as (single, bulk, unsent), type, owner (a user id), client (a client id) and q (name or recipient). | read | | [`get_document`](https://dev.appliflo.com/mcp/tools/get_document) | One PDF document as the web app shows it: name, status, page count, its client, a summary of its boxes (how many, flagged for review, by type, by page, assigned to a recipient, choice questions) and, once sent, its signing: the latest round (envelope_id, status, recipients and where each is, with delivery: "embedded" for one your app signs, never emailed), every round (a resend starts a new one), reminders and what the caller may do next (remind, void, resend, download). signing is null for a draft. | read | | [`rename_document`](https://dev.appliflo.com/mcp/tools/rename_document) | Rename a PDF document everywhere it shows (the Documents list, its pages, later emails). 1-200 characters, no slashes; extra spaces are trimmed. | destructive | | [`trash_document`](https://dev.appliflo.com/mcp/tools/trash_document) | Move a draft PDF to the Trash, as Delete does in the web app. | destructive | | [`restore_document`](https://dev.appliflo.com/mcp/tools/restore_document) | Bring a document back from the Trash (within its 30 days), as Restore does on the web. | asks first | | [`delete_document_forever`](https://dev.appliflo.com/mcp/tools/delete_document_forever) | Permanently delete a document that is already in the Trash, with its fields and stored files. | destructive | | [`resend_document`](https://dev.appliflo.com/mcp/tools/resend_document) | Resend a sent document, as Resend on its web page does: the latest round is voided with your reason and a new round goes out on the same document to the same people (or with some of them changed: recipients[] by index into the latest round's recipients, as get_document lists them), with the same boxes, the sender's values, routing, expiry length and reminders. | destructive | | [`add_field`](https://dev.appliflo.com/mcp/tools/add_field) | Draw a new box on a document page, as a person does with the app's box editor: use it for a box detection missed (e.g. a signature line or a date with no field). type: text, date (typed date), checkbox, signature, or date_signed (stamped with the signing date of the nearest signature on the page). page is 0-based and bbox is [x0, y0, x1, y1] in PDF points, the same coordinates list_fields shows for the boxes around it; the box is kept at least 6 pt each way and inside the page. | asks first | | [`delete_field`](https://dev.appliflo.com/mcp/tools/delete_field) | Delete one box from a document, as the app's box editor does (e.g. a box detection found that isn't a real field). | destructive | | [`list_groups`](https://dev.appliflo.com/mcp/tools/list_groups) | List a document's choice questions: groups of tick boxes answered as one question (e.g. | read | | [`update_group`](https://dev.appliflo.com/mcp/tools/update_group) | Edit one choice question (from list_groups), as the app's question editor does: rename it (label), switch kind (single = pick one, multi = pick several), set max (multi only: answer up to N; null = no limit), replace its options (2-200 tick boxes on this document, each { field_id, label, value }: value is what the box stamps; a box moves out of any other question, and a question left with one box is dropped), set other_field_id (a plain text box filled when the client picks Other; null detaches it), or confirmed: true to settle a flagged question as checked. | destructive | | [`get_form_rules`](https://dev.appliflo.com/mcp/tools/get_form_rules) | Read a document's form rules: its sections and skip logic, as the app's Detect step shows them on each question. sections[] are the form's parts and numbered questions ({ id, kind: part\|question, label, number, parent_id }); rules[] are its skip logic, in order: when the choice question group_id is answered with one of option_values, the sections in skip[] are not needed and goto (a section id, or null) is where the form sends the reader next. source is page_text (read from the form's printed words), llm, or manual (a person's). | read | | [`set_form_rules`](https://dev.appliflo.com/mcp/tools/set_form_rules) | Replace a document's whole skip-rule list, in order, as the app's Detect step saves it when a person edits, removes or adds a rule on a question. | destructive | | [`suggest_roles`](https://dev.appliflo.com/mcp/tools/suggest_roles) | Read who a document's form asks for (e.g. | read | | [`set_envelope_recipients`](https://dev.appliflo.com/mcp/tools/set_envelope_recipients) | Set who a document goes to, in signing order: each recipient's role label (as the form names it, see suggest_roles), name, email and kind (signer fills and signs, filler fills only, cc gets a copy). | destructive | | [`ai_assign`](https://dev.appliflo.com/mcp/tools/ai_assign) | Let AI decide who fills each box that has no owner yet: one of the document's recipients, Skip, or a Fixed value, from the workspace's form memory, the team's habits, rules and then AI. | asks first | | [`set_box_owner`](https://dev.appliflo.com/mcp/tools/set_box_owner) | Give boxes to one of the document's recipients (role_key from set_envelope_recipients), who fills them when they sign; or clear: true to take the owner off. | destructive | | [`skip_box`](https://dev.appliflo.com/mcp/tools/skip_box) | Skip boxes: they are left blank and no recipient sees them (e.g. an office-use-only box, or a question that doesn't apply). | destructive | | [`set_fixed_value`](https://dev.appliflo.com/mcp/tools/set_fixed_value) | Put a value in boxes on every send, filled in by you before it goes (Fixed). | destructive | | [`search_clients`](https://dev.appliflo.com/mcp/tools/search_clients) | Find clients by name, email or phone. | read | | [`get_client`](https://dev.appliflo.com/mcp/tools/get_client) | One client's full record: name, email, phone, company, owner, notes, every custom field with this client's value (null when unset), document counts, and its CRM links (which GlobalyOS or Agentcis record it is linked to). | read | | [`create_client`](https://dev.appliflo.com/mcp/tools/create_client) | Add a client to the workspace. | asks first | | [`update_client`](https://dev.appliflo.com/mcp/tools/update_client) | Change a client's own details: only the keys you pass change (null clears email, phone, company or owner). | destructive | | [`trash_client`](https://dev.appliflo.com/mcp/tools/trash_client) | Move a client to the Trash: hidden from lists and pickers, and its email is free for a new client. | destructive | | [`list_client_fields`](https://dev.appliflo.com/mcp/tools/list_client_fields) | The workspace's custom client fields, in order: id, label, type (short_text, paragraph, number, currency, phone, email, website, date, dropdown, multi_dropdown, yes_no), options (dropdowns) and currency. | read | | [`set_client_field`](https://dev.appliflo.com/mcp/tools/set_client_field) | Set one custom field on a client ("" or null clears it). | destructive | | [`list_client_documents`](https://dev.appliflo.com/mcp/tools/list_client_documents) | The documents (PDFs and Docs) that belong to a client, newest first, as on the client's page: id, name, kind, status and status group (needs_you, drafts, waiting, completed, declined, expired, voided), owner, envelope id and a url to open it, plus counts per group. | read | | [`link_client_crm`](https://dev.appliflo.com/mcp/tools/link_client_crm) | Link a client to a record in a connected CRM (GlobalyOS or Agentcis), so forms can be prefilled from it and signed PDFs go back to it. | asks first | | [`save_library_as_template`](https://dev.appliflo.com/mcp/tools/save_library_as_template) | Keep an AppliFlo library contract or official government form (a "lib_..." template_id from list_templates) as one of the workspace's OWN saved templates, as the app's Templates page does, so the workspace can edit its roles, settings and boxes. | asks first | | [`save_as_template`](https://dev.appliflo.com/mcp/tools/save_as_template) | Keep a DRAFT document (one not sent yet, with its fields detected or placed) as one of the workspace's saved templates, like the app's "Save as template": its PDF, fields, choice questions and form rules are copied; the document itself is untouched. | asks first | | [`list_template_versions`](https://dev.appliflo.com/mcp/tools/list_template_versions) | A saved template's finalised versions, newest first: version, current, note, field_count, envelope_count (how many envelopes each sent) and created_at. | read | | [`get_template_version`](https://dev.appliflo.com/mcp/tools/get_template_version) | One finalised version of a saved template (default: the current one): its roles in signing order, the boxes the sender fills (sender_fields, the prefill keys), the boxes it fills itself (fixed_fields) and the send settings every envelope from it gets (routing, subject, message, cc, expiry_days). | read | | [`update_template_settings`](https://dev.appliflo.com/mcp/tools/update_template_settings) | Change a saved template's send settings, as the builder's Settings step: only the settings you pass change. routing (sequential = one role after another, parallel = everyone at once), subject and message (may use {{placeholders}} such as {{Recipient 1 name}}, {{Template name}}, {{Workspace}}), reminder_cadence, expiry_days (null = links never expire), warn_before_expiry, cc (replaces the fixed copies), sender_role ("Who sends this?": a role key from the template's roles, always the person sending; null = none of them; only the person's own choice, never guess it). | destructive | | [`set_template_roles`](https://dev.appliflo.com/mcp/tools/set_template_roles) | Replace a saved template's roles (the people who fill and sign it), in signing order, as the builder's Recipients step: 1 to 10. | destructive | | [`finalise_template`](https://dev.appliflo.com/mcp/tools/finalise_template) | Finalise a saved template's draft as its next version, as the builder's Finalise: the draft's boxes, roles and settings become an unchangeable version with its own PDF copy, the template is Ready, and every send from now on uses it (envelopes already sent keep their version). | destructive | | [`retry_failed_rows`](https://dev.appliflo.com/mcp/tools/retry_failed_rows) | Send the failed rows of a send_template_bulk batch again, as the app's "Retry failed": each goes back in the queue with fresh attempts and is sent in the background (poll get_bulk_batch). | destructive | | [`list_activity`](https://dev.appliflo.com/mcp/tools/list_activity) | The Activities feed, as the web app's Activities page shows it: what happened to documents, Docs, templates and clients, newest first, each with a plain label ("Signed", "Moved to Trash"…), who did it and a link. scope 'mine' (default: things the caller created, sent or was sent, and their own actions; for an API key, what the key itself did) or 'workspace' (owners and admins only, so not an API key, which acts as a member). | read | | [`list_audit_log`](https://dev.appliflo.com/mcp/tools/list_audit_log) | The workspace audit log (Settings → Activity on the web): every colleague's actions and every envelope event in the workspace, newest first. | read | | [`get_usage`](https://dev.appliflo.com/mcp/tools/get_usage) | This period's plan usage, as Settings → Usage shows it: the plan, seats, when the period started and resets, and AI pages (the pages AI reads to find a form's boxes): used, limit (with granted and purchased extras), remaining, whether they ran out, and the caller's own use (an API key's is its creator's). | read | | [`list_docs`](https://dev.appliflo.com/mcp/tools/list_docs) | The Docs the caller can see (AppliFlo's own documents written in the editor: contracts, letters; not uploaded PDFs), newest edit first, as the app's Docs list shows them: doc_id, title, status (draft, ready, sent, archived), revision, visibility, mine, created_by_name, editing_by (someone else has it open), can_edit, and for a sent Doc envelope_id and pdf_document_id (the rendered PDF the PDF and envelope tools take). | read | | [`get_doc`](https://dev.appliflo.com/mcp/tools/get_doc) | One Doc in full: title, status, revision (pass it to update_doc and send_doc), visibility, page_size, roles (the people it is for, in signing order; their keys are send_doc's people keys), signing_order, can_edit, can_share, editing_by, where it came from (contract_template_id, ai_drafted), and for a sent Doc envelope_id and pdf_document_id. | read | | [`create_doc`](https://dev.appliflo.com/mcp/tools/create_doc) | Start a new Doc (a contract or letter written in AppliFlo), private to the caller, as a draft. | asks first | | [`update_doc`](https://dev.appliflo.com/mcp/tools/update_doc) | Change a draft or ready Doc, as the editor saves it: the title and/or the whole content (as `markdown`, or the TipTap JSON `content` from get_doc format json), at the `revision` you last read (get_doc). | destructive | | [`list_doc_versions`](https://dev.appliflo.com/mcp/tools/list_doc_versions) | A Doc's saved versions, newest first, without content: number, reason (manual: someone saved a version; auto: kept after 30 minutes of editing; send: what went out for signing; restore), note, title, created_at and created_by_name. | read | | [`duplicate_doc`](https://dev.appliflo.com/mcp/tools/duplicate_doc) | Copy a Doc the caller can see into a new private draft they own (" (copy)"), with its content, roles, signing order and page size; comments stay on the original. | asks first | | [`send_doc`](https://dev.appliflo.com/mcp/tools/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. | destructive | | [`save_doc_as_template`](https://dev.appliflo.com/mcp/tools/save_doc_as_template) | Keep a Doc as one of the workspace's doc templates, as the app's "Save as template": its content, roles and settings (not a PDF). | asks first | | [`docs_ai_draft`](https://dev.appliflo.com/mcp/tools/docs_ai_draft) | Draft a new Doc (a contract, letter or agreement) with AppliFlo's AI from a short brief, as Docs → New → Draft with AI does. | asks first | | [`docs_ai_continue`](https://dev.appliflo.com/mcp/tools/docs_ai_continue) | Write more of an existing Doc with AppliFlo's AI and put it in the Doc, as the editor's Continue writing and Write a clause do. kind continue (default): a paragraph or two following on from the text before the place; kind clause: one new clause or section with its own numbered heading in the style of the rest (instruction required, e.g. | asks first | | [`docs_ai_rewrite`](https://dev.appliflo.com/mcp/tools/docs_ai_rewrite) | Rewrite part of a Doc with AppliFlo's AI and replace it in the Doc, as selecting text and choosing Rewrite in the editor does. text is the exact words to rewrite, copied from the Doc as get_doc shows it (may span paragraphs); mode plainer, firmer, shorter, longer or grammar, or custom with an instruction. | destructive | | [`docs_ai_explain`](https://dev.appliflo.com/mcp/tools/docs_ai_explain) | Explain a Doc (find it with list_docs, read it with get_doc), or part of it, in plain English for someone who isn't a lawyer, as Explain in the editor does. | asks first | | [`docs_ai_review`](https://dev.appliflo.com/mcp/tools/docs_ai_review) | Check a whole Doc as a careful practitioner would, as Review in the editor does: conflicts, missing clauses, unclear wording. | asks first | | [`search_clauses`](https://dev.appliflo.com/mcp/tools/search_clauses) | Search the workspace's clause library (its own clauses and AppliFlo's starter clauses) by title and text, as Docs → Clauses does. | read | | [`insert_clause`](https://dev.appliflo.com/mcp/tools/insert_clause) | Put a clause from the workspace's clause library (search_clauses) into a Doc, word for word, as Insert clause in the editor does. | asks first | | [`list_form_memory`](https://dev.appliflo.com/mcp/tools/list_form_memory) | What this workspace's AppliFlo remembers, as Settings → Form memory shows it. forms: each form edition whose box fixes (moved, added or deleted boxes: box_fixes) or box owners (owner_changes) are put back automatically the next time the same form is uploaded. habits: team habits AI assign carries to other forms ("boxes labelled X go to role Y"). | read | | [`delete_form_memory`](https://dev.appliflo.com/mcp/tools/delete_form_memory) | Forget a remembered form (form_id) or a team habit (habit_id) from list_form_memory, like Forget on Settings → Form memory. | destructive | | [`get_my_details`](https://dev.appliflo.com/mcp/tools/get_my_details) | Your own personal details (Fill as me, Settings → Details → Personal profile): name, contact and address, passport and visa, work and study, and your custom details, grouped as in the app, each with key, label and value (null when empty). | read | | [`set_my_details`](https://dev.appliflo.com/mcp/tools/set_my_details) | Change your own personal details (Fill as me), like saving the Personal profile in Settings → Details. | destructive | | [`list_connectors`](https://dev.appliflo.com/mcp/tools/list_connectors) | Which CRMs this workspace can use (GlobalyOS or Agentcis) and whether each is connected. | read | | [`lookup_crm_record`](https://dev.appliflo.com/mcp/tools/lookup_crm_record) | Look someone up in the workspace's connected CRMs (GlobalyOS or Agentcis). | read | | [`list_members`](https://dev.appliflo.com/mcp/tools/list_members) | The workspace's members (membership_id, user_id, name, email, role: owner, admin, member or viewer, joined_at) and its pending invites (id, email, role, expires_at). | read | | [`invite_member`](https://dev.appliflo.com/mcp/tools/invite_member) | Invite someone to the workspace by email as admin, member or viewer (an owner can't be invited). | destructive | | [`remove_member`](https://dev.appliflo.com/mcp/tools/remove_member) | Remove someone from the workspace by their membership_id (from list_members). | destructive | | [`get_workspace`](https://dev.appliflo.com/mcp/tools/get_workspace) | The workspace you are in: id, name, your role, plan (free, starter or business), branding (colours, whether a logo is set, whether the plan includes custom branding) and its details (legal name, ABN, address and other values templates fill in; null when Details are off). | read | | [`update_workspace_details`](https://dev.appliflo.com/mcp/tools/update_workspace_details) | Change the workspace's settings, as on Settings → Workspace and Settings → Details. | destructive | Source: https://dev.appliflo.com/mcp --- # Connect a client > Add the AppliFlo MCP server to Claude Code, Cursor, VS Code or any MCP client. You need an API key from [Settings, API keys](https://appliflo.com/settings/api-keys). Give it the scopes the agent needs: `read` to look, `draft` to fill, `send` to send for signature. **Claude Code.** Run this in a terminal, with your key in place of `aflo_live_...`: ```bash claude mcp add appliflo --transport http https://appliflo.com/api/mcp --header "Authorization: Bearer aflo_live_..." ``` **Cursor.** Add this to `~/.cursor/mcp.json` or `.cursor/mcp.json`: ```json { "mcpServers": { "appliflo": { "url": "https://appliflo.com/api/mcp", "headers": { "Authorization": "Bearer aflo_live_..." } } } } ``` **VS Code.** Add this to `.vscode/mcp.json`. VS Code asks for the key and keeps it in its secret storage: ```json { "inputs": [ { "type": "promptString", "id": "appliflo-key", "description": "AppliFlo API key", "password": true } ], "servers": { "appliflo": { "type": "http", "url": "https://appliflo.com/api/mcp", "headers": { "Authorization": "Bearer ${input:appliflo-key}" } } } } ``` **Any MCP client.** Server URL `https://appliflo.com/api/mcp`, Streamable HTTP, header `Authorization: Bearer` and your key: ```json { "url": "https://appliflo.com/api/mcp", "transport": "streamable-http", "headers": { "Authorization": "Bearer aflo_live_..." } } ``` **Claude.ai and ChatGPT.** Coming soon. They connect with a sign-in, which is not live yet. ## Check it works Ask your agent to list your envelopes. It calls `list_envelopes`, which only reads. If it can't connect, check the key is current and has the `read` scope. Source: https://dev.appliflo.com/mcp/connect --- # All tools > Every tool the AppliFlo MCP server lists, with what it does and whether your client asks first. | Tool | What it does | Kind | | --- | --- | --- | | [`upload_document`](https://dev.appliflo.com/mcp/tools/upload_document) | Upload a PDF or Word (.docx) file into the workspace as a persisted document, returning its document_id for use by detect_fields/fill_document/send_envelope. | asks first | | [`request_upload`](https://dev.appliflo.com/mcp/tools/request_upload) | When you can't pass the user's file to upload_document (no file content or link available in this chat), get a one-time upload link for them instead. | asks first | | [`detect_fields`](https://dev.appliflo.com/mcp/tools/detect_fields) | Run field detection on a previously uploaded document and persist the detected fields, exactly as the AppliFlo app does: the form's sections and skip rules are saved, block-letter forms are noted, and corrections the workspace made to this same form before come back (remembered = how many). | destructive | | [`list_fields`](https://dev.appliflo.com/mcp/tools/list_fields) | List a document's current fields (post-detection, including any corrections already applied via correct_field). | read | | [`correct_field`](https://dev.appliflo.com/mcp/tools/correct_field) | Apply a correction to one detected field (label, semantic_type, bbox, and/or field type — every patch key is optional, only the keys you send are changed). | destructive | | [`fill_document`](https://dev.appliflo.com/mcp/tools/fill_document) | Stamp caller-supplied values into a document's detected fields (keyed by field_id from list_fields/detect_fields) and store the filled PDF. | destructive | | [`fill_form_oneshot`](https://dev.appliflo.com/mcp/tools/fill_form_oneshot) | One-shot demo/quick-fill: upload a PDF (or a Word DOCX, converted to PDF; as content_base64 OR file_url, exactly one; at most 20 MB) and a values map keyed by each field's detected label text (the only thing knowable before detection runs), and get back a filled PDF in one call — no persisted document_id, no separate detect_fields/fill_document round trip. | asks first | | [`send_envelope`](https://dev.appliflo.com/mcp/tools/send_envelope) | Create an envelope for document_id, set recipients + field assignments, and send the initial signing invitations. | destructive | | [`list_envelopes`](https://dev.appliflo.com/mcp/tools/list_envelopes) | List envelopes in the workspace, optionally filtered by status, paginated with limit/offset (default limit 20, max 100). | read | | [`get_envelope`](https://dev.appliflo.com/mcp/tools/get_envelope) | Get full envelope detail: document, recipients (with per-recipient view/consent/sign timestamps and delivery: "email", or "embedded" for one your app signs and nobody emails), status, and the audit timeline. | read | | [`remind_envelope`](https://dev.appliflo.com/mcp/tools/remind_envelope) | Send a reminder email to every recipient still blocking signature on an envelope. | destructive | | [`void_envelope`](https://dev.appliflo.com/mcp/tools/void_envelope) | Permanently cancel an envelope (a reason is required and is stored on the audit trail). | destructive | | [`download_document`](https://dev.appliflo.com/mcp/tools/download_document) | Get a short-lived signed download URL for a PDF artifact. | read | | [`list_templates`](https://dev.appliflo.com/mcp/tools/list_templates) | List everything this workspace can start a document from, in one list (the app's Templates page): the workspace's saved templates first, then AppliFlo's contract templates, then the official government forms (e.g. | read | | [`get_template`](https://dev.appliflo.com/mcp/tools/get_template) | Read ONE template from list_templates by its template_id (a saved template, an AppliFlo contract or an official form, "lib_...") with its full detail: everything list_templates shows, plus the boxes (sender_fields[], fixed_fields[], a contract's required_values[] and party_fields[]) and the e-sign notice. | read | | [`create_from_template`](https://dev.appliflo.com/mcp/tools/create_from_template) | Start a document from a template in list_templates (any kind) and persist it, returning document_id. | asks first | | [`send_template`](https://dev.appliflo.com/mcp/tools/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. | destructive | | [`send_template_bulk`](https://dev.appliflo.com/mcp/tools/send_template_bulk) | Send a Ready saved template to many people: one envelope per row (up to 500 rows). | destructive | | [`get_bulk_batch`](https://dev.appliflo.com/mcp/tools/get_bulk_batch) | Progress of a send started with send_template_bulk: the batch status (queued \| sending \| paused \| cancelled \| done; paused has a pause_reason, quota or suspended, and resumes on its own), counts, and each row's status (queued \| sent \| failed \| excluded \| cancelled) with its envelope_id (use get_envelope for signing progress), last error and needs_fix (fix it with fix_bulk_row). | read | | [`cancel_bulk_batch`](https://dev.appliflo.com/mcp/tools/cancel_bulk_batch) | Stop a send started with send_template_bulk: every row not sent yet is cancelled; envelopes already sent are untouched (void_envelope them one by one if needed). | destructive | | [`fix_bulk_row`](https://dev.appliflo.com/mcp/tools/fix_bulk_row) | Fix one failed row of a send_template_bulk batch and send it again. get_bulk_batch shows each row's `needs_fix` (the email provider refused it or it bounced: retrying as is can't help). | destructive | | [`list_documents`](https://dev.appliflo.com/mcp/tools/list_documents) | The Documents list exactly as the web app shows it: PDFs and Docs in one list, newest first, only the ones the caller may see. scope 'mine' (created by or sent to the caller; the default for a person) or 'workspace' (the default for an API key, which owns no documents); filter by status group (needs_you, drafts, waiting, completed, declined, expired, voided, expiring), sent_as (single, bulk, unsent), type, owner (a user id), client (a client id) and q (name or recipient). | read | | [`get_document`](https://dev.appliflo.com/mcp/tools/get_document) | One PDF document as the web app shows it: name, status, page count, its client, a summary of its boxes (how many, flagged for review, by type, by page, assigned to a recipient, choice questions) and, once sent, its signing: the latest round (envelope_id, status, recipients and where each is, with delivery: "embedded" for one your app signs, never emailed), every round (a resend starts a new one), reminders and what the caller may do next (remind, void, resend, download). signing is null for a draft. | read | | [`rename_document`](https://dev.appliflo.com/mcp/tools/rename_document) | Rename a PDF document everywhere it shows (the Documents list, its pages, later emails). 1-200 characters, no slashes; extra spaces are trimmed. | destructive | | [`trash_document`](https://dev.appliflo.com/mcp/tools/trash_document) | Move a draft PDF to the Trash, as Delete does in the web app. | destructive | | [`restore_document`](https://dev.appliflo.com/mcp/tools/restore_document) | Bring a document back from the Trash (within its 30 days), as Restore does on the web. | asks first | | [`delete_document_forever`](https://dev.appliflo.com/mcp/tools/delete_document_forever) | Permanently delete a document that is already in the Trash, with its fields and stored files. | destructive | | [`resend_document`](https://dev.appliflo.com/mcp/tools/resend_document) | Resend a sent document, as Resend on its web page does: the latest round is voided with your reason and a new round goes out on the same document to the same people (or with some of them changed: recipients[] by index into the latest round's recipients, as get_document lists them), with the same boxes, the sender's values, routing, expiry length and reminders. | destructive | | [`add_field`](https://dev.appliflo.com/mcp/tools/add_field) | Draw a new box on a document page, as a person does with the app's box editor: use it for a box detection missed (e.g. a signature line or a date with no field). type: text, date (typed date), checkbox, signature, or date_signed (stamped with the signing date of the nearest signature on the page). page is 0-based and bbox is [x0, y0, x1, y1] in PDF points, the same coordinates list_fields shows for the boxes around it; the box is kept at least 6 pt each way and inside the page. | asks first | | [`delete_field`](https://dev.appliflo.com/mcp/tools/delete_field) | Delete one box from a document, as the app's box editor does (e.g. a box detection found that isn't a real field). | destructive | | [`list_groups`](https://dev.appliflo.com/mcp/tools/list_groups) | List a document's choice questions: groups of tick boxes answered as one question (e.g. | read | | [`update_group`](https://dev.appliflo.com/mcp/tools/update_group) | Edit one choice question (from list_groups), as the app's question editor does: rename it (label), switch kind (single = pick one, multi = pick several), set max (multi only: answer up to N; null = no limit), replace its options (2-200 tick boxes on this document, each { field_id, label, value }: value is what the box stamps; a box moves out of any other question, and a question left with one box is dropped), set other_field_id (a plain text box filled when the client picks Other; null detaches it), or confirmed: true to settle a flagged question as checked. | destructive | | [`get_form_rules`](https://dev.appliflo.com/mcp/tools/get_form_rules) | Read a document's form rules: its sections and skip logic, as the app's Detect step shows them on each question. sections[] are the form's parts and numbered questions ({ id, kind: part\|question, label, number, parent_id }); rules[] are its skip logic, in order: when the choice question group_id is answered with one of option_values, the sections in skip[] are not needed and goto (a section id, or null) is where the form sends the reader next. source is page_text (read from the form's printed words), llm, or manual (a person's). | read | | [`set_form_rules`](https://dev.appliflo.com/mcp/tools/set_form_rules) | Replace a document's whole skip-rule list, in order, as the app's Detect step saves it when a person edits, removes or adds a rule on a question. | destructive | | [`suggest_roles`](https://dev.appliflo.com/mcp/tools/suggest_roles) | Read who a document's form asks for (e.g. | read | | [`set_envelope_recipients`](https://dev.appliflo.com/mcp/tools/set_envelope_recipients) | Set who a document goes to, in signing order: each recipient's role label (as the form names it, see suggest_roles), name, email and kind (signer fills and signs, filler fills only, cc gets a copy). | destructive | | [`ai_assign`](https://dev.appliflo.com/mcp/tools/ai_assign) | Let AI decide who fills each box that has no owner yet: one of the document's recipients, Skip, or a Fixed value, from the workspace's form memory, the team's habits, rules and then AI. | asks first | | [`set_box_owner`](https://dev.appliflo.com/mcp/tools/set_box_owner) | Give boxes to one of the document's recipients (role_key from set_envelope_recipients), who fills them when they sign; or clear: true to take the owner off. | destructive | | [`skip_box`](https://dev.appliflo.com/mcp/tools/skip_box) | Skip boxes: they are left blank and no recipient sees them (e.g. an office-use-only box, or a question that doesn't apply). | destructive | | [`set_fixed_value`](https://dev.appliflo.com/mcp/tools/set_fixed_value) | Put a value in boxes on every send, filled in by you before it goes (Fixed). | destructive | | [`search_clients`](https://dev.appliflo.com/mcp/tools/search_clients) | Find clients by name, email or phone. | read | | [`get_client`](https://dev.appliflo.com/mcp/tools/get_client) | One client's full record: name, email, phone, company, owner, notes, every custom field with this client's value (null when unset), document counts, and its CRM links (which GlobalyOS or Agentcis record it is linked to). | read | | [`create_client`](https://dev.appliflo.com/mcp/tools/create_client) | Add a client to the workspace. | asks first | | [`update_client`](https://dev.appliflo.com/mcp/tools/update_client) | Change a client's own details: only the keys you pass change (null clears email, phone, company or owner). | destructive | | [`trash_client`](https://dev.appliflo.com/mcp/tools/trash_client) | Move a client to the Trash: hidden from lists and pickers, and its email is free for a new client. | destructive | | [`list_client_fields`](https://dev.appliflo.com/mcp/tools/list_client_fields) | The workspace's custom client fields, in order: id, label, type (short_text, paragraph, number, currency, phone, email, website, date, dropdown, multi_dropdown, yes_no), options (dropdowns) and currency. | read | | [`set_client_field`](https://dev.appliflo.com/mcp/tools/set_client_field) | Set one custom field on a client ("" or null clears it). | destructive | | [`list_client_documents`](https://dev.appliflo.com/mcp/tools/list_client_documents) | The documents (PDFs and Docs) that belong to a client, newest first, as on the client's page: id, name, kind, status and status group (needs_you, drafts, waiting, completed, declined, expired, voided), owner, envelope id and a url to open it, plus counts per group. | read | | [`link_client_crm`](https://dev.appliflo.com/mcp/tools/link_client_crm) | Link a client to a record in a connected CRM (GlobalyOS or Agentcis), so forms can be prefilled from it and signed PDFs go back to it. | asks first | | [`save_library_as_template`](https://dev.appliflo.com/mcp/tools/save_library_as_template) | Keep an AppliFlo library contract or official government form (a "lib_..." template_id from list_templates) as one of the workspace's OWN saved templates, as the app's Templates page does, so the workspace can edit its roles, settings and boxes. | asks first | | [`save_as_template`](https://dev.appliflo.com/mcp/tools/save_as_template) | Keep a DRAFT document (one not sent yet, with its fields detected or placed) as one of the workspace's saved templates, like the app's "Save as template": its PDF, fields, choice questions and form rules are copied; the document itself is untouched. | asks first | | [`list_template_versions`](https://dev.appliflo.com/mcp/tools/list_template_versions) | A saved template's finalised versions, newest first: version, current, note, field_count, envelope_count (how many envelopes each sent) and created_at. | read | | [`get_template_version`](https://dev.appliflo.com/mcp/tools/get_template_version) | One finalised version of a saved template (default: the current one): its roles in signing order, the boxes the sender fills (sender_fields, the prefill keys), the boxes it fills itself (fixed_fields) and the send settings every envelope from it gets (routing, subject, message, cc, expiry_days). | read | | [`update_template_settings`](https://dev.appliflo.com/mcp/tools/update_template_settings) | Change a saved template's send settings, as the builder's Settings step: only the settings you pass change. routing (sequential = one role after another, parallel = everyone at once), subject and message (may use {{placeholders}} such as {{Recipient 1 name}}, {{Template name}}, {{Workspace}}), reminder_cadence, expiry_days (null = links never expire), warn_before_expiry, cc (replaces the fixed copies), sender_role ("Who sends this?": a role key from the template's roles, always the person sending; null = none of them; only the person's own choice, never guess it). | destructive | | [`set_template_roles`](https://dev.appliflo.com/mcp/tools/set_template_roles) | Replace a saved template's roles (the people who fill and sign it), in signing order, as the builder's Recipients step: 1 to 10. | destructive | | [`finalise_template`](https://dev.appliflo.com/mcp/tools/finalise_template) | Finalise a saved template's draft as its next version, as the builder's Finalise: the draft's boxes, roles and settings become an unchangeable version with its own PDF copy, the template is Ready, and every send from now on uses it (envelopes already sent keep their version). | destructive | | [`retry_failed_rows`](https://dev.appliflo.com/mcp/tools/retry_failed_rows) | Send the failed rows of a send_template_bulk batch again, as the app's "Retry failed": each goes back in the queue with fresh attempts and is sent in the background (poll get_bulk_batch). | destructive | | [`list_activity`](https://dev.appliflo.com/mcp/tools/list_activity) | The Activities feed, as the web app's Activities page shows it: what happened to documents, Docs, templates and clients, newest first, each with a plain label ("Signed", "Moved to Trash"…), who did it and a link. scope 'mine' (default: things the caller created, sent or was sent, and their own actions; for an API key, what the key itself did) or 'workspace' (owners and admins only, so not an API key, which acts as a member). | read | | [`list_audit_log`](https://dev.appliflo.com/mcp/tools/list_audit_log) | The workspace audit log (Settings → Activity on the web): every colleague's actions and every envelope event in the workspace, newest first. | read | | [`get_usage`](https://dev.appliflo.com/mcp/tools/get_usage) | This period's plan usage, as Settings → Usage shows it: the plan, seats, when the period started and resets, and AI pages (the pages AI reads to find a form's boxes): used, limit (with granted and purchased extras), remaining, whether they ran out, and the caller's own use (an API key's is its creator's). | read | | [`list_docs`](https://dev.appliflo.com/mcp/tools/list_docs) | The Docs the caller can see (AppliFlo's own documents written in the editor: contracts, letters; not uploaded PDFs), newest edit first, as the app's Docs list shows them: doc_id, title, status (draft, ready, sent, archived), revision, visibility, mine, created_by_name, editing_by (someone else has it open), can_edit, and for a sent Doc envelope_id and pdf_document_id (the rendered PDF the PDF and envelope tools take). | read | | [`get_doc`](https://dev.appliflo.com/mcp/tools/get_doc) | One Doc in full: title, status, revision (pass it to update_doc and send_doc), visibility, page_size, roles (the people it is for, in signing order; their keys are send_doc's people keys), signing_order, can_edit, can_share, editing_by, where it came from (contract_template_id, ai_drafted), and for a sent Doc envelope_id and pdf_document_id. | read | | [`create_doc`](https://dev.appliflo.com/mcp/tools/create_doc) | Start a new Doc (a contract or letter written in AppliFlo), private to the caller, as a draft. | asks first | | [`update_doc`](https://dev.appliflo.com/mcp/tools/update_doc) | Change a draft or ready Doc, as the editor saves it: the title and/or the whole content (as `markdown`, or the TipTap JSON `content` from get_doc format json), at the `revision` you last read (get_doc). | destructive | | [`list_doc_versions`](https://dev.appliflo.com/mcp/tools/list_doc_versions) | A Doc's saved versions, newest first, without content: number, reason (manual: someone saved a version; auto: kept after 30 minutes of editing; send: what went out for signing; restore), note, title, created_at and created_by_name. | read | | [`duplicate_doc`](https://dev.appliflo.com/mcp/tools/duplicate_doc) | Copy a Doc the caller can see into a new private draft they own ("<title> (copy)"), with its content, roles, signing order and page size; comments stay on the original. | asks first | | [`send_doc`](https://dev.appliflo.com/mcp/tools/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. | destructive | | [`save_doc_as_template`](https://dev.appliflo.com/mcp/tools/save_doc_as_template) | Keep a Doc as one of the workspace's doc templates, as the app's "Save as template": its content, roles and settings (not a PDF). | asks first | | [`docs_ai_draft`](https://dev.appliflo.com/mcp/tools/docs_ai_draft) | Draft a new Doc (a contract, letter or agreement) with AppliFlo's AI from a short brief, as Docs → New → Draft with AI does. | asks first | | [`docs_ai_continue`](https://dev.appliflo.com/mcp/tools/docs_ai_continue) | Write more of an existing Doc with AppliFlo's AI and put it in the Doc, as the editor's Continue writing and Write a clause do. kind continue (default): a paragraph or two following on from the text before the place; kind clause: one new clause or section with its own numbered heading in the style of the rest (instruction required, e.g. | asks first | | [`docs_ai_rewrite`](https://dev.appliflo.com/mcp/tools/docs_ai_rewrite) | Rewrite part of a Doc with AppliFlo's AI and replace it in the Doc, as selecting text and choosing Rewrite in the editor does. text is the exact words to rewrite, copied from the Doc as get_doc shows it (may span paragraphs); mode plainer, firmer, shorter, longer or grammar, or custom with an instruction. | destructive | | [`docs_ai_explain`](https://dev.appliflo.com/mcp/tools/docs_ai_explain) | Explain a Doc (find it with list_docs, read it with get_doc), or part of it, in plain English for someone who isn't a lawyer, as Explain in the editor does. | asks first | | [`docs_ai_review`](https://dev.appliflo.com/mcp/tools/docs_ai_review) | Check a whole Doc as a careful practitioner would, as Review in the editor does: conflicts, missing clauses, unclear wording. | asks first | | [`search_clauses`](https://dev.appliflo.com/mcp/tools/search_clauses) | Search the workspace's clause library (its own clauses and AppliFlo's starter clauses) by title and text, as Docs → Clauses does. | read | | [`insert_clause`](https://dev.appliflo.com/mcp/tools/insert_clause) | Put a clause from the workspace's clause library (search_clauses) into a Doc, word for word, as Insert clause in the editor does. | asks first | | [`list_form_memory`](https://dev.appliflo.com/mcp/tools/list_form_memory) | What this workspace's AppliFlo remembers, as Settings → Form memory shows it. forms: each form edition whose box fixes (moved, added or deleted boxes: box_fixes) or box owners (owner_changes) are put back automatically the next time the same form is uploaded. habits: team habits AI assign carries to other forms ("boxes labelled X go to role Y"). | read | | [`delete_form_memory`](https://dev.appliflo.com/mcp/tools/delete_form_memory) | Forget a remembered form (form_id) or a team habit (habit_id) from list_form_memory, like Forget on Settings → Form memory. | destructive | | [`get_my_details`](https://dev.appliflo.com/mcp/tools/get_my_details) | Your own personal details (Fill as me, Settings → Details → Personal profile): name, contact and address, passport and visa, work and study, and your custom details, grouped as in the app, each with key, label and value (null when empty). | read | | [`set_my_details`](https://dev.appliflo.com/mcp/tools/set_my_details) | Change your own personal details (Fill as me), like saving the Personal profile in Settings → Details. | destructive | | [`list_connectors`](https://dev.appliflo.com/mcp/tools/list_connectors) | Which CRMs this workspace can use (GlobalyOS or Agentcis) and whether each is connected. | read | | [`lookup_crm_record`](https://dev.appliflo.com/mcp/tools/lookup_crm_record) | Look someone up in the workspace's connected CRMs (GlobalyOS or Agentcis). | read | | [`list_members`](https://dev.appliflo.com/mcp/tools/list_members) | The workspace's members (membership_id, user_id, name, email, role: owner, admin, member or viewer, joined_at) and its pending invites (id, email, role, expires_at). | read | | [`invite_member`](https://dev.appliflo.com/mcp/tools/invite_member) | Invite someone to the workspace by email as admin, member or viewer (an owner can't be invited). | destructive | | [`remove_member`](https://dev.appliflo.com/mcp/tools/remove_member) | Remove someone from the workspace by their membership_id (from list_members). | destructive | | [`get_workspace`](https://dev.appliflo.com/mcp/tools/get_workspace) | The workspace you are in: id, name, your role, plan (free, starter or business), branding (colours, whether a logo is set, whether the plan includes custom branding) and its details (legal name, ABN, address and other values templates fill in; null when Details are off). | read | | [`update_workspace_details`](https://dev.appliflo.com/mcp/tools/update_workspace_details) | Change the workspace's settings, as on Settings → Workspace and Settings → Details. | destructive | Source: https://dev.appliflo.com/mcp/tools --- # upload_document > Upload a PDF or Word (.docx) file into the workspace as a persisted document, returning its document_id for use by detect_fields/fill_document/send_envelope. Tool of the AppliFlo MCP server at `https://appliflo.com/api/mcp`. Kind: asks first: it changes something in your workspace, so clients ask you first. Upload a PDF or Word (.docx) file into the workspace as a persisted document, returning its document_id for use by detect_fields/fill_document/send_envelope. A DOCX is converted to PDF. Send the file in exactly one way: content_base64, file_url (a public https link AppliFlo downloads), or upload_id (from request_upload, once the person has uploaded the file on its page). The type is read from the file's bytes; at most 20 MB. There is no detection or filling until you call detect_fields next. ## Inputs | Name | Type | Required | Description | | --- | --- | --- | --- | | `name` | string | no | Display name for the document, e.g. the original filename. Required with content_base64 or file_url; with upload_id the uploaded file's own name is used. Up to 255 characters | | `content_base64` | string | no | Base64-encoded PDF or DOCX bytes | | `file_url` | string | no | Instead of content_base64: a public https:// link to the file (e.g. a chat attachment's download URL). AppliFlo downloads it: no private or internal addresses, at most 3 redirects, 20 MB and 20 seconds. The type is read from the file itself, never the link. Up to 2048 characters | | `upload_id` | string | no | The upload_id request_upload returned: picks up the document the person uploaded on the link's page. Up to 64 characters | | `idempotency_key` | string | no | 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). Up to 255 characters | Source: https://dev.appliflo.com/mcp/tools/upload_document --- # request_upload > When you can't pass the user's file to upload_document (no file content or link available in this chat), get a one-time upload link for them instead. Tool of the AppliFlo MCP server at `https://appliflo.com/api/mcp`. Kind: asks first: it changes something in your workspace, so clients ask you first. When you can't pass the user's file to upload_document (no file content or link available in this chat), get a one-time upload link for them instead. Give the user the url: they open it, signed in to AppliFlo as themselves, and drop one PDF or Word (.docx) file (at most 20 MB). The link works for 15 minutes and for one file, and only for the person who connected this app (with an API key: a member of the workspace who can edit documents). When they say it's done, call upload_document with upload_id to get the document_id. ## Inputs This tool takes no inputs. Source: https://dev.appliflo.com/mcp/tools/request_upload --- # detect_fields > Run field detection on a previously uploaded document and persist the detected fields, exactly as the AppliFlo app does: the form's sections and skip rules are saved, block-letter forms are noted, and corrections the workspace made to this same form before come back (remembered = how many). Tool of the AppliFlo MCP server at `https://appliflo.com/api/mcp`. Kind: destructive: it emails people or cancels a send, so clients ask you first. Run field detection on a previously uploaded document and persist the detected fields, exactly as the AppliFlo app does: the form's sections and skip rules are saved, block-letter forms are noted, and corrections the workspace made to this same form before come back (remembered = how many). Precondition: document_id must reference a document uploaded via upload_document. Returns the full field list, the choice questions (groups[]: one question answered by ticking boxes, e.g. Title = Mr/Mrs/Miss/Ms), plus flagged_count — fields with flagged:true are low-confidence detections (wrong type, bad box, or unclear label). Never fill a flagged field blindly: either call correct_field to fix it first, or surface it to a human for review before fill_document. match: true (for a first read of a scanned or flat PDF) first checks whether it is a government form AppliFlo already has; if so nothing is read (no AI pages used), fields is empty and official_match + notice say what to do. vision_skipped:true means an AI-reading limit was reached, so only the PDF's built-in fillable fields were read and the list may be incomplete; tell the user. vision_pages is how many pages AI read. ai_pages is the workspace's AI page allowance ({used, limit, remaining, exhausted, resets_at}); when ai_pages.exhausted is true, relay `notice` to the user. ## Inputs | Name | Type | Required | Description | | --- | --- | --- | --- | | `document_id` | string | yes | Id returned by upload_document | | `match` | boolean | no | true to check first whether a new flat upload is a government form AppliFlo already has (default false: always read the boxes). Only for a document with no boxes yet (409 otherwise) | Source: https://dev.appliflo.com/mcp/tools/detect_fields --- # list_fields > List a document's current fields (post-detection, including any corrections already applied via correct_field). Tool of the AppliFlo MCP server at `https://appliflo.com/api/mcp`. Kind: read: it only looks, so clients can run it without asking. List a document's current fields (post-detection, including any corrections already applied via correct_field). Use this to see each field's id (needed by correct_field/fill_document), semantic_type, and flagged status before filling. groups[] lists the choice questions: each has an id, label, kind (single = pick one, multi = pick up to max), the form's own instruction, and options [{ field_id, value, label }]. Answer a question with values[<group id>] in fill_document / send_envelope — never by setting its option boxes one by one. ## Inputs | Name | Type | Required | Description | | --- | --- | --- | --- | | `document_id` | string | yes | Id returned by upload_document | Source: https://dev.appliflo.com/mcp/tools/list_fields --- # correct_field > Apply a correction to one detected field (label, semantic_type, bbox, and/or field type — every patch key is optional, only the keys you send are changed). Tool of the AppliFlo MCP server at `https://appliflo.com/api/mcp`. Kind: destructive: it emails people or cancels a send, so clients ask you first. Apply a correction to one detected field (label, semantic_type, bbox, and/or field type — every patch key is optional, only the keys you send are changed). Use this to fix a flagged or mis-detected field before filling it: an agent-driven correction here also feeds the detection flywheel (recorded as a FieldCorrection audit row). patch.help sets the box's help for the client (at most 160 characters after trimming, shown under its question when they fill it in; null or blank removes it); it is not a correction. ## Inputs | Name | Type | Required | Description | | --- | --- | --- | --- | | `document_id` | string | yes | | | `field_id` | string | yes | | | `patch` | object | yes | | | `patch.label` | string \| null | no | | | `patch.semanticType` | string | no | One of: date, phone, ssn, ein, currency, name, address, email, generic-text, checkbox, radio, signature, initials, comb | | `patch.bbox` | number[] | no | 4 to 4 items | | `patch.fieldType` | string | no | One of: text, checkbox, signature | | `patch.help` | string \| null | no | Help for the client under this box's question, at most 160 characters after trimming; null or blank removes it. Up to 160 characters | Source: https://dev.appliflo.com/mcp/tools/correct_field --- # fill_document > Stamp caller-supplied values into a document's detected fields (keyed by field_id from list_fields/detect_fields) and store the filled PDF. Tool of the AppliFlo MCP server at `https://appliflo.com/api/mcp`. Kind: destructive: it emails people or cancels a send, so clients ask you first. Stamp caller-supplied values into a document's detected fields (keyed by field_id from list_fields/detect_fields) and store the filled PDF. Returns per-field results — check EVERY result before assuming the fill succeeded: 'filled'/'formatted' means the value was stamped in-box; 'overflowed' means the value did NOT fit and was NOT stamped (shorten the value or leave it for a human); 'skipped' means the value was invalid for the field's type (see the result's reason). Never assume a fill succeeded without checking results. A choice question (groups[] from list_fields) is answered with values[<group id>] = one option (single) or a list (multi), each named by the option's value or label; an unknown option, two options for a single question, or more than max is refused with a 422 naming the valid options. groups[] in the result says which options were ticked. Call download_document with artifact:'filled' afterward to retrieve the stamped PDF. A box for a government ID number (passport, visa grant, tax file, social security, driver licence) is stamped in full, but its rendered_text comes back masked to its last 3 characters. Masked values (•••123) can't be sent back: ask the person for the full number. ## Inputs | Name | Type | Required | Description | | --- | --- | --- | --- | | `document_id` | string | yes | | | `values` | map of string \| number \| boolean \| string[] | no | Map of field_id -> value, and group_id -> option (single) or [options] (multi) | | `deterministic` | boolean | no | Disable any non-deterministic layout choices (for reproducible test fixtures) | | `idempotency_key` | string | no | 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). Up to 255 characters | Source: https://dev.appliflo.com/mcp/tools/fill_document --- # fill_form_oneshot > One-shot demo/quick-fill: upload a PDF (or a Word DOCX, converted to PDF; as content_base64 OR file_url, exactly one; at most 20 MB) and a values map keyed by each field's detected label text (the only thing knowable before detection runs), and get back a filled PDF in one call — no persisted document_id, no separate detect_fields/fill_document round trip. Tool of the AppliFlo MCP server at `https://appliflo.com/api/mcp`. Kind: asks first: it changes something in your workspace, so clients ask you first. One-shot demo/quick-fill: upload a PDF (or a Word DOCX, converted to PDF; as content_base64 OR file_url, exactly one; at most 20 MB) and a values map keyed by each field's detected label text (the only thing knowable before detection runs), and get back a filled PDF in one call — no persisted document_id, no separate detect_fields/fill_document round trip. Low-confidence (flagged) fields are NEVER filled here; they come back in `warnings` instead, so check `warnings` for anything that still needs a human/agent review before treating the result as final. Per-field `results` follow the same filled/formatted/overflowed/skipped semantics as fill_document. A choice question (e.g. Title: Mr/Mrs/Miss/Ms) is answered by its label: values["Title"] = "Ms" (a list for a multi-select); `groups` says which options were ticked, and an unsure grouping comes back in `group_warnings`, unfilled. A box for a government ID number (passport, visa grant, tax file, social security, driver licence) is filled in full in the PDF, but its rendered_text comes back masked to its last 3 characters. Masked values (•••123) can't be sent back: ask the person for the full number. ## Inputs | Name | Type | Required | Description | | --- | --- | --- | --- | | `content_base64` | string | no | Base64-encoded PDF or DOCX bytes | | `file_url` | string | no | Instead of content_base64: a public https:// link to the file (e.g. a chat attachment's download URL). AppliFlo downloads it: no private or internal addresses, at most 3 redirects, 20 MB and 20 seconds. The type is read from the file itself, never the link. Up to 2048 characters | | `values` | map of string \| number \| boolean \| string[] | no | Map of the field's label text -> value, and a choice question's label -> option or [options] | | `deterministic` | boolean | no | | | `idempotency_key` | string | no | 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). Up to 255 characters | Source: https://dev.appliflo.com/mcp/tools/fill_form_oneshot --- # send_envelope > Create an envelope for document_id, set recipients + field assignments, and send the initial signing invitations. Tool of the AppliFlo MCP server at `https://appliflo.com/api/mcp`. Kind: destructive: it emails people or cancels a send, so clients ask you first. Create an envelope for document_id, set recipients + field assignments, and send the initial signing invitations. Every envelope needs at least one 'signer' recipient; 'filler' recipients fill assigned fields without signing; 'cc' recipients only receive the completed copy and can NEVER be assigned a field — an assignment targeting a cc recipient is rejected (this is enforced server-side, not just client-side). Returns the new envelope_id for use with get_envelope/remind_envelope/void_envelope/download_document. Each signer/filler is emailed a one-time code to enter before signing unless that recipient has access_code "none". A recipient with delivery "embedded" is never emailed (no invite, reminders or code): your app signs them in its own page with POST /api/v1/embed/signing-sessions (Business plan or a sandbox). Optional `values` pre-fill what the sender knows: field_id -> text, or group_id -> option (single) / [options] (multi) for a choice question from list_fields. Signing fields, and any field or question this request assigns to a recipient, are refused (422) — the recipient fills those. subject, routing and recipients are required, unless use_prepare_draft: true sends what the Prepare tools (or the web Prepare page) saved for the document instead. 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. ## Inputs | Name | Type | Required | Description | | --- | --- | --- | --- | | `document_id` | string | yes | | | `use_prepare_draft` | boolean | no | true: send the document's saved Prepare state (set_envelope_recipients, ai_assign, set_box_owner, skip_box, set_fixed_value, or the web Prepare page) instead of recipients/assignments/values, which are then refused. subject and message stay optional overrides. One of: true | | `prepare_draft_version` | integer | no | With use_prepare_draft and confirm: true, required: the prepare_draft_version the unconfirmed call showed. A draft changed since is refused (409 draft_changed). At least 1 | | `assign_run_id` | string | no | With use_prepare_draft: ai_assign's run_id, so the send teaches AI assign. Up to 64 characters | | `assign_applied` | string[] | no | With assign_run_id: ai_assign's applied box ids. Up to 2000 items | | `local_day` | string | no | With use_prepare_draft: the sender's own day (YYYY-MM-DD), for a Fixed date such as the day it is sent | | `confirm` | boolean | no | true to really do it. Without it nothing happens: you get an error describing what would happen, to show the user | | `idempotency_key` | string | no | 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). Up to 255 characters | | `esign_risk_acknowledged` | boolean | no | The sender acknowledges the agency may reject an electronic signature on this form (warn-mode forms only) | | `subject` | string | no | Up to 998 characters | | `message` | string | no | Up to 4096 characters | | `routing` | string | no | One of: parallel, sequential | | `recipients` | object[] | no | 1 to 50 items | | `recipients[].name` | string | yes | Up to 256 characters | | `recipients[].email` | string | yes | Format: email. Up to 254 characters | | `recipients[].role` | string | yes | One of: signer, filler, cc | | `recipients[].access_code` | string | no | Identity check before signing. Default "email": the person is emailed a one-time code to enter after opening their link. "none" switches it off. Ignored for cc. One of: email, none | | `recipients[].delivery` | string | no | 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). One of: email, embedded | | `assignments` | object[] | no | Up to 500 items | | `assignments[].fieldId` | string | yes | | | `assignments[].recipientIndex` | integer | yes | At least 0 | | `values` | map of string \| string[] \| object | no | field_id -> text; group_id -> option (single) or [options] (multi), or { chosen?, other } for a question answered with its Other box | Source: https://dev.appliflo.com/mcp/tools/send_envelope --- # list_envelopes > List envelopes in the workspace, optionally filtered by status, paginated with limit/offset (default limit 20, max 100). Tool of the AppliFlo MCP server at `https://appliflo.com/api/mcp`. Kind: read: it only looks, so clients can run it without asking. List envelopes in the workspace, optionally filtered by status, paginated with limit/offset (default limit 20, max 100). Use this to find an envelope_id for get_envelope/remind_envelope/void_envelope/download_document, or to check whether anything is still awaiting signature. ## Inputs | Name | Type | Required | Description | | --- | --- | --- | --- | | `status` | string | no | One of: draft, awaiting, completing, completed, declined, expired, voided | | `limit` | integer | no | 1 to 100. Default: 20 | | `offset` | integer | no | At least 0. Default: 0 | Source: https://dev.appliflo.com/mcp/tools/list_envelopes --- # get_envelope > Get full envelope detail: document, recipients (with per-recipient view/consent/sign timestamps and delivery: "email", or "embedded" for one your app signs and nobody emails), status, and the audit timeline. Tool of the AppliFlo MCP server at `https://appliflo.com/api/mcp`. Kind: read: it only looks, so clients can run it without asking. Get full envelope detail: document, recipients (with per-recipient view/consent/sign timestamps and delivery: "email", or "embedded" for one your app signs and nobody emails), status, and the audit timeline. Use this to check who is blocking signature before deciding whether to call remind_envelope (an embedded recipient is never reminded). ## Inputs | Name | Type | Required | Description | | --- | --- | --- | --- | | `envelope_id` | string | yes | | Source: https://dev.appliflo.com/mcp/tools/get_envelope --- # remind_envelope > Send a reminder email to every recipient still blocking signature on an envelope. Tool of the AppliFlo MCP server at `https://appliflo.com/api/mcp`. Kind: destructive: it emails people or cancels a send, so clients ask you first. Send a reminder email to every recipient still blocking signature on an envelope. Precondition: the envelope must be in 'awaiting' status (fails otherwise). Rate-limited to one reminder per recipient per 24h — the response's rateLimited count tells you how many recipients were skipped because they were reminded too recently; `reminded` is how many actually got a new email. ## Inputs | Name | Type | Required | Description | | --- | --- | --- | --- | | `envelope_id` | string | yes | | Source: https://dev.appliflo.com/mcp/tools/remind_envelope --- # void_envelope > Permanently cancel an envelope (a reason is required and is stored on the audit trail). Tool of the AppliFlo MCP server at `https://appliflo.com/api/mcp`. Kind: destructive: it emails people or cancels a send, so clients ask you first. Permanently cancel an envelope (a reason is required and is stored on the audit trail). This is irreversible — a voided envelope can never be sent again; the sender would need to start over with a new envelope. Fails if the envelope's current status can't transition to voided (e.g. it's already completed). 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. ## Inputs | Name | Type | Required | Description | | --- | --- | --- | --- | | `envelope_id` | string | yes | | | `reason` | string | yes | Up to 1000 characters | | `confirm` | boolean | no | true to really do it. Without it nothing happens: you get an error describing what would happen, to show the user | Source: https://dev.appliflo.com/mcp/tools/void_envelope --- # download_document > Get a short-lived signed download URL for a PDF artifact. Tool of the AppliFlo MCP server at `https://appliflo.com/api/mcp`. Kind: read: it only looks, so clients can run it without asking. Get a short-lived signed download URL for a PDF artifact. Pass EITHER document_id (artifact: 'original' — the as-uploaded PDF, the default — or 'filled' — the last fill_document/fill_form_oneshot output; 404s if never filled) OR envelope_id (artifact 'sealed', the default there — the completed, signed PDF; only available once the envelope is fully signed). Never both: a call with both ids is refused. A filled or signed PDF contains the full form as filled in, ID numbers included (replies show them only as their last 3 characters). ## Inputs | Name | Type | Required | Description | | --- | --- | --- | --- | | `document_id` | string | no | A document's id. Not with envelope_id | | `envelope_id` | string | no | An envelope's id, for its sealed PDF. Not with document_id | | `artifact` | string | no | original or filled (default original) with document_id; sealed (the default) with envelope_id. One of: original, filled, sealed | Source: https://dev.appliflo.com/mcp/tools/download_document --- # list_templates > List everything this workspace can start a document from, in one list (the app's Templates page): the workspace's saved templates first, then AppliFlo's contract templates, then the official government forms (e.g. Tool of the AppliFlo MCP server at `https://appliflo.com/api/mcp`. Kind: read: it only looks, so clients can run it without asking. List everything this workspace can start a document from, in one list (the app's Templates page): the workspace's saved templates first, then AppliFlo's contract templates, then the official government forms (e.g. Home Affairs Form 956, IRS W-9). Call this BEFORE create_from_template, send_template or send_template_bulk: it tells you the template_id, its role keys and version; never guess them. Use get_template for the boxes. To send an official form to someone ("Send Form 956 to Lan"), find it here with query (e.g. "956") instead of asking for a file. Filters: kind, query (name or form code), country (US or AU), category. Paginated with limit/offset (default limit 20, max 100); total is the number of matches. Free-form drafting of arbitrary legal documents is not supported: if nothing fits, say so rather than improvising one. The list is light: each row has `template_id`, `kind`, `name`, `status`, `version`, `roles[]`, `official_form`, `country`, `pages`, `own_risk`, `setup_required`, `esign` ({mode} only, or null) and counts instead of boxes: `box_count`, `sender_box_count` (boxes you may prefill) and `fixed_box_count` (boxes the template fills itself). Use get_template for the boxes (sender_fields[], fixed_fields[], a contract's required_values[] and party_fields[]) and the e-sign notice, before you prefill or override any box. Each entry (get_template's shape): `template_id` (what get_template, create_from_template, send_template and send_template_bulk take), `kind` (saved = the workspace's own; contract = a contract template the workspace wrote in the older model, drafted with `values` and `recipients` (see its required_values[], recipients_required and party_fields[]); library = an AppliFlo contract template; official = a government form from AppliFlo's official forms library, with `official_form` {code, label, title, agency, agency_name} and `country`), `name`, `status`, `version` (the current one: send_template_bulk needs it), `roles[]` in signing order (`key` is what `people` takes, e.g. {"r1": {name, email}}; `label` is the human name such as Client; `kind` signer|filler), `sender_fields[]` (the only boxes you may prefill, keyed by `index`; `bulk: true` ones can be prefilled per row) and `fixed_fields[]` (boxes the template fills itself). status `ready`: set up with roles, use it with send_template (one call) or create_from_template + send_envelope. status `draft`: a saved template an owner or admin hasn't finalised (create_from_template gives a draft document; send_template refuses it), or an official form AppliFlo hasn't set up (create_from_template imports it as a document with its fields read; fill it, then add recipients at send_envelope). `own_risk: true`: an AppliFlo contract no lawyer has reviewed; it is used only after the person accepts the own-risk terms (risk_accepted: true). `setup_required: true`: the app asks for a one-time set-up of this form in the workspace (its business details and who sends it); without it, a box the set-up would answer refuses the draft or send with 422 unanswered_ask or missing_detail: give it in fixed_overrides, or ask an owner or admin to set the form up in the app. `esign` (null for most): {mode, notice}; mode `block` = the agency wants a handwritten signature, so it can be filled and downloaded but never sent for e-signing (422 esign_not_allowed); `warn` = the sender must acknowledge the notice (esign_risk_acknowledged: true). ## Inputs | Name | Type | Required | Description | | --- | --- | --- | --- | | `kind` | string | no | Only this kind: saved, contract, library or official. One of: saved, contract, library, official | | `query` | string | no | Words in the name, or an official form's code ("956", "W-9"). Up to 100 characters | | `country` | string | no | Only items for this country (official forms and saved copies of them). One of: US, AU | | `category` | string | no | Only this category, e.g. 'nda' or 'immigration'. Up to 40 characters | | `limit` | integer | no | 1 to 100. Default: 20 | | `offset` | integer | no | At least 0. Default: 0 | Source: https://dev.appliflo.com/mcp/tools/list_templates --- # get_template > Read ONE template from list_templates by its template_id (a saved template, an AppliFlo contract or an official form, "lib_...") with its full detail: everything list_templates shows, plus the boxes (sender_fields[], fixed_fields[], a contract's required_values[] and party_fields[]) and the e-sign notice. Tool of the AppliFlo MCP server at `https://appliflo.com/api/mcp`. Kind: read: it only looks, so clients can run it without asking. Read ONE template from list_templates by its template_id (a saved template, an AppliFlo contract or an official form, "lib_...") with its full detail: everything list_templates shows, plus the boxes (sender_fields[], fixed_fields[], a contract's required_values[] and party_fields[]) and the e-sign notice. Use it for the boxes before prefill or fixed_overrides, and to re-check a template right before a send. Each entry (get_template's shape): `template_id` (what get_template, create_from_template, send_template and send_template_bulk take), `kind` (saved = the workspace's own; contract = a contract template the workspace wrote in the older model, drafted with `values` and `recipients` (see its required_values[], recipients_required and party_fields[]); library = an AppliFlo contract template; official = a government form from AppliFlo's official forms library, with `official_form` {code, label, title, agency, agency_name} and `country`), `name`, `status`, `version` (the current one: send_template_bulk needs it), `roles[]` in signing order (`key` is what `people` takes, e.g. {"r1": {name, email}}; `label` is the human name such as Client; `kind` signer|filler), `sender_fields[]` (the only boxes you may prefill, keyed by `index`; `bulk: true` ones can be prefilled per row) and `fixed_fields[]` (boxes the template fills itself). status `ready`: set up with roles, use it with send_template (one call) or create_from_template + send_envelope. status `draft`: a saved template an owner or admin hasn't finalised (create_from_template gives a draft document; send_template refuses it), or an official form AppliFlo hasn't set up (create_from_template imports it as a document with its fields read; fill it, then add recipients at send_envelope). `own_risk: true`: an AppliFlo contract no lawyer has reviewed; it is used only after the person accepts the own-risk terms (risk_accepted: true). `setup_required: true`: the app asks for a one-time set-up of this form in the workspace (its business details and who sends it); without it, a box the set-up would answer refuses the draft or send with 422 unanswered_ask or missing_detail: give it in fixed_overrides, or ask an owner or admin to set the form up in the app. `esign` (null for most): {mode, notice}; mode `block` = the agency wants a handwritten signature, so it can be filled and downloaded but never sent for e-signing (422 esign_not_allowed); `warn` = the sender must acknowledge the notice (esign_risk_acknowledged: true). ## Inputs | Name | Type | Required | Description | | --- | --- | --- | --- | | `template_id` | string | yes | templates[].template_id from list_templates | Source: https://dev.appliflo.com/mcp/tools/get_template --- # create_from_template > Start a document from a template in list_templates (any kind) and persist it, returning document_id. Tool of the AppliFlo MCP server at `https://appliflo.com/api/mcp`. Kind: asks first: it changes something in your workspace, so clients ask you first. 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 | Name | Type | Required | Description | | --- | --- | --- | --- | | `template_id` | string | yes | templates[].template_id from list_templates | | `people` | map of object | no | 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 | | `document_name` | string | no | Defaults to the template name. Up to 255 characters | | `fixed_overrides` | map of string \| boolean \| string[] | no | 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_day` | string | no | The sender's own calendar day (YYYY-MM-DD), the 'today' fixed date boxes count from. Defaults to the server's UTC day | | `values` | map of string | no | kind contract only: map of required_values[].key -> string value | | `recipients` | object[] | no | kind contract only (required there): the parties, in order: index 0 is party_a, index 1 is party_b, ... Up to 4 items | | `recipients[].name` | string | yes | Up to 256 characters | | `recipients[].email` | string | yes | Format: email. Up to 254 characters | | `risk_accepted` | boolean | no | 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` | string | no | 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). Up to 255 characters | Source: https://dev.appliflo.com/mcp/tools/create_from_template --- # 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. Tool of the AppliFlo MCP server at `https://appliflo.com/api/mcp`. Kind: destructive: it emails people or cancels a send, so clients ask you first. 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. ## Inputs | Name | Type | Required | Description | | --- | --- | --- | --- | | `template_id` | string | yes | saved_templates[].template_id from list_templates | | `version` | integer | no | Pin a version; defaults to the current one. At least 1 | | `esign_risk_acknowledged` | boolean | no | The sender acknowledges the agency may reject an electronic signature on this form (warn-mode forms only) | | `people` | map of object | yes | 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 | | `prefill` | map of string \| string[] | no | 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) | | `cc` | object[] | no | Extra copies (added to the template's fixed CCs, which always apply). Up to 20 items | | `cc[].email` | string | yes | Format: email. Up to 254 characters | | `cc[].name` | string | no | Up to 120 characters | | `subject` | string | no | Defaults to the template's subject. Up to 200 characters | | `message` | string | no | Defaults to the template's message. Up to 4000 characters | | `idempotency_key` | string | no | Same key = same send (a retry returns the first envelope). Up to 255 characters | | `fixed_overrides` | map of string \| boolean \| string[] | no | 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_defaults` | integer[] | no | 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` | string | no | 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` | boolean | no | 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` | boolean | no | true to really do it. Without it nothing happens: you get an error describing what would happen, to show the user | Source: https://dev.appliflo.com/mcp/tools/send_template --- # send_template_bulk > Send a Ready saved template to many people: one envelope per row (up to 500 rows). Tool of the AppliFlo MCP server at `https://appliflo.com/api/mcp`. Kind: destructive: it emails people or cancels a send, so clients ask you first. Send a Ready saved template to many people: one envelope per row (up to 500 rows). Call list_templates FIRST and pass the template's current `version` and its roles[].key values as the keys of each row's `people`. Each row is checked like the app's review step: a blank row, a missing or invalid email, the same person twice for a role, or two roles sharing an email leaves that row out (reported in rows[] with its issues); the rest are queued and sent in the background. Prefill only sender_fields with `bulk: true` (by index). Returns batch_id: poll get_bulk_batch for progress. Refused with 409 template_not_ready (Draft) or version_mismatch (the template was finalised again: call list_templates again). Pass idempotency_key when retrying so the batch isn't started twice. Confirm the list with the user first: this sends real email. 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. Sending to many needs risk_accepted: true on every start. 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. ## Inputs | Name | Type | Required | Description | | --- | --- | --- | --- | | `template_id` | string | yes | saved_templates[].template_id from list_templates | | `version` | integer | yes | saved_templates[].version from list_templates (required). At least 1 | | `rows` | object[] | yes | One envelope per row. 1 to 500 items | | `rows[].people` | map of object | yes | 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 | | `rows[].prefill` | map of string | no | 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) | | `rows[].cc` | object[] | no | Extra copies for this row's envelope only. Up to 20 items | | `rows[].cc[].email` | string | yes | Format: email. Up to 254 characters | | `rows[].cc[].name` | string | no | Up to 120 characters | | `subject` | string | no | Defaults to the template's subject (placeholders resolve per row). Up to 200 characters | | `message` | string | no | Defaults to the template's message. Up to 4000 characters | | `idempotency_key` | string | no | Same key = the same batch. Up to 100 characters | | `time_zone` | string | no | The sender's IANA time zone (e.g. "Australia/Sydney"): fixed date boxes such as "Date it's sent" count from the sender's own day. Defaults to UTC. Up to 64 characters | | `esign_risk_acknowledged` | boolean | no | The sender acknowledges the agency may reject an electronic signature on this form (warn-mode forms only) | | `adopt_signature` | boolean | no | The starter adopts their saved signature for every envelope (a template with a Sender-signs box). Only a signed-in sender can: with an API key such a template is refused (signature_not_adopted) | | `risk_accepted` | boolean | no | 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` | boolean | no | true to really do it. Without it nothing happens: you get an error describing what would happen, to show the user | Source: https://dev.appliflo.com/mcp/tools/send_template_bulk --- # get_bulk_batch > Progress of a send started with send_template_bulk: the batch status (queued | sending | paused | cancelled | done; paused has a pause_reason, quota or suspended, and resumes on its own), counts, and each row's status (queued | sent | failed | excluded | cancelled) with its envelope_id (use get_envelope for signing progress), last error and needs_fix (fix it with fix_bulk_row). Tool of the AppliFlo MCP server at `https://appliflo.com/api/mcp`. Kind: read: it only looks, so clients can run it without asking. Progress of a send started with send_template_bulk: the batch status (queued | sending | paused | cancelled | done; paused has a pause_reason, quota or suspended, and resumes on its own), counts, and each row's status (queued | sent | failed | excluded | cancelled) with its envelope_id (use get_envelope for signing progress), last error and needs_fix (fix it with fix_bulk_row). To start a batch, call list_templates first for the role keys and version, then send_template_bulk. ## Inputs | Name | Type | Required | Description | | --- | --- | --- | --- | | `batch_id` | string | yes | batch_id from send_template_bulk | Source: https://dev.appliflo.com/mcp/tools/get_bulk_batch --- # cancel_bulk_batch > Stop a send started with send_template_bulk: every row not sent yet is cancelled; envelopes already sent are untouched (void_envelope them one by one if needed). Tool of the AppliFlo MCP server at `https://appliflo.com/api/mcp`. Kind: destructive: it emails people or cancels a send, so clients ask you first. Stop a send started with send_template_bulk: every row not sent yet is cancelled; envelopes already sent are untouched (void_envelope them one by one if needed). A batch that already finished is refused (409 batch_finished). Find batch_id from send_template_bulk; check progress with get_bulk_batch. ## Inputs | Name | Type | Required | Description | | --- | --- | --- | --- | | `batch_id` | string | yes | batch_id from send_template_bulk | Source: https://dev.appliflo.com/mcp/tools/cancel_bulk_batch --- # fix_bulk_row > Fix one failed row of a send_template_bulk batch and send it again. get_bulk_batch shows each row's `needs_fix` (the email provider refused it or it bounced: retrying as is can't help). Tool of the AppliFlo MCP server at `https://appliflo.com/api/mcp`. Kind: destructive: it emails people or cancels a send, so clients ask you first. Fix one failed row of a send_template_bulk batch and send it again. get_bulk_batch shows each row's `needs_fix` (the email provider refused it or it bounced: retrying as is can't help). Give the changed `people` (by role key, as list_templates returns them: { role_1: { email } }) and/or `prefill` (by sender box index). A change is required (422 no_change); only a failed row can be fixed (409 not_fixable). The row is checked like the first time and sent as a new envelope. Masked values (•••123) can't be sent back: ask the person for the full number. ## Inputs | Name | Type | Required | Description | | --- | --- | --- | --- | | `batch_id` | string | yes | batch_id from send_template_bulk | | `row` | integer | yes | The row number get_bulk_batch reports. At least 1 | | `people` | map of object | no | Role key -> { name?, email? }: only what changes | | `prefill` | map of string | no | Sender box index -> new value | Source: https://dev.appliflo.com/mcp/tools/fix_bulk_row --- # list_documents > The Documents list exactly as the web app shows it: PDFs and Docs in one list, newest first, only the ones the caller may see. scope 'mine' (created by or sent to the caller; the default for a person) or 'workspace' (the default for an API key, which owns no documents); filter by status group (needs_you, drafts, waiting, completed, declined, expired, voided, expiring), sent_as (single, bulk, unsent), type, owner (a user id), client (a client id) and q (name or recipient). Tool of the AppliFlo MCP server at `https://appliflo.com/api/mcp`. Kind: read: it only looks, so clients can run it without asking. The Documents list exactly as the web app shows it: PDFs and Docs in one list, newest first, only the ones the caller may see. scope 'mine' (created by or sent to the caller; the default for a person) or 'workspace' (the default for an API key, which owns no documents); filter by status group (needs_you, drafts, waiting, completed, declined, expired, voided, expiring), sent_as (single, bulk, unsent), type, owner (a user id), client (a client id) and q (name or recipient). Paged with page (from 1) and limit (1 to 50, default 25). Returns documents[] (id, kind, name, status, owner, client, envelope_id, url), total and counts per status group. include_filters: true also returns filters {owners, clients}: everyone and every client the list could be filtered by (long in a big workspace; to find a client's id use search_clients instead). A kind 'doc' row is a Doc; for a sent Doc, pdf_document_id is the PDF id the other document tools take. in_trash: true lists the Trash instead (deleted PDFs and Docs, restorable for 30 days; kind tells them apart): restore_document and delete_document_forever take the PDF ones; a trashed Doc is restored in the web app. Use get_document for one document's detail, list_envelopes for raw envelope rows. ## Inputs | Name | Type | Required | Description | | --- | --- | --- | --- | | `scope` | string | no | One of: mine, workspace | | `status` | string[] | no | | | `sent_as` | string[] | no | | | `type` | string | no | One of: all, docs, pdfs | | `owner` | string | no | A user id (each row names its owner) | | `client` | string | no | A client id: only that client's documents | | `q` | string | no | Matches the name, or a recipient's name or email. Up to 200 characters | | `sort` | string | no | One of: created, name, status, owner | | `dir` | string | no | One of: asc, desc | | `page` | integer | no | At least 1 | | `limit` | integer | no | Rows per page, 1 to 50 (default 25). 1 to 50. Default: 25 | | `in_trash` | boolean | no | true: the Trash (deleted PDFs and Docs) instead of the list; the other filters are ignored | | `include_filters` | boolean | no | true: also return filters {owners, clients} for the owner and client filters (default false; search_clients finds a client) | Source: https://dev.appliflo.com/mcp/tools/list_documents --- # get_document > One PDF document as the web app shows it: name, status, page count, its client, a summary of its boxes (how many, flagged for review, by type, by page, assigned to a recipient, choice questions) and, once sent, its signing: the latest round (envelope_id, status, recipients and where each is, with delivery: "embedded" for one your app signs, never emailed), every round (a resend starts a new one), reminders and what the caller may do next (remind, void, resend, download). signing is null for a draft. Tool of the AppliFlo MCP server at `https://appliflo.com/api/mcp`. Kind: read: it only looks, so clients can run it without asking. One PDF document as the web app shows it: name, status, page count, its client, a summary of its boxes (how many, flagged for review, by type, by page, assigned to a recipient, choice questions) and, once sent, its signing: the latest round (envelope_id, status, recipients and where each is, with delivery: "embedded" for one your app signs, never emailed), every round (a resend starts a new one), reminders and what the caller may do next (remind, void, resend, download). signing is null for a draft. Use list_fields for the boxes themselves and get_envelope for one envelope's full detail. ## Inputs | Name | Type | Required | Description | | --- | --- | --- | --- | | `document_id` | string | yes | | Source: https://dev.appliflo.com/mcp/tools/get_document --- # rename_document > Rename a PDF document everywhere it shows (the Documents list, its pages, later emails). 1-200 characters, no slashes; extra spaces are trimmed. Tool of the AppliFlo MCP server at `https://appliflo.com/api/mcp`. Kind: destructive: it emails people or cancels a send, so clients ask you first. Rename a PDF document everywhere it shows (the Documents list, its pages, later emails). 1-200 characters, no slashes; extra spaces are trimmed. A document in the Trash is not found. The old and new name go on the workspace audit log. Returns { id, name }. ## Inputs | Name | Type | Required | Description | | --- | --- | --- | --- | | `document_id` | string | yes | | | `name` | string | yes | Up to 200 characters | Source: https://dev.appliflo.com/mcp/tools/rename_document --- # trash_document > Move a draft PDF to the Trash, as Delete does in the web app. Tool of the AppliFlo MCP server at `https://appliflo.com/api/mcp`. Kind: destructive: it emails people or cancels a send, so clients ask you first. Move a draft PDF to the Trash, as Delete does in the web app. It can be restored for 30 days (restore_document), then it is deleted for good. Only drafts: a document that was sent is the record of what was signed and is refused (409). A member may trash only their own drafts; owners and admins any. Returns { id, name, deleted_at, days_left }. 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. ## Inputs | Name | Type | Required | Description | | --- | --- | --- | --- | | `document_id` | string | yes | | | `confirm` | boolean | no | true to really do it. Without it nothing happens: you get an error describing what would happen, to show the user | Source: https://dev.appliflo.com/mcp/tools/trash_document --- # restore_document > Bring a document back from the Trash (within its 30 days), as Restore does on the web. Tool of the AppliFlo MCP server at `https://appliflo.com/api/mcp`. Kind: asks first: it changes something in your workspace, so clients ask you first. Bring a document back from the Trash (within its 30 days), as Restore does on the web. Find trashed ids with list_documents in_trash: true. A member may restore their own; owners and admins any. Returns { id, name }. ## Inputs | Name | Type | Required | Description | | --- | --- | --- | --- | | `document_id` | string | yes | | Source: https://dev.appliflo.com/mcp/tools/restore_document --- # delete_document_forever > Permanently delete a document that is already in the Trash, with its fields and stored files. Tool of the AppliFlo MCP server at `https://appliflo.com/api/mcp`. Kind: destructive: it emails people or cancels a send, so clients ask you first. Permanently delete a document that is already in the Trash, with its fields and stored files. This cannot be undone. Owners and admins only (not API keys), as on the web; trash it first with trash_document. Returns { id, name, deleted: true }. 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. ## Inputs | Name | Type | Required | Description | | --- | --- | --- | --- | | `document_id` | string | yes | | | `confirm` | boolean | no | true to really do it. Without it nothing happens: you get an error describing what would happen, to show the user | Source: https://dev.appliflo.com/mcp/tools/delete_document_forever --- # resend_document > Resend a sent document, as Resend on its web page does: the latest round is voided with your reason and a new round goes out on the same document to the same people (or with some of them changed: recipients[] by index into the latest round's recipients, as get_document lists them), with the same boxes, the sender's values, routing, expiry length and reminders. Tool of the AppliFlo MCP server at `https://appliflo.com/api/mcp`. Kind: destructive: it emails people or cancels a send, so clients ask you first. Resend a sent document, as Resend on its web page does: the latest round is voided with your reason and a new round goes out on the same document to the same people (or with some of them changed: recipients[] by index into the latest round's recipients, as get_document lists them), with the same boxes, the sender's values, routing, expiry length and reminders. Everyone on the new round is emailed a fresh link. Allowed for a round that is out, declined or expired (not completed, voided or one the sender signed: 409 not_resendable), for its sender, an owner/admin or someone who can edit the document (else 403). Use remind_envelope to nudge people on the same round instead. Returns { envelope_id } of the new round. 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. ## Inputs | Name | Type | Required | Description | | --- | --- | --- | --- | | `document_id` | string | yes | | | `reason` | string | yes | Why it is sent again; stored on the audit trail. Up to 1000 characters | | `recipients` | object[] | no | Only the people to change; the others are copied unchanged. Up to 50 items | | `recipients[].index` | integer | yes | Position in the latest round's recipients (0 = first). At least 0 | | `recipients[].name` | string | yes | Up to 256 characters | | `recipients[].email` | string | yes | Up to 254 characters | | `recipients[].delivery` | string | no | Switch how their link reaches them (absent: kept). "embedded" is never emailed and needs the Business plan or a sandbox; after a downgrade, switch an embedded person to "email" to resend. One of: email, embedded | | `esign_risk_acknowledged` | boolean | no | The sender acknowledges the agency may reject an electronic signature on this form (warn-mode hosted forms only) | | `idempotency_key` | string | no | Same key = same resend: a retry finishes or returns the first one instead of sending again. Up to 255 characters | | `confirm` | boolean | no | true to really do it. Without it nothing happens: you get an error describing what would happen, to show the user | Source: https://dev.appliflo.com/mcp/tools/resend_document --- # add_field > Draw a new box on a document page, as a person does with the app's box editor: use it for a box detection missed (e.g. a signature line or a date with no field). type: text, date (typed date), checkbox, signature, or date_signed (stamped with the signing date of the nearest signature on the page). page is 0-based and bbox is [x0, y0, x1, y1] in PDF points, the same coordinates list_fields shows for the boxes around it; the box is kept at least 6 pt each way and inside the page. Tool of the AppliFlo MCP server at `https://appliflo.com/api/mcp`. Kind: asks first: it changes something in your workspace, so clients ask you first. Draw a new box on a document page, as a person does with the app's box editor: use it for a box detection missed (e.g. a signature line or a date with no field). type: text, date (typed date), checkbox, signature, or date_signed (stamped with the signing date of the nearest signature on the page). page is 0-based and bbox is [x0, y0, x1, y1] in PDF points, the same coordinates list_fields shows for the boxes around it; the box is kept at least 6 pt each way and inside the page. A signature or date_signed box is filled by the signer. Returns the new field as list_fields shows it (use its id with fill_document, send_envelope or correct_field). Recorded in the document's correction log, as the app's edits are. To fix an existing box, use correct_field; to remove one, delete_field. ## Inputs | Name | Type | Required | Description | | --- | --- | --- | --- | | `document_id` | string | yes | The document's id | | `page` | integer | yes | 0-based page number. 0 to 2000 | | `bbox` | number[] | yes | [x0, y0, x1, y1] in PDF points, as list_fields' bbox. 4 to 4 items | | `type` | string | yes | One of: text, date, checkbox, signature, date_signed | | `label` | string | yes | What the box asks for, e.g. "Applicant signature". Up to 300 characters | Source: https://dev.appliflo.com/mcp/tools/add_field --- # delete_field > Delete one box from a document, as the app's box editor does (e.g. a box detection found that isn't a real field). Tool of the AppliFlo MCP server at `https://appliflo.com/api/mcp`. Kind: destructive: it emails people or cancels a send, so clients ask you first. Delete one box from a document, as the app's box editor does (e.g. a box detection found that isn't a real field). Its value and its place in a choice question go with it. Returns { deleted: field_id }; a box that is already gone is 404. The app can undo this, MCP can't: to put a box back, draw it again with add_field. To fix a box instead, use correct_field. 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. ## Inputs | Name | Type | Required | Description | | --- | --- | --- | --- | | `document_id` | string | yes | The document's id | | `field_id` | string | yes | The box's id, from list_fields | | `confirm` | boolean | no | true to really do it. Without it nothing happens: you get an error describing what would happen, to show the user | Source: https://dev.appliflo.com/mcp/tools/delete_field --- # list_groups > List a document's choice questions: groups of tick boxes answered as one question (e.g. Tool of the AppliFlo MCP server at `https://appliflo.com/api/mcp`. Kind: read: it only looks, so clients can run it without asking. List a document's choice questions: groups of tick boxes answered as one question (e.g. Title = Mr/Mrs/Ms). Each has an id, label, kind (single = pick one, multi = pick up to max), the form's own instruction, source (manual = a person set it), and options [{ field_id, value, label }] (value is what the box stamps). The same groups[] list_fields returns, without the boxes: use this before update_group or set_form_rules, and list_fields when you also need every box. ## Inputs | Name | Type | Required | Description | | --- | --- | --- | --- | | `document_id` | string | yes | The document's id | Source: https://dev.appliflo.com/mcp/tools/list_groups --- # update_group > Edit one choice question (from list_groups), as the app's question editor does: rename it (label), switch kind (single = pick one, multi = pick several), set max (multi only: answer up to N; null = no limit), replace its options (2-200 tick boxes on this document, each { field_id, label, value }: value is what the box stamps; a box moves out of any other question, and a question left with one box is dropped), set other_field_id (a plain text box filled when the client picks Other; null detaches it), or confirmed: true to settle a flagged question as checked. Tool of the AppliFlo MCP server at `https://appliflo.com/api/mcp`. Kind: destructive: it emails people or cancels a send, so clients ask you first. Edit one choice question (from list_groups), as the app's question editor does: rename it (label), switch kind (single = pick one, multi = pick several), set max (multi only: answer up to N; null = no limit), replace its options (2-200 tick boxes on this document, each { field_id, label, value }: value is what the box stamps; a box moves out of any other question, and a question left with one box is dropped), set other_field_id (a plain text box filled when the client picks Other; null detaches it), or confirmed: true to settle a flagged question as checked. Send only what changes. Any edit makes the question the person's own (source manual). Returns the question as list_groups shows it. Skip rules on the question are edited with set_form_rules. ## Inputs | Name | Type | Required | Description | | --- | --- | --- | --- | | `document_id` | string | yes | The document's id | | `group_id` | string | yes | The question's id, from list_groups. Up to 64 characters | | `label` | string | no | Up to 300 characters | | `kind` | string | no | One of: single, multi | | `max` | integer \| null | no | Multi only: the most answers allowed; null = no limit. 1 to 200 | | `options` | object[] | no | The question's whole option list, in order. 2 to 200 items | | `options[].field_id` | string | yes | A tick box on this document (list_fields). Up to 64 characters | | `options[].label` | string | yes | What the client sees. Up to 200 characters | | `options[].value` | string | yes | What the box stamps. Up to 120 characters | | `confirmed` | true | no | true marks a flagged question as checked by a person | | `other_field_id` | string \| null | no | A text box to use as the question's Other box; null detaches it. Up to 64 characters | Source: https://dev.appliflo.com/mcp/tools/update_group --- # get_form_rules > Read a document's form rules: its sections and skip logic, as the app's Detect step shows them on each question. sections[] are the form's parts and numbered questions ({ id, kind: part|question, label, number, parent_id }); rules[] are its skip logic, in order: when the choice question group_id is answered with one of option_values, the sections in skip[] are not needed and goto (a section id, or null) is where the form sends the reader next. source is page_text (read from the form's printed words), llm, or manual (a person's). Tool of the AppliFlo MCP server at `https://appliflo.com/api/mcp`. Kind: read: it only looks, so clients can run it without asking. Read a document's form rules: its sections and skip logic, as the app's Detect step shows them on each question. sections[] are the form's parts and numbered questions ({ id, kind: part|question, label, number, parent_id }); rules[] are its skip logic, in order: when the choice question group_id is answered with one of option_values, the sections in skip[] are not needed and goto (a section id, or null) is where the form sends the reader next. source is page_text (read from the form's printed words), llm, or manual (a person's). Read this before set_form_rules (which replaces the whole list). ## Inputs | Name | Type | Required | Description | | --- | --- | --- | --- | | `document_id` | string | yes | The document's id | Source: https://dev.appliflo.com/mcp/tools/get_form_rules --- # set_form_rules > Replace a document's whole skip-rule list, in order, as the app's Detect step saves it when a person edits, removes or adds a rule on a question. Tool of the AppliFlo MCP server at `https://appliflo.com/api/mcp`. Kind: destructive: it emails people or cancels a send, so clients ask you first. Replace a document's whole skip-rule list, in order, as the app's Detect step saves it when a person edits, removes or adds a rule on a question. Call get_form_rules first and send back every rule you keep: a rule left out is removed (rules: [] removes them all). Keep a rule's id to keep where it came from (the form's printed words); a changed or new rule (no id) becomes the person's own. Each rule: group_id (a choice question from list_groups), option_values (that question's option values that trigger it), skip (section ids from get_form_rules not needed then) and/or goto (the section id to go to next). A rule must skip something or go somewhere, and can't only skip its own question (422 with the reason otherwise). Returns the saved list in get_form_rules' shape. sections[] are the form's parts and numbered questions ({ id, kind: part|question, label, number, parent_id }); rules[] are its skip logic, in order: when the choice question group_id is answered with one of option_values, the sections in skip[] are not needed and goto (a section id, or null) is where the form sends the reader next. source is page_text (read from the form's printed words), llm, or manual (a person's). ## Inputs | Name | Type | Required | Description | | --- | --- | --- | --- | | `document_id` | string | yes | The document's id | | `rules` | object[] | yes | Up to 500 items | | `rules[].id` | string | no | Keep an existing rule's id (from get_form_rules); omit for a new rule. Up to 64 characters | | `rules[].group_id` | string | yes | The choice question that triggers it. Up to 64 characters | | `rules[].option_values` | string[] | yes | 1 to 50 items | | `rules[].skip` | string[] | no | Section ids not needed when it fires (default []). Up to 200 items | | `rules[].goto` | string \| null | no | Section id the form sends the reader to next. Up to 128 characters | Source: https://dev.appliflo.com/mcp/tools/set_form_rules --- # suggest_roles > Read who a document's form asks for (e.g. Tool of the AppliFlo MCP server at `https://appliflo.com/api/mcp`. Kind: read: it only looks, so clients can run it without asking. Read who a document's form asks for (e.g. Applicant, Migration agent, Witness): each role's label, kind and party type, found by rules from the form's own boxes and questions (no AI, free). Use it before set_envelope_recipients to know which recipients to add. Returns the document's saved Prepare state (recipients, routing, each box's owner and value, version; the same state the web Prepare page shows; a government ID number in a box shows only its last 3 characters, masked: true, and is sent in full), a box tally, and send: whether it is ready to send (else why not) and the web link to review it. When ready, send it with send_envelope and use_prepare_draft: true. ## Inputs | Name | Type | Required | Description | | --- | --- | --- | --- | | `document_id` | string | yes | The document's id (from upload_document, create_from_template or a document list) | Source: https://dev.appliflo.com/mcp/tools/suggest_roles --- # set_envelope_recipients > Set who a document goes to, in signing order: each recipient's role label (as the form names it, see suggest_roles), name, email and kind (signer fills and signs, filler fills only, cc gets a copy). Tool of the AppliFlo MCP server at `https://appliflo.com/api/mcp`. Kind: destructive: it emails people or cancels a send, so clients ask you first. Set who a document goes to, in signing order: each recipient's role label (as the form names it, see suggest_roles), name, email and kind (signer fills and signs, filler fills only, cc gets a copy). Give client_id to fill the name and email from a Clients record (a name or email you also give wins). It replaces the whole list; a recipient keeps their key (and the boxes given to them) when you pass the same key or label, and a recipient you leave out loses their boxes; a recipient who becomes a CC loses their boxes, and a filler their signature boxes (listed in cleared_boxes). The first client_id also becomes the document's client when it has none. Nobody can be marked as the sender here, and the role the person marked as their own ("That's me") stays as it is and can't be named. Nothing is emailed. Returns the document's saved Prepare state (recipients, routing, each box's owner and value, version; the same state the web Prepare page shows; a government ID number in a box shows only its last 3 characters, masked: true, and is sent in full), a box tally, and send: whether it is ready to send (else why not) and the web link to review it. When ready, send it with send_envelope and use_prepare_draft: true. ## Inputs | Name | Type | Required | Description | | --- | --- | --- | --- | | `document_id` | string | yes | The document's id (from upload_document, create_from_template or a document list) | | `recipients` | object[] | yes | 1 to 10 items | | `recipients[].key` | string | no | Keep an existing recipient's key (e.g. "r1"); new ones get one. Up to 64 characters | | `recipients[].label` | string | yes | The role, as the form names it ("Applicant"). Up to 120 characters | | `recipients[].name` | string | no | Up to 200 characters | | `recipients[].email` | string | no | Format: email. Up to 254 characters | | `recipients[].kind` | string | yes | One of: signer, filler, cc | | `recipients[].party_type` | string | no | One of: applicant, applicant_secondary, director, sponsor, employer, employee, agent, witness, guarantor, guardian, interpreter, other | | `recipients[].client_id` | string | no | A client from the workspace's Clients: their name and email fill in | | `routing` | string | no | sequential (in this order, the default) or parallel. One of: sequential, parallel | Source: https://dev.appliflo.com/mcp/tools/set_envelope_recipients --- # ai_assign > Let AI decide who fills each box that has no owner yet: one of the document's recipients, Skip, or a Fixed value, from the workspace's form memory, the team's habits, rules and then AI. Tool of the AppliFlo MCP server at `https://appliflo.com/api/mcp`. Kind: asks first: it changes something in your workspace, so clients ask you first. Let AI decide who fills each box that has no owner yet: one of the document's recipients, Skip, or a Fixed value, from the workspace's form memory, the team's habits, rules and then AI. Boxes that already have an owner keep it, and AI never gives a box to the sender. Set recipients first (set_envelope_recipients). Returns how many boxes it assigned, to_check (the less certain picks: show them to the user), whether AI was off, and run_id + applied: pass them to send_envelope as assign_run_id and assign_applied so the send teaches AI assign. Use set_box_owner or skip_box afterwards to change a pick. Returns the document's saved Prepare state (recipients, routing, each box's owner and value, version; the same state the web Prepare page shows; a government ID number in a box shows only its last 3 characters, masked: true, and is sent in full), a box tally, and send: whether it is ready to send (else why not) and the web link to review it. When ready, send it with send_envelope and use_prepare_draft: true. ## Inputs | Name | Type | Required | Description | | --- | --- | --- | --- | | `document_id` | string | yes | The document's id (from upload_document, create_from_template or a document list) | Source: https://dev.appliflo.com/mcp/tools/ai_assign --- # set_box_owner > Give boxes to one of the document's recipients (role_key from set_envelope_recipients), who fills them when they sign; or clear: true to take the owner off. Tool of the AppliFlo MCP server at `https://appliflo.com/api/mcp`. Kind: destructive: it emails people or cancels a send, so clients ask you first. Give boxes to one of the document's recipients (role_key from set_envelope_recipients), who fills them when they sign; or clear: true to take the owner off. A choice question moves as one. A signature box needs a signer; a CC can't own boxes. Never the sender: "You fill" and "You sign" are the person's own choice in the web app. To leave boxes blank use skip_box; for a value that goes in on every send use set_fixed_value; to let AI decide for every box use ai_assign. Returns the document's saved Prepare state (recipients, routing, each box's owner and value, version; the same state the web Prepare page shows; a government ID number in a box shows only its last 3 characters, masked: true, and is sent in full), a box tally, and send: whether it is ready to send (else why not) and the web link to review it. When ready, send it with send_envelope and use_prepare_draft: true. ## Inputs | Name | Type | Required | Description | | --- | --- | --- | --- | | `document_id` | string | yes | The document's id (from upload_document, create_from_template or a document list) | | `field_ids` | string[] | yes | Box ids from list_fields. A box that is an option of a choice question brings the whole question with it. 1 to 500 items | | `role_key` | string | no | The recipient's key ("r1") | | `clear` | boolean | no | true: the boxes have no owner again. One of: true | | `override_sender_choice` | boolean | no | true: also change boxes the person gave the sender (You fill / You sign). Only when the user asked for exactly that | Source: https://dev.appliflo.com/mcp/tools/set_box_owner --- # skip_box > Skip boxes: they are left blank and no recipient sees them (e.g. an office-use-only box, or a question that doesn't apply). Tool of the AppliFlo MCP server at `https://appliflo.com/api/mcp`. Kind: destructive: it emails people or cancels a send, so clients ask you first. Skip boxes: they are left blank and no recipient sees them (e.g. an office-use-only box, or a question that doesn't apply). A choice question is skipped as one; anything typed in the boxes is cleared. Undo with set_box_owner (clear: true or a role_key). Returns the document's saved Prepare state (recipients, routing, each box's owner and value, version; the same state the web Prepare page shows; a government ID number in a box shows only its last 3 characters, masked: true, and is sent in full), a box tally, and send: whether it is ready to send (else why not) and the web link to review it. When ready, send it with send_envelope and use_prepare_draft: true. ## Inputs | Name | Type | Required | Description | | --- | --- | --- | --- | | `document_id` | string | yes | The document's id (from upload_document, create_from_template or a document list) | | `field_ids` | string[] | yes | Box ids from list_fields. A box that is an option of a choice question brings the whole question with it. 1 to 500 items | | `override_sender_choice` | boolean | no | true: also change boxes the person gave the sender (You fill / You sign). Only when the user asked for exactly that | Source: https://dev.appliflo.com/mcp/tools/skip_box --- # set_fixed_value > Put a value in boxes on every send, filled in by you before it goes (Fixed). Tool of the AppliFlo MCP server at `https://appliflo.com/api/mcp`. Kind: destructive: it emails people or cancels a send, so clients ask you first. Put a value in boxes on every send, filled in by you before it goes (Fixed). The value must suit the boxes: a box people type into takes typed text, one of the business's details (scope workspace: legalName, tradingName, abn, address1, address2, phone, email, or custom.<name>) or the sending person's own (scope me: title, familyName, givenNames, marn, lpn, email, mobile), or a date (the day it is sent, a fixed YYYY-MM-DD day, or n days/weeks/months after or before sending); a lone tick box takes source tick; a choice question takes source option with the option label(s) ticked, its other options stay unticked. Not for signatures. locked: true stops the sender changing it on the Prepare page. For a value a recipient types instead, use set_box_owner. Returns the document's saved Prepare state (recipients, routing, each box's owner and value, version; the same state the web Prepare page shows; a government ID number in a box shows only its last 3 characters, masked: true, and is sent in full), a box tally, and send: whether it is ready to send (else why not) and the web link to review it. When ready, send it with send_envelope and use_prepare_draft: true. Masked values (•••123) can't be sent back: ask the person for the full number. ## Inputs | Name | Type | Required | Description | | --- | --- | --- | --- | | `document_id` | string | yes | The document's id (from upload_document, create_from_template or a document list) | | `field_ids` | string[] | yes | Box ids from list_fields. A box that is an option of a choice question brings the whole question with it. 1 to 500 items | | `value` | object | yes | One of: {source:"typed", text} \| {source:"tick", ticked} \| {source:"option", options:[label]} \| {source:"detail", scope:"workspace"\|"me", key} \| {source:"date", rule:{kind:"sent"} \| {kind:"fixed", day:"YYYY-MM-DD"} \| {kind:"relative", n, unit:"days"\|"weeks"\|"months", dir?:"after"\|"before"}} | | `value.source` | string | yes | One of: typed, tick, option, detail, date | | `value.text` | string | no | Up to 4000 characters | | `value.ticked` | boolean | no | | | `value.options` | string[] | no | 1 to 50 items | | `value.scope` | string | no | One of: workspace, me | | `value.key` | string | no | Up to 60 characters | | `value.rule` | object | no | | | `value.rule.kind` | string | yes | One of: sent, fixed, relative | | `value.rule.day` | string | no | kind fixed: YYYY-MM-DD | | `value.rule.n` | integer | no | 1 to 365 | | `value.rule.unit` | string | no | One of: days, weeks, months | | `value.rule.dir` | string | no | One of: after, before | | `locked` | boolean | no | true: the sender can't change it on the Prepare page (default false) | | `override_sender_choice` | boolean | no | true: also change boxes the person gave the sender (You fill / You sign). Only when the user asked for exactly that | Source: https://dev.appliflo.com/mcp/tools/set_fixed_value --- # search_clients > Find clients by name, email or phone. Tool of the AppliFlo MCP server at `https://appliflo.com/api/mcp`. Kind: read: it only looks, so clients can run it without asking. Find clients by name, email or phone. Returns the workspace's AppliFlo clients (id, name, email, phone, company, owner, open and completed document counts, CRM links) and, when include_crm is on (the default) and the query has at least 2 characters, matching people in the connected CRMs (GlobalyOS or Agentcis) under crm.results, each with a recordRef {sourceId, entity, recordId}. Use it first whenever the user names a client. A CRM person who is not yet an AppliFlo client can be added with create_client (pass crm_record to link it), or linked to an existing client with link_client_crm. Without a query it lists clients, most recently active first. Use get_client for one client's full record, custom fields included. ## Inputs | Name | Type | Required | Description | | --- | --- | --- | --- | | `query` | string | no | Name, email or phone to look for. Omit to list clients. Up to 100 characters | | `scope` | string | no | workspace (default): every client; mine: clients you own. One of: workspace, mine | | `status` | string[] | no | Only clients with open documents, all completed, or none | | `trash` | boolean | no | true: only clients in the Trash | | `sort` | string | no | One of: last_activity, name, created | | `page` | integer | no | At least 1 | | `limit` | integer | no | Clients per page, 1 to 50 (default 25). 1 to 50. Default: 25 | | `include_crm` | boolean | no | Also search the connected CRMs (default true). Members and up only | Source: https://dev.appliflo.com/mcp/tools/search_clients --- # get_client > One client's full record: name, email, phone, company, owner, notes, every custom field with this client's value (null when unset), document counts, and its CRM links (which GlobalyOS or Agentcis record it is linked to). Tool of the AppliFlo MCP server at `https://appliflo.com/api/mcp`. Kind: read: it only looks, so clients can run it without asking. One client's full record: name, email, phone, company, owner, notes, every custom field with this client's value (null when unset), document counts, and its CRM links (which GlobalyOS or Agentcis record it is linked to). Also returns url, the client's page in AppliFlo. A custom field holding a government ID number (passport, visa grant, tax file, social security, driver licence or Medicare number) comes back masked to its last 3 characters (masked: true); the full value stays in AppliFlo. Use search_clients to find the id. ## Inputs | Name | Type | Required | Description | | --- | --- | --- | --- | | `client_id` | string | yes | The client's id (from search_clients). Up to 64 characters | Source: https://dev.appliflo.com/mcp/tools/get_client --- # create_client > Add a client to the workspace. Tool of the AppliFlo MCP server at `https://appliflo.com/api/mcp`. Kind: asks first: it changes something in your workspace, so clients ask you first. Add a client to the workspace. Returns the new client as get_client does. The email must not belong to another live client (409: use search_clients and update that one instead). With no owner_user_id, you own it when you are a workspace member; a client made with an API key has no owner. fields sets custom values by field id (see list_client_fields). When the person comes from a CRM search hit, pass crm_record so the new client is linked to that GlobalyOS or Agentcis record. Past documents sent to the email join the client. Masked values (•••123) can't be sent back: ask the person for the full number. ## Inputs | Name | Type | Required | Description | | --- | --- | --- | --- | | `name` | string | yes | Up to 200 characters | | `email` | string \| null | no | Up to 254 characters | | `phone` | string \| null | no | Up to 40 characters | | `company_id` | string \| null | no | An existing company's id (from a client's company.id) | | `notes` | string | no | Up to 10000 characters | | `owner_user_id` | string \| null | no | A workspace member's user id; default you | | `fields` | object | no | Custom values by field id: { "<field id>": value } (types in list_client_fields) | | `crm_record` | object | no | The CRM record this client is made from | | `crm_record.source_id` | string | yes | recordRef.sourceId from search_clients' crm.results. Up to 200 characters | | `crm_record.entity` | string | yes | recordRef.entity. Up to 100 characters | | `crm_record.record_id` | string | yes | recordRef.recordId. Up to 200 characters | Source: https://dev.appliflo.com/mcp/tools/create_client --- # update_client > Change a client's own details: only the keys you pass change (null clears email, phone, company or owner). Tool of the AppliFlo MCP server at `https://appliflo.com/api/mcp`. Kind: destructive: it emails people or cancels a send, so clients ask you first. Change a client's own details: only the keys you pass change (null clears email, phone, company or owner). Returns the client as get_client does. Custom fields change with set_client_field; a client in the Trash must be restored in the app first. ## Inputs | Name | Type | Required | Description | | --- | --- | --- | --- | | `client_id` | string | yes | The client's id (from search_clients). Up to 64 characters | | `name` | string | no | Up to 200 characters | | `email` | string \| null | no | Up to 254 characters | | `phone` | string \| null | no | Up to 40 characters | | `company_id` | string \| null | no | | | `notes` | string | no | Up to 10000 characters | | `owner_user_id` | string \| null | no | A workspace member's user id | Source: https://dev.appliflo.com/mcp/tools/update_client --- # trash_client > Move a client to the Trash: hidden from lists and pickers, and its email is free for a new client. Tool of the AppliFlo MCP server at `https://appliflo.com/api/mcp`. Kind: destructive: it emails people or cancels a send, so clients ask you first. Move a client to the Trash: hidden from lists and pickers, and its email is free for a new client. Its documents are kept. It can be restored from the Trash in the app. A client already in the Trash is returned as is, with no confirm step. 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. ## Inputs | Name | Type | Required | Description | | --- | --- | --- | --- | | `client_id` | string | yes | The client's id (from search_clients). Up to 64 characters | | `confirm` | boolean | no | true to really do it. Without it nothing happens: you get an error describing what would happen, to show the user | Source: https://dev.appliflo.com/mcp/tools/trash_client --- # list_client_fields > The workspace's custom client fields, in order: id, label, type (short_text, paragraph, number, currency, phone, email, website, date, dropdown, multi_dropdown, yes_no), options (dropdowns) and currency. Tool of the AppliFlo MCP server at `https://appliflo.com/api/mcp`. Kind: read: it only looks, so clients can run it without asking. The workspace's custom client fields, in order: id, label, type (short_text, paragraph, number, currency, phone, email, website, date, dropdown, multi_dropdown, yes_no), options (dropdowns) and currency. Use the id with set_client_field or create_client's fields; get_client shows a client's values. ## Inputs This tool takes no inputs. Source: https://dev.appliflo.com/mcp/tools/list_client_fields --- # set_client_field > Set one custom field on a client ("" or null clears it). Tool of the AppliFlo MCP server at `https://appliflo.com/api/mcp`. Kind: destructive: it emails people or cancels a send, so clients ask you first. Set one custom field on a client ("" or null clears it). The value must fit the field's type: text for short_text/paragraph/phone/email/website, a number, a date as YYYY-MM-DD, one of the options for dropdown, an array of options for multi_dropdown, true/false for yes_no, and { amount, currency } for currency (422 otherwise). Returns the value as saved (a government ID number masked to its last 3 characters, masked: true; it is saved in full). Field ids come from list_client_fields. Masked values (•••123) can't be sent back: ask the person for the full number. ## Inputs | Name | Type | Required | Description | | --- | --- | --- | --- | | `client_id` | string | yes | The client's id (from search_clients). Up to 64 characters | | `field_id` | string | yes | Up to 64 characters | | `value` | any | yes | The new value; null or "" clears it | Source: https://dev.appliflo.com/mcp/tools/set_client_field --- # list_client_documents > The documents (PDFs and Docs) that belong to a client, newest first, as on the client's page: id, name, kind, status and status group (needs_you, drafts, waiting, completed, declined, expired, voided), owner, envelope id and a url to open it, plus counts per group. Tool of the AppliFlo MCP server at `https://appliflo.com/api/mcp`. Kind: read: it only looks, so clients can run it without asking. The documents (PDFs and Docs) that belong to a client, newest first, as on the client's page: id, name, kind, status and status group (needs_you, drafts, waiting, completed, declined, expired, voided), owner, envelope id and a url to open it, plus counts per group. Only documents you may see are listed. Filter by status to find what is still out (waiting) and chase it. include_files: true also returns the client's files (uploads such as a passport, signed PDFs sent to the client's email, and documents in its linked GlobalyOS record). For the whole workspace's documents use list_documents. ## Inputs | Name | Type | Required | Description | | --- | --- | --- | --- | | `client_id` | string | yes | The client's id (from search_clients). Up to 64 characters | | `status` | string[] | no | Only these status groups (expiring: expires soon) | | `page` | integer | no | At least 1 | | `limit` | integer | no | Documents per page, 1 to 50 (default 25). 1 to 50. Default: 25 | | `include_files` | boolean | no | Also list the client's files (default false) | Source: https://dev.appliflo.com/mcp/tools/list_client_documents --- # link_client_crm > Link a client to a record in a connected CRM (GlobalyOS or Agentcis), so forms can be prefilled from it and signed PDFs go back to it. Tool of the AppliFlo MCP server at `https://appliflo.com/api/mcp`. Kind: asks first: it changes something in your workspace, so clients ask you first. Link a client to a record in a connected CRM (GlobalyOS or Agentcis), so forms can be prefilled from it and signed PDFs go back to it. Take source_id, entity and record_id from a search_clients crm.results hit's recordRef. A client has at most one link per CRM, and a record links to one client (409 otherwise); 422 when that CRM isn't connected or has no such record. Linking the same record again returns the link unchanged. Returns the link (id, crm, label, url). ## Inputs | Name | Type | Required | Description | | --- | --- | --- | --- | | `client_id` | string | yes | The client's id (from search_clients). Up to 64 characters | | `source_id` | string | yes | recordRef.sourceId from search_clients' crm.results. Up to 200 characters | | `entity` | string | yes | recordRef.entity. Up to 100 characters | | `record_id` | string | yes | recordRef.recordId. Up to 200 characters | Source: https://dev.appliflo.com/mcp/tools/link_client_crm --- # save_library_as_template > Keep an AppliFlo library contract or official government form (a "lib_..." template_id from list_templates) as one of the workspace's OWN saved templates, as the app's Templates page does, so the workspace can edit its roles, settings and boxes. Tool of the AppliFlo MCP server at `https://appliflo.com/api/mcp`. Kind: asks first: it changes something in your workspace, so clients ask you first. Keep an AppliFlo library contract or official government form (a "lib_..." template_id from list_templates) as one of the workspace's OWN saved templates, as the app's Templates page does, so the workspace can edit its roles, settings and boxes. Only needed for that: to use a library item or form as it is, call create_from_template or send_template with its lib_ id directly. An item AppliFlo has set up (status ready) is copied by an owner or admin as a Ready template (mode copied), with its roles and boxes; a form's one-time set-up (business details, "Who sends this?") can then be given in the app or with update_template_settings. An official form AppliFlo hasn't set up (status draft), or any official form when a member saves it, is saved from the form's own fillable fields as a Draft template (mode saved_from_form, with `roles` if given) that an owner or admin sets up and finalises (set_template_roles, finalise_template). A member can't copy an AppliFlo contract (403). Returns `template` in get_template's shape (kind saved). 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. ## Inputs | Name | Type | Required | Description | | --- | --- | --- | --- | | `template_id` | string | yes | A library or official template_id ("lib_...") from list_templates. Up to 64 characters | | `name` | string | no | The new template's name. Defaults to the item's title or the form's label. Up to 120 characters | | `roles` | string[] | no | Saved from the form's fields only (mode saved_from_form): role names in signing order, e.g. ["Client", "Agent"]. A copy keeps AppliFlo's roles. Up to 4 items | | `risk_accepted` | boolean | no | 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 | Source: https://dev.appliflo.com/mcp/tools/save_library_as_template --- # save_as_template > Keep a DRAFT document (one not sent yet, with its fields detected or placed) as one of the workspace's saved templates, like the app's "Save as template": its PDF, fields, choice questions and form rules are copied; the document itself is untouched. Tool of the AppliFlo MCP server at `https://appliflo.com/api/mcp`. Kind: asks first: it changes something in your workspace, so clients ask you first. Keep a DRAFT document (one not sent yet, with its fields detected or placed) as one of the workspace's saved templates, like the app's "Save as template": its PDF, fields, choice questions and form rules are copied; the document itself is untouched. `roles` names the people who fill it ("Client", "Agent"; up to 4); without it, one role per recipient the fields are assigned to, else a default. The template starts as a Draft: an owner or admin sets it up (set_template_roles, update_template_settings; box owners in the app's builder) and finalises it (finalise_template) before send_template can use it (create_from_template works on a Draft). Returns saved_template in get_template's shape. To keep an AppliFlo library contract or official form instead, use save_library_as_template. ## Inputs | Name | Type | Required | Description | | --- | --- | --- | --- | | `document_id` | string | yes | The draft document's document_id. Up to 64 characters | | `name` | string | no | Defaults to the document's name. Up to 120 characters | | `roles` | string[] | no | Role names in signing order, e.g. ["Client", "Agent"]. Up to 4 items | Source: https://dev.appliflo.com/mcp/tools/save_as_template --- # list_template_versions > A saved template's finalised versions, newest first: version, current, note, field_count, envelope_count (how many envelopes each sent) and created_at. Tool of the AppliFlo MCP server at `https://appliflo.com/api/mcp`. Kind: read: it only looks, so clients can run it without asking. A saved template's finalised versions, newest first: version, current, note, field_count, envelope_count (how many envelopes each sent) and created_at. A Draft never finalised has none. Every send uses the current version; envelopes already sent keep theirs. Read one in full with get_template_version. ## Inputs | Name | Type | Required | Description | | --- | --- | --- | --- | | `template_id` | string | yes | A saved template's template_id from list_templates (kind saved). Up to 64 characters | Source: https://dev.appliflo.com/mcp/tools/list_template_versions --- # get_template_version > One finalised version of a saved template (default: the current one): its roles in signing order, the boxes the sender fills (sender_fields, the prefill keys), the boxes it fills itself (fixed_fields) and the send settings every envelope from it gets (routing, subject, message, cc, expiry_days). Tool of the AppliFlo MCP server at `https://appliflo.com/api/mcp`. Kind: read: it only looks, so clients can run it without asking. One finalised version of a saved template (default: the current one): its roles in signing order, the boxes the sender fills (sender_fields, the prefill keys), the boxes it fills itself (fixed_fields) and the send settings every envelope from it gets (routing, subject, message, cc, expiry_days). Versions never change once finalised. Use list_template_versions for the numbers; get_template for the template as a whole. ## Inputs | Name | Type | Required | Description | | --- | --- | --- | --- | | `template_id` | string | yes | A saved template's template_id from list_templates (kind saved). Up to 64 characters | | `version` | integer | no | versions[].version from list_template_versions. Defaults to the current version. 1 to 100000 | Source: https://dev.appliflo.com/mcp/tools/get_template_version --- # update_template_settings > Change a saved template's send settings, as the builder's Settings step: only the settings you pass change. routing (sequential = one role after another, parallel = everyone at once), subject and message (may use {{placeholders}} such as {{Recipient 1 name}}, {{Template name}}, {{Workspace}}), reminder_cadence, expiry_days (null = links never expire), warn_before_expiry, cc (replaces the fixed copies), sender_role ("Who sends this?": a role key from the template's roles, always the person sending; null = none of them; only the person's own choice, never guess it). Tool of the AppliFlo MCP server at `https://appliflo.com/api/mcp`. Kind: destructive: it emails people or cancels a send, so clients ask you first. Change a saved template's send settings, as the builder's Settings step: only the settings you pass change. routing (sequential = one role after another, parallel = everyone at once), subject and message (may use {{placeholders}} such as {{Recipient 1 name}}, {{Template name}}, {{Workspace}}), reminder_cadence, expiry_days (null = links never expire), warn_before_expiry, cc (replaces the fixed copies), sender_role ("Who sends this?": a role key from the template's roles, always the person sending; null = none of them; only the person's own choice, never guess it). It changes the template's DRAFT of its next version (what the app's builder shows): sends keep using the current version until the draft is finalised (finalise_template, with expected_base_version = current_version from this result; `issues` with severity blocking must be fixed first). Owners and admins only (403 otherwise). Returns the draft's roles, settings and remaining issues. ## Inputs | Name | Type | Required | Description | | --- | --- | --- | --- | | `template_id` | string | yes | A saved template's template_id from list_templates (kind saved). Up to 64 characters | | `routing` | string | no | One of: sequential, parallel | | `subject` | string | no | Up to 400 characters | | `message` | string | no | Up to 4000 characters | | `reminder_cadence` | string | no | daily, 3d (every 3 days), 7d (every week) or off. One of: daily, 3d, 7d, off | | `expiry_days` | integer \| null | no | Days after sending the links stop working; null = never. 1 to 365 | | `warn_before_expiry` | boolean | no | Email recipients before their link expires | | `cc` | object[] | no | Who always gets a copy (copy only, never fills). Replaces the current list. Up to 20 items | | `cc[].email` | string | yes | Up to 254 characters | | `cc[].name` | string | no | Up to 120 characters | | `sender_role` | string \| null | no | A role key, or null for none of them | Source: https://dev.appliflo.com/mcp/tools/update_template_settings --- # set_template_roles > Replace a saved template's roles (the people who fill and sign it), in signing order, as the builder's Recipients step: 1 to 10. Tool of the AppliFlo MCP server at `https://appliflo.com/api/mcp`. Kind: destructive: it emails people or cancels a send, so clients ask you first. Replace a saved template's roles (the people who fill and sign it), in signing order, as the builder's Recipients step: 1 to 10. A role passed with its existing key is kept (its boxes stay its own); one without a key is new and gets a fresh key; a role left out is removed and its boxes lose their owner (assign them in the app's builder before finalising). Read the current roles with get_template first. It changes the template's DRAFT of its next version (what the app's builder shows): sends keep using the current version until the draft is finalised (finalise_template, with expected_base_version = current_version from this result; `issues` with severity blocking must be fixed first). Owners and admins only (403 otherwise). Returns the draft's roles, settings and remaining issues. ## Inputs | Name | Type | Required | Description | | --- | --- | --- | --- | | `template_id` | string | yes | A saved template's template_id from list_templates (kind saved). Up to 64 characters | | `roles` | object[] | yes | Every role, in signing order. 1 to 10 items | | `roles[].key` | string | no | An existing role's key to keep it (its boxes stay its own). Leave out for a new role | | `roles[].label` | string | yes | The role's name, e.g. Client. Each must differ. Up to 60 characters | | `roles[].kind` | string | yes | signer = fills and signs; filler = fills only. One of: signer, filler | | `roles[].colour` | string | no | Defaults to the role's own colour, or the first colour no other role uses. One of: blue, green, violet, teal, rose | | `roles[].party_type` | string | no | What the party is (a tag beside the name). Defaults to the role's own, or one its name suggests. One of: applicant, applicant_secondary, director, sponsor, employer, employee, agent, witness, guarantor, guardian, interpreter, other | | `roles[].crm_source` | string \| null | no | The CRM this role's contact is picked from at send; null = typed at send; leave out to keep it | Source: https://dev.appliflo.com/mcp/tools/set_template_roles --- # finalise_template > Finalise a saved template's draft as its next version, as the builder's Finalise: the draft's boxes, roles and settings become an unchangeable version with its own PDF copy, the template is Ready, and every send from now on uses it (envelopes already sent keep their version). Tool of the AppliFlo MCP server at `https://appliflo.com/api/mcp`. Kind: destructive: it emails people or cancels a send, so clients ask you first. Finalise a saved template's draft as its next version, as the builder's Finalise: the draft's boxes, roles and settings become an unchangeable version with its own PDF copy, the template is Ready, and every send from now on uses it (envelopes already sent keep their version). Pass expected_base_version = the current_version that update_template_settings or set_template_roles returned (null for a template never finalised): if someone else finalised meanwhile it is refused (409 version_conflict). A draft with blocking checklist issues (e.g. a box with no owner) is refused (422 not_ready, issues listed: fix them in the app's builder). A template with no draft open (e.g. straight after save_as_template) gets one first, as the builder's Set up does. Owners and admins only. Returns the new version in get_template_version's shape. ## Inputs | Name | Type | Required | Description | | --- | --- | --- | --- | | `template_id` | string | yes | A saved template's template_id from list_templates (kind saved). Up to 64 characters | | `expected_base_version` | integer \| null | yes | The template's current version before this finalise (current_version); null when it has none yet. At least 1 | | `note` | string \| null | no | What changed, shown in the version history. Up to 2000 characters | Source: https://dev.appliflo.com/mcp/tools/finalise_template --- # retry_failed_rows > Send the failed rows of a send_template_bulk batch again, as the app's "Retry failed": each goes back in the queue with fresh attempts and is sent in the background (poll get_bulk_batch). Tool of the AppliFlo MCP server at `https://appliflo.com/api/mcp`. Kind: destructive: it emails people or cancels a send, so clients ask you first. Send the failed rows of a send_template_bulk batch again, as the app's "Retry failed": each goes back in the queue with fresh attempts and is sent in the background (poll get_bulk_batch). Pass `row` to retry just that one. A row marked needs_fix (the email provider refused it or it bounced) is left out: retrying as is can't help, so change it with fix_bulk_row instead (asking for that row alone is refused, 409 needs_fix). Safe to repeat: a row already queued or sent is never touched and no envelope is sent twice. With nothing to retry it does nothing and says so (requeued: 0). This emails real people. 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. ## Inputs | Name | Type | Required | Description | | --- | --- | --- | --- | | `batch_id` | string | yes | batch_id from send_template_bulk. Up to 64 characters | | `row` | integer | no | Only this row (the number get_bulk_batch reports). Default: every failed row. 1 to 100000 | | `confirm` | boolean | no | true to really do it. Without it nothing happens: you get an error describing what would happen, to show the user | Source: https://dev.appliflo.com/mcp/tools/retry_failed_rows --- # list_activity > The Activities feed, as the web app's Activities page shows it: what happened to documents, Docs, templates and clients, newest first, each with a plain label ("Signed", "Moved to Trash"…), who did it and a link. scope 'mine' (default: things the caller created, sent or was sent, and their own actions; for an API key, what the key itself did) or 'workspace' (owners and admins only, so not an API key, which acts as a member). Tool of the AppliFlo MCP server at `https://appliflo.com/api/mcp`. Kind: read: it only looks, so clients can run it without asking. The Activities feed, as the web app's Activities page shows it: what happened to documents, Docs, templates and clients, newest first, each with a plain label ("Signed", "Moved to Trash"…), who did it and a link. scope 'mine' (default: things the caller created, sent or was sent, and their own actions; for an API key, what the key itself did) or 'workspace' (owners and admins only, so not an API key, which acts as a member). Filter by event type (one or more), from/to (ISO dates), person (a user id), client (a client id) and q (document name). Pages of up to 50 (default 25). Returns { items, total }. Use get_document for one document's own signing trail, list_audit_log for the owner/admin audit log. ## Inputs | Name | Type | Required | Description | | --- | --- | --- | --- | | `scope` | string | no | One of: mine, workspace | | `type` | string[] | no | | | `from` | string | no | Format: date-time | | `to` | string | no | Format: date-time | | `person` | string | no | A user id: only their actions | | `client` | string | no | A client id: only events about that client and its documents | | `q` | string | no | Matches the document's name. Up to 200 characters | | `page` | integer | no | At least 1 | | `limit` | integer | no | 1 to 50 | Source: https://dev.appliflo.com/mcp/tools/list_activity --- # list_audit_log > The workspace audit log (Settings → Activity on the web): every colleague's actions and every envelope event in the workspace, newest first. Tool of the AppliFlo MCP server at `https://appliflo.com/api/mcp`. Kind: read: it only looks, so clients can run it without asking. The workspace audit log (Settings → Activity on the web): every colleague's actions and every envelope event in the workspace, newest first. Owners and admins only (anyone else is refused, 403). Filter by one event type and a from/to range (ISO dates); page with limit (up to 100, default 50) and offset. Returns { items (id, at, type, label, actor, envelope_id, document_id, subject), total }. For a person's own feed use list_activity. ## Inputs | Name | Type | Required | Description | | --- | --- | --- | --- | | `type` | string | no | One of: created, sent, viewed, consented, filled, signed, sealing, sealed, seal_failed, declined, expired, voided, reminded, downloaded, sender_adopted_signature, email_not_sent, email_skipped_sandbox, waiting_embedded, document_trashed, document_restored, document_deleted, document_purged, document_renamed, document_shared, doc_created, doc_shared, doc_version_restored, doc_trashed, doc_restored, doc_sent, doc_defaults_saved, doc_purged, doc_saved_as_template, doc_clause_updated, doc_owners_saved, bulk_send_started, bulk_send_paused, bulk_send_resumed, bulk_send_cancelled, bulk_send_row_failed, bulk_send_completed, template_version_used, bounced, mcp_tool_called, mcp_tool_refused | | `from` | string | no | Format: date-time | | `to` | string | no | Format: date-time | | `limit` | integer | no | 1 to 100 | | `offset` | integer | no | At least 0 | Source: https://dev.appliflo.com/mcp/tools/list_audit_log --- # get_usage > This period's plan usage, as Settings → Usage shows it: the plan, seats, when the period started and resets, and AI pages (the pages AI reads to find a form's boxes): used, limit (with granted and purchased extras), remaining, whether they ran out, and the caller's own use (an API key's is its creator's). Tool of the AppliFlo MCP server at `https://appliflo.com/api/mcp`. Kind: read: it only looks, so clients can run it without asking. This period's plan usage, as Settings → Usage shows it: the plan, seats, when the period started and resets, and AI pages (the pages AI reads to find a form's boxes): used, limit (with granted and purchased extras), remaining, whether they ran out, and the caller's own use (an API key's is its creator's). Owners and admins also get each member's use. Buying more pages is done in the web app. Use it before a large detect or fill to check what is left. ## Inputs This tool takes no inputs. Source: https://dev.appliflo.com/mcp/tools/get_usage --- # list_docs > The Docs the caller can see (AppliFlo's own documents written in the editor: contracts, letters; not uploaded PDFs), newest edit first, as the app's Docs list shows them: doc_id, title, status (draft, ready, sent, archived), revision, visibility, mine, created_by_name, editing_by (someone else has it open), can_edit, and for a sent Doc envelope_id and pdf_document_id (the rendered PDF the PDF and envelope tools take). Tool of the AppliFlo MCP server at `https://appliflo.com/api/mcp`. Kind: read: it only looks, so clients can run it without asking. The Docs the caller can see (AppliFlo's own documents written in the editor: contracts, letters; not uploaded PDFs), newest edit first, as the app's Docs list shows them: doc_id, title, status (draft, ready, sent, archived), revision, visibility, mine, created_by_name, editing_by (someone else has it open), can_edit, and for a sent Doc envelope_id and pdf_document_id (the rendered PDF the PDF and envelope tools take). Filter by status, mine or a words-in-title query. No content: read one with get_doc. list_documents shows PDFs and Docs together, and the Trash. ## Inputs | Name | Type | Required | Description | | --- | --- | --- | --- | | `status` | string | no | One of: draft, ready, sent, archived | | `mine` | boolean | no | true: only Docs the caller created | | `query` | string | no | Words that must all appear in the title (any case). Up to 200 characters | | `limit` | integer | no | Default 50. 1 to 200 | Source: https://dev.appliflo.com/mcp/tools/list_docs --- # get_doc > One Doc in full: title, status, revision (pass it to update_doc and send_doc), visibility, page_size, roles (the people it is for, in signing order; their keys are send_doc's people keys), signing_order, can_edit, can_share, editing_by, where it came from (contract_template_id, ai_drafted), and for a sent Doc envelope_id and pdf_document_id. Tool of the AppliFlo MCP server at `https://appliflo.com/api/mcp`. Kind: read: it only looks, so clients can run it without asking. One Doc in full: title, status, revision (pass it to update_doc and send_doc), visibility, page_size, roles (the people it is for, in signing order; their keys are send_doc's people keys), signing_order, can_edit, can_share, editing_by, where it came from (contract_template_id, ai_drafted), and for a sent Doc envelope_id and pdf_document_id. The content comes as `markdown` (default; boxes and signatures as tokens, variables as {{key}}) or, with format: "json", as the editor's TipTap JSON `content` (exact: box ids, fixed values, formatting Markdown can't hold). Markdown here is AppliFlo's doc format: # / ## / ### headings, paragraphs, - and 1. lists, > quotes, --- dividers, **bold** and *italic*, plus tokens: {{client.full_name}} (a variable filled from the CRM at send), [[box role=client kind=text label="Passport number"]] (a box a person fills; kind text, date, number, email, phone, checkbox, dropdown with options="A|B", initials), [[signature role=client]] (a signature block) and [[pagebreak]]. role is a role's name (as get_doc lists them) or key. ## Inputs | Name | Type | Required | Description | | --- | --- | --- | --- | | `doc_id` | string | yes | A Doc's doc_id (from list_docs, or list_documents' kind 'doc' rows). Up to 80 characters | | `format` | string | no | markdown (default) or json (the TipTap document). One of: markdown, json | Source: https://dev.appliflo.com/mcp/tools/get_doc --- # create_doc > Start a new Doc (a contract or letter written in AppliFlo), private to the caller, as a draft. Tool of the AppliFlo MCP server at `https://appliflo.com/api/mcp`. Kind: asks first: it changes something in your workspace, so clients ask you first. Start a new Doc (a contract or letter written in AppliFlo), private to the caller, as a draft. Start it blank, from `markdown` or the editor's TipTap JSON `content`, from one of AppliFlo's contract templates (contract_template_id) or from a doc template the workspace saved (doc_template_id, as the app's Use). `roles` names the people it is for ({label, kind: signer|cc}, in signing order; default Client and Agent, both signing); Markdown tokens name them. Returns the doc with doc_id and revision 0, and markdown_issues listing any token that couldn't be read (left in the text as typed). Docs are a person's tool: an API key can't create one. 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 contract template.) Markdown here is AppliFlo's doc format: # / ## / ### headings, paragraphs, - and 1. lists, > quotes, --- dividers, **bold** and *italic*, plus tokens: {{client.full_name}} (a variable filled from the CRM at send), [[box role=client kind=text label="Passport number"]] (a box a person fills; kind text, date, number, email, phone, checkbox, dropdown with options="A|B", initials), [[signature role=client]] (a signature block) and [[pagebreak]]. role is a role's name (as get_doc lists them) or key. Masked values (•••123) can't be sent back: ask the person for the full number. ## Inputs | Name | Type | Required | Description | | --- | --- | --- | --- | | `title` | string | no | Defaults to "Untitled doc" (or the template's title). Up to 200 characters | | `markdown` | string | no | The content as Markdown with AppliFlo's tokens. Up to 400000 characters | | `content` | object | no | The content as TipTap JSON ({type: "doc", content: [...]}), as get_doc format json returns it | | `contract_template_id` | string | no | One of AppliFlo's contract templates (list_templates kind contract), converted into a Doc. Up to 80 characters | | `doc_template_id` | string | no | A doc template saved with save_doc_as_template: its current version. Up to 80 characters | | `roles` | object[] | no | The people it is for, in signing order; kind signer (signs) or cc (gets a copy). 1 to 10 items | | `roles[].label` | string | yes | Up to 60 characters | | `roles[].kind` | string | yes | One of: signer, cc | | `risk_accepted` | boolean | no | 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 | Source: https://dev.appliflo.com/mcp/tools/create_doc --- # update_doc > Change a draft or ready Doc, as the editor saves it: the title and/or the whole content (as `markdown`, or the TipTap JSON `content` from get_doc format json), at the `revision` you last read (get_doc). Tool of the AppliFlo MCP server at `https://appliflo.com/api/mcp`. Kind: destructive: it emails people or cancels a send, so clients ask you first. Change a draft or ready Doc, as the editor saves it: the title and/or the whole content (as `markdown`, or the TipTap JSON `content` from get_doc format json), at the `revision` you last read (get_doc). If anyone saved since, nothing is saved: 409 revision_conflict with the current revision; read it again and redo the change. While someone else has the doc open in the editor it is 423 locked. Markdown replaces the whole content and gives boxes new ids (their fixed values and owners set in the app are lost): for a small change to a doc with set-up boxes, edit the JSON instead. Also, for the creator or an owner/admin: status (draft or ready; sending marks it sent), visibility (private, workspace_view, workspace_edit) and page_size (a4, letter); these need no revision. A sent Doc can't change (409 read_only): duplicate_doc it. Returns the new revision. Markdown here is AppliFlo's doc format: # / ## / ### headings, paragraphs, - and 1. lists, > quotes, --- dividers, **bold** and *italic*, plus tokens: {{client.full_name}} (a variable filled from the CRM at send), [[box role=client kind=text label="Passport number"]] (a box a person fills; kind text, date, number, email, phone, checkbox, dropdown with options="A|B", initials), [[signature role=client]] (a signature block) and [[pagebreak]]. role is a role's name (as get_doc lists them) or key. Masked values (•••123) can't be sent back: ask the person for the full number. ## Inputs | Name | Type | Required | Description | | --- | --- | --- | --- | | `doc_id` | string | yes | A Doc's doc_id (from list_docs, or list_documents' kind 'doc' rows). Up to 80 characters | | `revision` | integer | no | The revision get_doc returned. Needed with title, markdown or content. At least 0 | | `title` | string | no | Up to 200 characters | | `markdown` | string | no | The new content as Markdown (replaces it all). Up to 400000 characters | | `content` | object | no | The new content as TipTap JSON (replaces it all) | | `status` | string | no | One of: draft, ready | | `visibility` | string | no | private (default), workspace_view or workspace_edit. One of: private, workspace_view, workspace_edit | | `page_size` | string | no | One of: a4, letter | Source: https://dev.appliflo.com/mcp/tools/update_doc --- # list_doc_versions > A Doc's saved versions, newest first, without content: number, reason (manual: someone saved a version; auto: kept after 30 minutes of editing; send: what went out for signing; restore), note, title, created_at and created_by_name. Tool of the AppliFlo MCP server at `https://appliflo.com/api/mcp`. Kind: read: it only looks, so clients can run it without asking. A Doc's saved versions, newest first, without content: number, reason (manual: someone saved a version; auto: kept after 30 minutes of editing; send: what went out for signing; restore), note, title, created_at and created_by_name. Restoring one is done in the app's History. ## Inputs | Name | Type | Required | Description | | --- | --- | --- | --- | | `doc_id` | string | yes | A Doc's doc_id (from list_docs, or list_documents' kind 'doc' rows). Up to 80 characters | Source: https://dev.appliflo.com/mcp/tools/list_doc_versions --- # duplicate_doc > Copy a Doc the caller can see into a new private draft they own ("<title> (copy)"), with its content, roles, signing order and page size; comments stay on the original. Tool of the AppliFlo MCP server at `https://appliflo.com/api/mcp`. Kind: asks first: it changes something in your workspace, so clients ask you first. Copy a Doc the caller can see into a new private draft they own ("<title> (copy)"), with its content, roles, signing order and page size; comments stay on the original. The way to change a sent Doc. Returns the new doc (doc_id, revision 0). ## Inputs | Name | Type | Required | Description | | --- | --- | --- | --- | | `doc_id` | string | yes | A Doc's doc_id (from list_docs, or list_documents' kind 'doc' rows). Up to 80 characters | Source: https://dev.appliflo.com/mcp/tools/duplicate_doc --- # 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. Tool of the AppliFlo MCP server at `https://appliflo.com/api/mcp`. Kind: destructive: it emails people or cancels a send, so clients ask you first. 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). ## Inputs | Name | Type | Required | Description | | --- | --- | --- | --- | | `doc_id` | string | yes | A Doc's doc_id (from list_docs, or list_documents' kind 'doc' rows). Up to 80 characters | | `revision` | integer | yes | get_doc's revision: what you checked is what is sent (409 otherwise). At least 0 | | `people` | map of object | yes | One person per role key (get_doc roles[].key, e.g. r1) | | `cc` | object[] | no | Extra people who get a copy. Up to 10 items | | `cc[].email` | string | yes | | | `cc[].name` | string | no | | | `subject` | string | no | The email subject. Defaults to the doc's title. Up to 200 characters | | `message` | string | no | Up to 2000 characters | | `reminder` | string | no | Reminder emails: off, daily, 3d or 7d. One of: off, daily, 3d, 7d | | `expiry_days` | integer \| null | no | Days until the links stop working; null: never. 1 to 365 | | `typed` | map of string | no | Values for variables, by key (e.g. {"matter.fee_total": "4950"}) | | `sender_fills` | map of string | no | The sender's text for boxes they fill, by box id (from get_doc format json) | | `local_day` | string | no | The sender's own date today (YYYY-MM-DD) | | `adopt_signature` | boolean | no | The sender adopts their saved signature for the Doc's sender signature. Ask them first | | `client_id` | string \| null | no | The client (list_clients) the Doc, its envelope and its PDF go on | | `risk_accepted` | boolean | no | 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` | string | no | From the unconfirmed call's structuredContent: what the user reviewed | | `confirm` | boolean | no | true to really do it. Without it nothing happens: you get an error describing what would happen, to show the user | Source: https://dev.appliflo.com/mcp/tools/send_doc --- # save_doc_as_template > Keep a Doc as one of the workspace's doc templates, as the app's "Save as template": its content, roles and settings (not a PDF). Tool of the AppliFlo MCP server at `https://appliflo.com/api/mcp`. Kind: asks first: it changes something in your workspace, so clients ask you first. Keep a Doc as one of the workspace's doc templates, as the app's "Save as template": its content, roles and settings (not a PDF). A new template named `name` (default: the doc's title), or with template_id, a new version of a doc template saved from this doc before (owners and admins only). create_doc with doc_template_id starts a Doc from it. Returns template_id, name, version and created. For an uploaded PDF use save_as_template. ## Inputs | Name | Type | Required | Description | | --- | --- | --- | --- | | `doc_id` | string | yes | A Doc's doc_id (from list_docs, or list_documents' kind 'doc' rows). Up to 80 characters | | `name` | string | no | The new template's name. Defaults to the doc's title. Up to 120 characters | | `template_id` | string | no | Save as the next version of this doc template instead. Up to 80 characters | Source: https://dev.appliflo.com/mcp/tools/save_doc_as_template --- # docs_ai_draft > Draft a new Doc (a contract, letter or agreement) with AppliFlo's AI from a short brief, as Docs → New → Draft with AI does. Tool of the AppliFlo MCP server at `https://appliflo.com/api/mcp`. Kind: asks first: it changes something in your workspace, so clients ask you first. Draft a new Doc (a contract, letter or agreement) with AppliFlo's AI from a short brief, as Docs → New → Draft with AI does. Makes a new private Doc marked as an AI draft, writes the whole draft into it and names it (unless you give a title). Returns doc_id, title, revision, the section headings, and checks (facts the AI added that weren't in the brief, unknown variables, a cut-off answer): tell the person to check those. Spends the workspace's monthly AI writing allowance (Free: 3 drafts a month) and is refused like the app with ai_disabled, ai_plan, ai_rate_limited or ai_budget_reached. Sending an AI-drafted Doc later asks the person to accept the own-risk terms. To add to an existing Doc use docs_ai_continue; for a library clause use insert_clause. ## Inputs | Name | Type | Required | Description | | --- | --- | --- | --- | | `brief` | string | yes | What the Doc is, in the person's words, with the facts they gave (parties, fees, dates). Up to 4000 characters | | `title` | string | no | The Doc's title. Leave out to use the draft's own title. Up to 200 characters | | `doc_type` | string | no | The kind of document, e.g. "Engagement letter". Up to 80 characters | | `tone` | string | no | plain, formal or short. One of: plain, formal, short | | `jurisdiction` | string | no | Whose law it is written for. Leave out for the workspace's setting. One of: Australia, New Zealand, United Kingdom, Ireland, Canada, United States, Singapore, India | | `roles` | object[] | no | Who signs or gets a copy, in order (default: the app's default roles). The draft puts a signature for each signer. 1 to 10 items | | `roles[].label` | string | yes | e.g. Client, Agent. Up to 60 characters | | `roles[].kind` | string | yes | One of: signer, cc | Source: https://dev.appliflo.com/mcp/tools/docs_ai_draft --- # docs_ai_continue > Write more of an existing Doc with AppliFlo's AI and put it in the Doc, as the editor's Continue writing and Write a clause do. kind continue (default): a paragraph or two following on from the text before the place; kind clause: one new clause or section with its own numbered heading in the style of the rest (instruction required, e.g. Tool of the AppliFlo MCP server at `https://appliflo.com/api/mcp`. Kind: asks first: it changes something in your workspace, so clients ask you first. Write more of an existing Doc with AppliFlo's AI and put it in the Doc, as the editor's Continue writing and Write a clause do. kind continue (default): a paragraph or two following on from the text before the place; kind clause: one new clause or section with its own numbered heading in the style of the rest (instruction required, e.g. "a refund clause, 14 days"). Saves the Doc and returns its new revision, the text written and checks to tell the person about. Spends the workspace's AI writing allowance (Starter and Business plans); refused like the app (ai_disabled, ai_plan, ai_rate_limited, ai_budget_reached). For a clause from the workspace's library use insert_clause; to change existing text use docs_ai_rewrite. ## Inputs | Name | Type | Required | Description | | --- | --- | --- | --- | | `doc_id` | string | yes | The Doc's id (from list_docs or get_doc). Up to 80 characters | | `kind` | string | no | continue (default) or clause. One of: continue, clause | | `instruction` | string | no | What to write, in the person's words. Required (3+ characters) for kind clause. Up to 1000 characters | | `after` | string | no | Put it after the block with this text, copied from the Doc (a heading like "4. Fees" means after its whole section). Leave out for the end of the Doc. Up to 200 characters | | `revision` | integer | no | The Doc's revision as you last read it (get_doc). Checked before any AI is spent: if the Doc has changed since, you get 409 revision_conflict with the current revision and nothing is spent or written. The tool holds the Doc's edit lock from that check until it has saved, so nobody can change it in between. Leave out to work on the Doc as it is now. At least 0 | Source: https://dev.appliflo.com/mcp/tools/docs_ai_continue --- # docs_ai_rewrite > Rewrite part of a Doc with AppliFlo's AI and replace it in the Doc, as selecting text and choosing Rewrite in the editor does. text is the exact words to rewrite, copied from the Doc as get_doc shows it (may span paragraphs); mode plainer, firmer, shorter, longer or grammar, or custom with an instruction. Tool of the AppliFlo MCP server at `https://appliflo.com/api/mcp`. Kind: destructive: it emails people or cancels a send, so clients ask you first. Rewrite part of a Doc with AppliFlo's AI and replace it in the Doc, as selecting text and choosing Rewrite in the editor does. text is the exact words to rewrite, copied from the Doc as get_doc shows it (may span paragraphs); mode plainer, firmer, shorter, longer or grammar, or custom with an instruction. Variables, fill-in boxes and signatures in it keep their settings. Saves the Doc and returns its new revision, the new text and checks. Spends the workspace's AI writing allowance (Starter and Business plans); refused like the app (ai_disabled, ai_plan, ai_rate_limited, ai_budget_reached). To only explain text use docs_ai_explain; to find what needs fixing use docs_ai_review. ## Inputs | Name | Type | Required | Description | | --- | --- | --- | --- | | `doc_id` | string | yes | The Doc's id (from list_docs or get_doc). Up to 80 characters | | `text` | string | yes | The exact text to rewrite, copied from the Doc (a review finding's text works). Up to 12000 characters | | `mode` | string | yes | How to rewrite it; custom needs an instruction. One of: plainer, firmer, shorter, longer, grammar, custom | | `instruction` | string | no | For custom: how to rewrite it, in the person's words (or a review finding's fix). Up to 1000 characters | | `revision` | integer | no | The Doc's revision as you last read it (get_doc). Checked before any AI is spent: if the Doc has changed since, you get 409 revision_conflict with the current revision and nothing is spent or written. The tool holds the Doc's edit lock from that check until it has saved, so nobody can change it in between. Leave out to work on the Doc as it is now. At least 0 | Source: https://dev.appliflo.com/mcp/tools/docs_ai_rewrite --- # docs_ai_explain > Explain a Doc (find it with list_docs, read it with get_doc), or part of it, in plain English for someone who isn't a lawyer, as Explain in the editor does. Tool of the AppliFlo MCP server at `https://appliflo.com/api/mcp`. Kind: asks first: it changes something in your workspace, so clients ask you first. Explain a Doc (find it with list_docs, read it with get_doc), or part of it, in plain English for someone who isn't a lawyer, as Explain in the editor does. Changes nothing. text: the exact words to explain, copied from the Doc; leave out for the whole Doc. Returns the explanation (not legal advice): pass it on as it is. Anyone who can see the Doc may use it. Spends the workspace's AI writing allowance (Starter and Business plans); refused like the app. ## Inputs | Name | Type | Required | Description | | --- | --- | --- | --- | | `doc_id` | string | yes | The Doc's id (from list_docs or get_doc). Up to 80 characters | | `text` | string | no | The text to explain, copied from the Doc. Leave out for the whole Doc. Up to 12000 characters | Source: https://dev.appliflo.com/mcp/tools/docs_ai_explain --- # docs_ai_review > Check a whole Doc as a careful practitioner would, as Review in the editor does: conflicts, missing clauses, unclear wording. Tool of the AppliFlo MCP server at `https://appliflo.com/api/mcp`. Kind: asks first: it changes something in your workspace, so clients ask you first. Check a whole Doc as a careful practitioner would, as Review in the editor does: conflicts, missing clauses, unclear wording. Changes nothing. Returns a summary and findings, each with kind, where, detail, the exact text it is about and sometimes a suggested fix. Tell the person the findings; to apply a fix call docs_ai_rewrite with the finding's text (mode custom, the fix as instruction), and to add a missing clause use docs_ai_continue (kind clause) or insert_clause. Spends the workspace's AI writing allowance (Starter and Business plans); refused like the app. ## Inputs | Name | Type | Required | Description | | --- | --- | --- | --- | | `doc_id` | string | yes | The Doc's id (from list_docs or get_doc). Up to 80 characters | Source: https://dev.appliflo.com/mcp/tools/docs_ai_review --- # search_clauses > Search the workspace's clause library (its own clauses and AppliFlo's starter clauses) by title and text, as Docs → Clauses does. Tool of the AppliFlo MCP server at `https://appliflo.com/api/mcp`. Kind: read: it only looks, so clients can run it without asking. Search the workspace's clause library (its own clauses and AppliFlo's starter clauses) by title and text, as Docs → Clauses does. Returns up to 50 clauses with clause_id, title, category, a preview, version, whether it was reviewed and whether it is an AppliFlo starter (system). Put one in a Doc with insert_clause. For people only: an API key is refused, as on the web. ## Inputs | Name | Type | Required | Description | | --- | --- | --- | --- | | `query` | string | no | Words from the clause, e.g. "refund". Leave out to list them all. Up to 200 characters | | `category` | string | no | Only this category. One of: fees, refunds, privacy, termination, immigration, general | Source: https://dev.appliflo.com/mcp/tools/search_clauses --- # insert_clause > Put a clause from the workspace's clause library (search_clauses) into a Doc, word for word, as Insert clause in the editor does. Tool of the AppliFlo MCP server at `https://appliflo.com/api/mcp`. Kind: asks first: it changes something in your workspace, so clients ask you first. Put a clause from the workspace's clause library (search_clauses) into a Doc, word for word, as Insert clause in the editor does. It goes after the block whose text you give in after (a heading means after its whole section), or at the end. The clause stays linked to the library, so a newer version can update it later. Saves the Doc and returns its new revision and the text inserted. No AI is used. To write a new clause instead use docs_ai_continue with kind clause. ## Inputs | Name | Type | Required | Description | | --- | --- | --- | --- | | `doc_id` | string | yes | The Doc's id (from list_docs or get_doc). Up to 80 characters | | `clause_id` | string | yes | clause_id from search_clauses. Up to 80 characters | | `after` | string | no | Put it after the block with this text, copied from the Doc (a heading like "4. Fees" means after its whole section). Leave out for the end of the Doc. Up to 200 characters | | `revision` | integer | no | The Doc's revision as you last read it (get_doc). Checked before any AI is spent: if the Doc has changed since, you get 409 revision_conflict with the current revision and nothing is spent or written. The tool holds the Doc's edit lock from that check until it has saved, so nobody can change it in between. Leave out to work on the Doc as it is now. At least 0 | Source: https://dev.appliflo.com/mcp/tools/insert_clause --- # list_form_memory > What this workspace's AppliFlo remembers, as Settings → Form memory shows it. forms: each form edition whose box fixes (moved, added or deleted boxes: box_fixes) or box owners (owner_changes) are put back automatically the next time the same form is uploaded. habits: team habits AI assign carries to other forms ("boxes labelled X go to role Y"). Tool of the AppliFlo MCP server at `https://appliflo.com/api/mcp`. Kind: read: it only looks, so clients can run it without asking. What this workspace's AppliFlo remembers, as Settings → Form memory shows it. forms: each form edition whose box fixes (moved, added or deleted boxes: box_fixes) or box owners (owner_changes) are put back automatically the next time the same form is uploaded. habits: team habits AI assign carries to other forms ("boxes labelled X go to role Y"). Also the training data setting (training_share, changed by the owner in the app) and can_forget (whether you may forget items with delete_form_memory: owners and admins). Use it before delete_form_memory to find an id. ## Inputs This tool takes no inputs. Source: https://dev.appliflo.com/mcp/tools/list_form_memory --- # delete_form_memory > Forget a remembered form (form_id) or a team habit (habit_id) from list_form_memory, like Forget on Settings → Form memory. Tool of the AppliFlo MCP server at `https://appliflo.com/api/mcp`. Kind: destructive: it emails people or cancels a send, so clients ask you first. Forget a remembered form (form_id) or a team habit (habit_id) from list_form_memory, like Forget on Settings → Form memory. A forgotten form's box fixes and owners are no longer put back when it is uploaded again; a forgotten habit stops guiding AI assign. Documents already prepared are not changed. It can't be undone. Owners and admins only. 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. ## Inputs | Name | Type | Required | Description | | --- | --- | --- | --- | | `form_id` | string | no | A form's id from list_form_memory (forms[].id). Give this or habit_id. Up to 64 characters | | `habit_id` | string | no | A habit's id from list_form_memory (habits[].id). Give this or form_id. Up to 64 characters | | `confirm` | boolean | no | true to really do it. Without it nothing happens: you get an error describing what would happen, to show the user | Source: https://dev.appliflo.com/mcp/tools/delete_form_memory --- # get_my_details > Your own personal details (Fill as me, Settings → Details → Personal profile): name, contact and address, passport and visa, work and study, and your custom details, grouped as in the app, each with key, label and value (null when empty). Tool of the AppliFlo MCP server at `https://appliflo.com/api/mcp`. Kind: read: it only looks, so clients can run it without asking. Your own personal details (Fill as me, Settings → Details → Personal profile): name, contact and address, passport and visa, work and study, and your custom details, grouped as in the app, each with key, label and value (null when empty). ID numbers and other sensitive details (app_only: true) come back masked to their last 3 characters; the full value is never given to a chat. Only ever the signed-in person's own details, not a client's (use get_client for clients); an API key can't use it. Use set_my_details to change them. ## Inputs This tool takes no inputs. Source: https://dev.appliflo.com/mcp/tools/get_my_details --- # set_my_details > Change your own personal details (Fill as me), like saving the Personal profile in Settings → Details. Tool of the AppliFlo MCP server at `https://appliflo.com/api/mcp`. Kind: destructive: it emails people or cancels a send, so clients ask you first. Change your own personal details (Fill as me), like saving the Personal profile in Settings → Details. Each change is {key, value, label?}: key from get_my_details (client.given_name, client.email, client.street, …) or custom.<slug> for your own detail (a new one needs a label); value null clears it. Dates are YYYY-MM-DD or DD/MM/YYYY. ID numbers and other sensitive details (app_only in get_my_details: passport, tax file, social security and visa grant numbers, driver licence or Medicare numbers, date of birth, bank details) are refused: for privacy the person enters them in the app. All changes are checked first; if any is refused nothing is saved. Returns the profile as get_my_details does. ## Inputs | Name | Type | Required | Description | | --- | --- | --- | --- | | `changes` | object[] | yes | 1 to 200 items | | `changes[].key` | string | yes | client.<name> from get_my_details, or custom.<slug> (lower case letters, digits, _). Up to 100 characters | | `changes[].value` | string \| null | yes | The new value; null clears the detail. Up to 500 characters | | `changes[].label` | string | no | A custom detail's label, at most 60 characters (required when adding one). Up to 60 characters | Source: https://dev.appliflo.com/mcp/tools/set_my_details --- # list_connectors > Which CRMs this workspace can use (GlobalyOS or Agentcis) and whether each is connected. Tool of the AppliFlo MCP server at `https://appliflo.com/api/mcp`. Kind: read: it only looks, so clients can run it without asking. Which CRMs this workspace can use (GlobalyOS or Agentcis) and whether each is connected. Returns one row per CRM offered here (type, name, what it gives, connected) with its connections, each with source_id (pass it to lookup_crm_record), status (connected, needs_reauth or disconnected), account, organization, ready, write_back (signed PDFs go back to the CRM) and problem (what is wrong, in words, or null). Also settings_url: connecting, reconnecting and disconnecting a CRM need a browser sign-in, so send the user there for those; can_manage says whether this person may (owners and admins), and plan_note why the plan can't connect a CRM, if so. Never returns keys or tokens. ## Inputs This tool takes no inputs. Source: https://dev.appliflo.com/mcp/tools/list_connectors --- # lookup_crm_record > Look someone up in the workspace's connected CRMs (GlobalyOS or Agentcis). Tool of the AppliFlo MCP server at `https://appliflo.com/api/mcp`. Kind: read: it only looks, so clients can run it without asking. Look someone up in the workspace's connected CRMs (GlobalyOS or Agentcis). Two ways. (1) query: a name, email or phone (at least 2 characters) searched in every connected CRM at once, or only in source_id's; returns results (name, email, phone, the CRM and a recordRef {sourceId, entity, recordId}) and sources (which CRMs answered: ok, timeout, error or needs_reauth); a source_id that needs reconnecting returns its status and settings_url instead. Members and up, with the workspace's CRM search (Settings → Extension) on. (2) source_id + entity + record_id (a recordRef from a search, or a client's CRM link): reads that one record live and returns its name, email, phone and company; 404 record_missing when the CRM no longer has it, 502 when the CRM doesn't answer. Use it to check who a record is before prefilling or linking. To find AppliFlo clients as well, use search_clients; to see which CRMs are connected, list_connectors. ## Inputs | Name | Type | Required | Description | | --- | --- | --- | --- | | `query` | string | no | Name, email or phone to search for. Leave out with record_id. Up to 100 characters | | `source_id` | string | no | A connection's source_id from list_connectors (or recordRef.sourceId). Needed with record_id; with query, searches only that CRM. Up to 200 characters | | `entity` | string | no | recordRef.entity (the record type). With record_id only. Up to 100 characters | | `record_id` | string | no | recordRef.recordId: read this one record. Up to 200 characters | Source: https://dev.appliflo.com/mcp/tools/lookup_crm_record --- # list_members > The workspace's members (membership_id, user_id, name, email, role: owner, admin, member or viewer, joined_at) and its pending invites (id, email, role, expires_at). Tool of the AppliFlo MCP server at `https://appliflo.com/api/mcp`. Kind: read: it only looks, so clients can run it without asking. The workspace's members (membership_id, user_id, name, email, role: owner, admin, member or viewer, joined_at) and its pending invites (id, email, role, expires_at). Anyone in the workspace may read it, as on Settings → Members. Use the membership_id with remove_member; invite someone new with invite_member. ## Inputs This tool takes no inputs. Source: https://dev.appliflo.com/mcp/tools/list_members --- # invite_member > Invite someone to the workspace by email as admin, member or viewer (an owner can't be invited). Tool of the AppliFlo MCP server at `https://appliflo.com/api/mcp`. Kind: destructive: it emails people or cancels a send, so clients ask you first. Invite someone to the workspace by email as admin, member or viewer (an owner can't be invited). They get an email with a link that is good for 7 days and joins them once they sign in with that address. Owners and admins only, as on Settings → Members. Returns the invite's id, email, role, expiry and whether the email went out (emailed: false means the invite exists but the email failed; it can be resent from Settings → Members). list_members shows pending invites. 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. ## Inputs | Name | Type | Required | Description | | --- | --- | --- | --- | | `email` | string | yes | The person's email address. Format: email. Up to 320 characters | | `role` | string | yes | admin (can manage the workspace), member (sends and edits) or viewer (reads only). One of: admin, member, viewer | | `confirm` | boolean | no | true to really do it. Without it nothing happens: you get an error describing what would happen, to show the user | Source: https://dev.appliflo.com/mcp/tools/invite_member --- # remove_member > Remove someone from the workspace by their membership_id (from list_members). Tool of the AppliFlo MCP server at `https://appliflo.com/api/mcp`. Kind: destructive: it emails people or cancels a send, so clients ask you first. Remove someone from the workspace by their membership_id (from list_members). They lose access at once: their sessions end and their AI-app connections to this workspace (Claude, ChatGPT) are disconnected. Documents they made stay in the workspace. Owners and admins only, with the web's rules: only an owner can remove an owner, and the last owner can't be removed. To undo it, invite them again with invite_member. 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. ## Inputs | Name | Type | Required | Description | | --- | --- | --- | --- | | `membership_id` | string | yes | The member's membership_id from list_members (not their user_id). Up to 64 characters | | `confirm` | boolean | no | true to really do it. Without it nothing happens: you get an error describing what would happen, to show the user | Source: https://dev.appliflo.com/mcp/tools/remove_member --- # get_workspace > The workspace you are in: id, name, your role, plan (free, starter or business), branding (colours, whether a logo is set, whether the plan includes custom branding) and its details (legal name, ABN, address and other values templates fill in; null when Details are off). Tool of the AppliFlo MCP server at `https://appliflo.com/api/mcp`. Kind: read: it only looks, so clients can run it without asking. The workspace you are in: id, name, your role, plan (free, starter or business), branding (colours, whether a logo is set, whether the plan includes custom branding) and its details (legal name, ABN, address and other values templates fill in; null when Details are off). Owners and admins also get settings: country, language (locale), time zone, data retention days and business type. Change them with update_workspace_details; list_members lists the people. ## Inputs This tool takes no inputs. Source: https://dev.appliflo.com/mcp/tools/get_workspace --- # update_workspace_details > Change the workspace's settings, as on Settings → Workspace and Settings → Details. Tool of the AppliFlo MCP server at `https://appliflo.com/api/mcp`. Kind: destructive: it emails people or cancels a send, so clients ask you first. Change the workspace's settings, as on Settings → Workspace and Settings → Details. Owners and admins only. Pass only what changes: name; business_type; data_retention_days (30 to 3650); country (2 letters, e.g. AU; sets the language and time zone to match unless you pass them), locale and time_zone (an IANA zone, e.g. Australia/Sydney) — these three are the owner's only; primary_color and accent_color (#RRGGBB, Business plan); and details, the values templates fill in (legalName, tradingName, abn, address1, address2, phone, email, or custom.<name>; null removes one). Returns the workspace as get_workspace does. A logo is uploaded in the app. ## Inputs | Name | Type | Required | Description | | --- | --- | --- | --- | | `name` | string | no | Up to 100 characters | | `business_type` | string \| null | no | null clears it | | `data_retention_days` | integer | no | 30 to 3650 | | `country` | string | no | ISO country code, e.g. AU, NZ, GB, US. Owner only. Up to 2 characters | | `locale` | string | no | Language and region for dates and emails. Owner only. One of: en-AU, en-NZ, en-GB, en-IE, en-US, en-CA, en-IN, en-SG, en-ZA | | `time_zone` | string | no | IANA time zone, e.g. Australia/Sydney. Owner only. Up to 64 characters | | `primary_color` | string | no | | | `accent_color` | string | no | | | `details` | map of string \| null | no | Workspace details by key (legalName, tradingName, abn, address1, address2, phone, email, custom.<lowercase-name>); a null or empty value removes it | Source: https://dev.appliflo.com/mcp/tools/update_workspace_details --- # Changelog > What changed in the AppliFlo API and MCP server. ## November 2026 - **Webhooks.** Get a signed `POST` on your server when an envelope is sent, viewed, signed, declined, completed or voided, when a send-to-many row fails, or when a document is detected. Standard Webhooks signatures, retries for 3 days, and a 30-day delivery log. See [Webhooks](https://dev.appliflo.com/webhooks). - **Developer docs.** This site: guides, an API reference made from the OpenAPI file, and a page for every MCP tool. - **Docs for AI agents.** [`/llms.txt`](https://dev.appliflo.com/llms.txt), [`/llms-full.txt`](https://dev.appliflo.com/llms-full.txt), a Markdown copy of every page (add `.md`), and the AppliFlo Docs MCP at `https://dev.appliflo.com/docs-mcp`. See [Use AppliFlo from a coding agent](https://dev.appliflo.com/guides/coding-agent#let-the-agent-read-these-docs). - **Box help.** `PATCH /api/v1/documents/{id}/fields/{fieldId}` and `correct_field` can set a short line of help for the person filling a box. See [Correct fields](https://dev.appliflo.com/guides/correct-fields). - **Own-risk confirmation on template sends.** Sending an AppliFlo library contract our lawyer has not reviewed needs `risk_accepted: true`. See [Send a saved template](https://dev.appliflo.com/guides/send-template#appliflo-library-contracts). - **One shared budget for reading, filling and sending.** One-shot fill (`POST /api/v1/fill`) now counts against the shared 20 calls a minute, with detect, fill and send. The MCP tools that do the same use it too. See [Rate limits](https://dev.appliflo.com/guides/rate-limits). - **Key scopes and expiry.** Keys have `read`, `draft` and `send` scopes and can expire. See [API keys and scopes](https://dev.appliflo.com/guides/api-keys). - **Confirm step for MCP sends.** `send_envelope`, `void_envelope`, `send_template` and `send_template_bulk` do nothing until called again with `confirm: true`. Source: https://dev.appliflo.com/changelog --- # Embed SDK > Signing and filling AppliFlo documents inside your own app. Coming soon, with a waitlist. > **Coming soon** > > The Embed SDK is not live yet. Nothing on this page works today. The Embed SDK will let the people using your app sign and fill AppliFlo documents without leaving it. Your server will make a short-lived link for one person, and your page will show it. ## What you can use today - Send a document for signature from your server with the [REST API](https://dev.appliflo.com/guides/send-for-signature). Signers get an email link and sign on AppliFlo. - Track it with [Get an envelope](https://dev.appliflo.com/api/envelopes/get-envelope) and download the signed PDF when it is done. See [Track and download envelopes](https://dev.appliflo.com/guides/track-envelopes). ## Hear when it ships Leave your email and we will write once, when the Embed SDK is live. Join the waitlist on appliflo.com: https://appliflo.com/developers#developers-waitlist Source: https://dev.appliflo.com/sdk --- # Webhooks > Get a signed POST on your server when an envelope is sent, viewed, signed, declined, completed or voided, with retries for 3 days. A webhook tells your server when something happens in your workspace, such as a client signing, so you don't have to poll. AppliFlo sends a `POST` with a small JSON summary to a URL you choose, signs it with a secret only you and AppliFlo know, and tries again for 3 days if your server doesn't answer. Webhooks follow the [Standard Webhooks](https://www.standardwebhooks.com/) spec, so any Standard Webhooks library can check them. > **Summaries, never answers** > > A webhook says what happened and to which envelope: ids, names, statuses and times. It never carries what anyone typed into a form, signature images, access codes, IP addresses or files. To get the signed PDF, [download it with the API](https://dev.appliflo.com/guides/track-envelopes#download-the-signed-pdf). ## Add an endpoint ### Open Settings An owner or admin opens [Settings → API & AI apps](https://appliflo.com/settings/api-keys) on appliflo.com and scrolls to **Webhooks**. Webhooks work on every plan, and you don't need an API key to use them. A workspace can have up to 20 endpoints. ### Add the URL and pick events Click **Add endpoint**. Enter an `https://` URL on the standard port (443), a name so you know what it is, and the events you want, or **Select all**. ### Copy the signing secret The secret starts with `whsec_`. It is shown once. Copy it into your server's settings, for example as `APPLIFLO_WEBHOOK_SECRET`. AppliFlo keeps it encrypted and can't show it again; if you lose it, [rotate it](#rotate-the-secret). ### Send a test Open the endpoint's **Delivery log** and click **Send test event**. Your server gets a `webhook.test` event, and the log shows what your server answered. ## Events | Event | Sent when | | --- | --- | | `envelope.sent` | An envelope is sent, or sent again with **Resend**. With signing in order, later people getting their turn is not a separate `envelope.sent`. | | `envelope.viewed` | A recipient's signing page first shows in their browser. Once per recipient per round, never after the round is over; a link scanner opening the link doesn't count. If the page never reports it (for example a signer working through the API), it comes when they consent. | | `envelope.signed` | One recipient finished signing. Others may still have to. | | `envelope.declined` | A recipient declined to sign. | | `envelope.completed` | Everyone has signed and the signed PDF is sealed and ready to download. | | `envelope.voided` | The sender voided the envelope. | | `bulk.row_failed` | One row of a [send to many](https://dev.appliflo.com/guides/send-to-many) batch could not be sent. Rows in a batch you cancelled are not announced. | | `document.detected` | AppliFlo finished finding the boxes on an uploaded document. | | `webhook.test` | Someone clicked **Send test event**. Only that endpoint gets it. | Every body has the same outer shape around the event's `data`: ```json { "id": "evt_k7q2m3x4b5n3p6r2t5v4w2y4", "type": "envelope.completed", "created_at": "2026-11-26T10:00:00Z", "workspace_id": "cmw2k8r1d0000qnzh5t7b3a9c", "data": { "...": "..." } } ``` `id` is the event id. It is the same as the `webhook-id` header, and stays the same on every retry. Only event ids have a prefix (`evt_`); envelope, document, client and batch ids are plain strings such as `cmwxfhd0u000qnzhjrb1yhjvw`. Store all ids as text and don't parse them. Times are UTC to the second, such as `2026-11-26T10:00:00Z`. New fields may be added to `data`, so ignore fields you don't know. ### Envelope events All six `envelope.*` events share one `data` shape: | Field | What it is | | --- | --- | | `envelope_id`, `document_id`, `document_name` | Which envelope, and the document it carries. | | `status` | `awaiting`, `completing`, `completed`, `declined`, `expired` or `voided`, as in [Track envelopes](https://dev.appliflo.com/guides/track-envelopes#list-envelopes). | | `round` | 1 for the first send, then 2, 3 and on after each **Resend**. | | `sent_at` | When this round was sent. Always there. | | `completed_at`, `voided_at` | Only once the envelope is completed or voided. | | `recipient` | On `envelope.viewed`, `envelope.signed` and `envelope.declined` only: the person who acted, in the same shape as a `recipients` entry. | | `recipients` | Everyone on the envelope. | | `client_id` | Only when the envelope is linked to a client. | Each recipient has `name`, `email`, `role`, `kind` and `status`: - `kind` is `signer`, `filler` or `cc`. - `role` is the template role label, such as `"Client"`, or `null` when the envelope was not sent from a template. - `status` is `pending`, `sent`, `completed` (signed) or `declined`. A `cc` stays `pending`. - `viewed_at`, `signed_at` and `declined_at` are there only once they happened. `viewed_at` is when the signing page first showed; the signing certificate keeps its own record. **envelope.sent** ```json { "id": "evt_a2b3c4d5e6f7g2h3j4k5m6n7", "type": "envelope.sent", "created_at": "2026-11-26T09:00:00Z", "workspace_id": "cmw2k8r1d0000qnzh5t7b3a9c", "data": { "envelope_id": "cmwxfhd0u000qnzhjrb1yhjvw", "document_id": "cmwxf9a2k0004qnzh8vd1m6pe", "document_name": "Tenancy agreement", "status": "awaiting", "round": 1, "sent_at": "2026-11-26T09:00:00Z", "recipients": [ { "name": "Lan Nguyen", "email": "lan@example.com", "role": "Tenant", "kind": "signer", "status": "sent" }, { "name": "Omar Haddad", "email": "omar@example.com", "role": "Landlord", "kind": "signer", "status": "sent" }, { "name": "Priya Shah", "email": "priya@example.com", "role": null, "kind": "cc", "status": "pending" } ], "client_id": "cmwq3n7xb0002ld0k4h9s2e7f" } } ``` **envelope.viewed** ```json { "id": "evt_b3c4d5e6f7g2h3j4k5m6n7p2", "type": "envelope.viewed", "created_at": "2026-11-26T09:12:04Z", "workspace_id": "cmw2k8r1d0000qnzh5t7b3a9c", "data": { "envelope_id": "cmwxfhd0u000qnzhjrb1yhjvw", "document_id": "cmwxf9a2k0004qnzh8vd1m6pe", "document_name": "Tenancy agreement", "status": "awaiting", "round": 1, "sent_at": "2026-11-26T09:00:00Z", "recipient": { "name": "Lan Nguyen", "email": "lan@example.com", "role": "Tenant", "kind": "signer", "status": "sent", "viewed_at": "2026-11-26T09:12:04Z" }, "recipients": [ { "name": "Lan Nguyen", "email": "lan@example.com", "role": "Tenant", "kind": "signer", "status": "sent", "viewed_at": "2026-11-26T09:12:04Z" }, { "name": "Omar Haddad", "email": "omar@example.com", "role": "Landlord", "kind": "signer", "status": "sent" }, { "name": "Priya Shah", "email": "priya@example.com", "role": null, "kind": "cc", "status": "pending" } ], "client_id": "cmwq3n7xb0002ld0k4h9s2e7f" } } ``` **envelope.signed** ```json { "id": "evt_c4d5e6f7g2h3j4k5m6n7p2q3", "type": "envelope.signed", "created_at": "2026-11-26T09:20:31Z", "workspace_id": "cmw2k8r1d0000qnzh5t7b3a9c", "data": { "envelope_id": "cmwxfhd0u000qnzhjrb1yhjvw", "document_id": "cmwxf9a2k0004qnzh8vd1m6pe", "document_name": "Tenancy agreement", "status": "awaiting", "round": 1, "sent_at": "2026-11-26T09:00:00Z", "recipient": { "name": "Lan Nguyen", "email": "lan@example.com", "role": "Tenant", "kind": "signer", "status": "completed", "viewed_at": "2026-11-26T09:12:04Z", "signed_at": "2026-11-26T09:20:31Z" }, "recipients": [ { "name": "Lan Nguyen", "email": "lan@example.com", "role": "Tenant", "kind": "signer", "status": "completed", "viewed_at": "2026-11-26T09:12:04Z", "signed_at": "2026-11-26T09:20:31Z" }, { "name": "Omar Haddad", "email": "omar@example.com", "role": "Landlord", "kind": "signer", "status": "sent" }, { "name": "Priya Shah", "email": "priya@example.com", "role": null, "kind": "cc", "status": "pending" } ], "client_id": "cmwq3n7xb0002ld0k4h9s2e7f" } } ``` **envelope.declined** ```json { "id": "evt_d5e6f7g2h3j4k5m6n7p2q3r4", "type": "envelope.declined", "created_at": "2026-11-26T09:25:10Z", "workspace_id": "cmw2k8r1d0000qnzh5t7b3a9c", "data": { "envelope_id": "cmwxfhd0u000qnzhjrb1yhjvw", "document_id": "cmwxf9a2k0004qnzh8vd1m6pe", "document_name": "Tenancy agreement", "status": "declined", "round": 1, "sent_at": "2026-11-26T09:00:00Z", "recipient": { "name": "Omar Haddad", "email": "omar@example.com", "role": "Landlord", "kind": "signer", "status": "declined", "viewed_at": "2026-11-26T09:24:02Z", "declined_at": "2026-11-26T09:25:10Z" }, "recipients": [ { "name": "Lan Nguyen", "email": "lan@example.com", "role": "Tenant", "kind": "signer", "status": "completed", "viewed_at": "2026-11-26T09:12:04Z", "signed_at": "2026-11-26T09:20:31Z" }, { "name": "Omar Haddad", "email": "omar@example.com", "role": "Landlord", "kind": "signer", "status": "declined", "viewed_at": "2026-11-26T09:24:02Z", "declined_at": "2026-11-26T09:25:10Z" }, { "name": "Priya Shah", "email": "priya@example.com", "role": null, "kind": "cc", "status": "pending" } ], "client_id": "cmwq3n7xb0002ld0k4h9s2e7f" } } ``` **envelope.completed** ```json { "id": "evt_e6f7g2h3j4k5m6n7p2q3r4s5", "type": "envelope.completed", "created_at": "2026-11-26T10:00:02Z", "workspace_id": "cmw2k8r1d0000qnzh5t7b3a9c", "data": { "envelope_id": "cmwxfhd0u000qnzhjrb1yhjvw", "document_id": "cmwxf9a2k0004qnzh8vd1m6pe", "document_name": "Tenancy agreement", "status": "completed", "round": 1, "sent_at": "2026-11-26T09:00:00Z", "completed_at": "2026-11-26T10:00:02Z", "recipients": [ { "name": "Lan Nguyen", "email": "lan@example.com", "role": "Tenant", "kind": "signer", "status": "completed", "viewed_at": "2026-11-26T09:12:04Z", "signed_at": "2026-11-26T09:20:31Z" }, { "name": "Omar Haddad", "email": "omar@example.com", "role": "Landlord", "kind": "signer", "status": "completed", "viewed_at": "2026-11-26T09:58:15Z", "signed_at": "2026-11-26T09:59:47Z" }, { "name": "Priya Shah", "email": "priya@example.com", "role": null, "kind": "cc", "status": "pending" } ], "client_id": "cmwq3n7xb0002ld0k4h9s2e7f" } } ``` **envelope.voided** ```json { "id": "evt_f7g2h3j4k5m6n7p2q3r4s5t6", "type": "envelope.voided", "created_at": "2026-11-26T11:00:00Z", "workspace_id": "cmw2k8r1d0000qnzh5t7b3a9c", "data": { "envelope_id": "cmwxfhd0u000qnzhjrb1yhjvw", "document_id": "cmwxf9a2k0004qnzh8vd1m6pe", "document_name": "Tenancy agreement", "status": "voided", "round": 1, "sent_at": "2026-11-26T09:00:00Z", "voided_at": "2026-11-26T11:00:00Z", "recipients": [ { "name": "Lan Nguyen", "email": "lan@example.com", "role": "Tenant", "kind": "signer", "status": "sent", "viewed_at": "2026-11-26T09:12:04Z" }, { "name": "Omar Haddad", "email": "omar@example.com", "role": "Landlord", "kind": "signer", "status": "sent" }, { "name": "Priya Shah", "email": "priya@example.com", "role": null, "kind": "cc", "status": "pending" } ] } } ``` ### Other events **bulk.row_failed** `row` is the row's index in the batch you sent. `error` says in words why that row was not sent, such as a bounce. Fix it as in [Send to many](https://dev.appliflo.com/guides/send-to-many). ```json { "id": "evt_g2h3j4k5m6n7p2q3r4s5t6u7", "type": "bulk.row_failed", "created_at": "2026-11-26T09:03:41Z", "workspace_id": "cmw2k8r1d0000qnzh5t7b3a9c", "data": { "batch_id": "cmwy2c5ph0001qnzhd8k3w4ra", "row": 12, "error": "Bounced: mailbox full" } } ``` **document.detected** `field_count` is how many boxes were found. `page_count` can be `null` when the page count isn't known. ```json { "id": "evt_h3j4k5m6n7p2q3r4s5t6u7v2", "type": "document.detected", "created_at": "2026-11-26T08:58:19Z", "workspace_id": "cmw2k8r1d0000qnzh5t7b3a9c", "data": { "document_id": "cmwxf9a2k0004qnzh8vd1m6pe", "document_name": "Form 956 Appointment of a registered migration agent", "page_count": 6, "field_count": 84 } } ``` **webhook.test** Use it to check your URL and your signature check. Don't act on it. ```json { "id": "evt_j4k5m6n7p2q3r4s5t6u7v2w3", "type": "webhook.test", "created_at": "2026-11-26T08:00:00Z", "workspace_id": "cmw2k8r1d0000qnzh5t7b3a9c", "data": {} } ``` ## Headers | Header | Value | | --- | --- | | `webhook-id` | The event id: `evt_` and 24 characters. The same on every retry of that event. | | `webhook-timestamp` | When this attempt was sent, in Unix seconds. | | `webhook-signature` | `v1,` and a base64 HMAC-SHA256 signature. During a secret rotation there are two, separated by a space. | | `content-type` | `application/json` | | `user-agent` | `AppliFlo-Webhooks/1` | ## Check the signature Check every request before you trust it. The signature is an HMAC-SHA256 of `webhook-id`, `webhook-timestamp` and the raw body, joined with dots: ```text {webhook-id}.{webhook-timestamp}.{raw body} ``` The key is the part of your secret after `whsec_`, base64-decoded. Compare signatures in constant time, and refuse a timestamp more than 5 minutes from your clock, so an old request can't be replayed. Sign the **raw body**, exactly as it arrived. If your framework parses the JSON and you stringify it again, the bytes can change and the check fails. **Node (standardwebhooks)** The [`standardwebhooks`](https://www.npmjs.com/package/standardwebhooks) package checks the signature and the timestamp for you. ```bash npm install standardwebhooks ``` ```js import express from "express"; import { Webhook } from "standardwebhooks"; const wh = new Webhook(process.env.APPLIFLO_WEBHOOK_SECRET); // whsec_... const app = express(); // express.raw keeps the body as bytes, so the signature can be checked. app.post("/hooks/appliflo", express.raw({ type: "application/json" }), (req, res) => { let event; try { event = wh.verify(req.body, req.headers); } catch { return res.status(400).send("Bad signature"); } res.sendStatus(204); // answer first, then do the work handle(event); }); ``` **Node (no dependencies)** Only `node:crypto`. It accepts any of the `v1,` signatures, so it keeps working during a rotation. ```js title="verify-webhook.js" import { createHmac, timingSafeEqual } from "node:crypto"; const TOLERANCE_SECONDS = 5 * 60; /** * Checks an AppliFlo webhook and returns the parsed event. * secret: "whsec_...". headers: lower-case names. body: the raw body as a string. */ export function verifyWebhook(secret, headers, body) { const id = headers["webhook-id"]; const timestamp = headers["webhook-timestamp"]; const signatures = headers["webhook-signature"]; if (!id || !timestamp || !signatures) throw new Error("Missing webhook headers"); const sentAt = Number(timestamp); const now = Math.floor(Date.now() / 1000); if (!Number.isInteger(sentAt) || Math.abs(now - sentAt) > TOLERANCE_SECONDS) { throw new Error("Timestamp is too old or too new"); } const key = Buffer.from(secret.replace(/^whsec_/, ""), "base64"); const expected = createHmac("sha256", key).update(`${id}.${timestamp}.${body}`).digest(); // "v1,<sig>" or, during a rotation, "v1,<new> v1,<old>". for (const part of signatures.split(" ")) { const [version, signature] = part.split(","); if (version !== "v1" || !signature) continue; const given = Buffer.from(signature, "base64"); if (given.length === expected.length && timingSafeEqual(given, expected)) { return JSON.parse(body); } } throw new Error("No matching signature"); } ``` ```js import express from "express"; import { verifyWebhook } from "./verify-webhook.js"; const app = express(); app.post("/hooks/appliflo", express.raw({ type: "application/json" }), (req, res) => { let event; try { event = verifyWebhook(process.env.APPLIFLO_WEBHOOK_SECRET, req.headers, req.body.toString("utf8")); } catch { return res.status(400).send("Bad signature"); } res.sendStatus(204); handle(event); }); ``` **Python** Only the standard library. The `standardwebhooks` package on PyPI does the same job if you prefer a library. ```python title="verify_webhook.py" import base64 import hashlib import hmac import json import time TOLERANCE_SECONDS = 5 * 60 def verify_webhook(secret, headers, body): """Checks an AppliFlo webhook and returns the parsed event. secret: "whsec_...". headers: a dict with lower-case names. body: the raw body as bytes. """ msg_id = headers.get("webhook-id") timestamp = headers.get("webhook-timestamp") signatures = headers.get("webhook-signature") if not msg_id or not timestamp or not signatures: raise ValueError("Missing webhook headers") if not timestamp.isdigit() or abs(time.time() - int(timestamp)) > TOLERANCE_SECONDS: raise ValueError("Timestamp is too old or too new") key = base64.b64decode(secret[len("whsec_"):] if secret.startswith("whsec_") else secret) signed = f"{msg_id}.{timestamp}.".encode() + body expected = base64.b64encode(hmac.new(key, signed, hashlib.sha256).digest()).decode() # "v1,<sig>" or, during a rotation, "v1,<new> v1,<old>". for part in signatures.split(" "): version, _, signature = part.partition(",") if version == "v1" and hmac.compare_digest(signature, expected): return json.loads(body) raise ValueError("No matching signature") ``` With Flask: ```python import os from flask import Flask, request from verify_webhook import verify_webhook app = Flask(__name__) @app.post("/hooks/appliflo") def appliflo_hook(): headers = {k.lower(): v for k, v in request.headers.items()} try: event = verify_webhook(os.environ["APPLIFLO_WEBHOOK_SECRET"], headers, request.get_data()) except ValueError: return "Bad signature", 400 handle(event) return "", 204 ``` ## Answer quickly Answer with any `2xx` status within 10 seconds. Anything else counts as a failure: another status, a timeout, or a redirect. AppliFlo doesn't follow redirects, so give the final URL. If the work takes longer, answer first and do it afterwards, for example from a queue. ## Retries Deliveries go out from a background job that runs about every 15 minutes. The first attempt lands within about 15 minutes of the event, not the instant it happens. A failed delivery is tried again after at least the wait below, counted from the attempt before, on the job's next run after that: | Attempt | Earliest | | --- | --- | | 1 | The next run, within about 15 minutes | | 2 | 1 minute later (in practice, the next run) | | 3 | 5 minutes later (in practice, the next run) | | 4 | 30 minutes later | | 5 | 2 hours later | | 6 | 5 hours later | | 7 | 10 hours later | | 8 and on | Every 12 hours | AppliFlo stops 3 days after the first attempt and marks that delivery as given up. A retry is the same event: same `webhook-id`, same body, a new `webhook-timestamp` and signature. **Retry** in the delivery log and **Send test event** don't wait for the job: they try straight away. ## Duplicates and order - **Duplicates.** The same event can reach you more than once, for example when your server did the work but answered too late. Keep the `webhook-id` of each event you have handled and skip one you have already seen. - **Order is not guaranteed.** Events can arrive out of order, especially after a retry. Don't assume `envelope.signed` arrives before `envelope.completed`. Use `created_at` and the `status` in `data`, or [get the envelope](https://dev.appliflo.com/api/envelopes/get-envelope) for its current state before you act. ## When an endpoint keeps failing If every delivery to an endpoint fails for 3 days, AppliFlo turns the endpoint off and emails the workspace owners once. Settings shows it as disabled, with the reason. You can also turn an endpoint off yourself. Deliveries already queued for it wait, and go out when you turn it back on; one whose event is more than 3 days old gives up after its next failed attempt. Events that happen while an endpoint is off are not queued for it. When your server is fixed, turn the endpoint back on in Settings, then [list envelopes](https://dev.appliflo.com/guides/track-envelopes#list-envelopes) to catch up on what changed meanwhile. ## Delivery log Each endpoint's **Delivery log** shows every delivery from the last 30 days: the event, the time, your server's status code, the number of attempts, the request body as sent and the start of your server's reply. Bodies in the log are cut to about 4 KB. Filter by **Failed** to see what needs attention. ## Rotate the secret In the delivery log, click **Rotate secret**. The new secret is shown once, and starts with `whsec_` like the first. The old one keeps signing alongside the new one for 24 hours: in that time every request carries two signatures, `v1,<new> v1,<old>`, so a server with either secret accepts it. Put the new secret on your server within the 24 hours. The verifiers above accept either signature, so there is nothing else to change. ## Network and security - Endpoint URLs must use `https://` on port 443. Other ports are refused. - AppliFlo won't send to private, loopback or link-local addresses, and doesn't follow redirects. It checks the URL when you save it and looks up your host's address again before every attempt, so a name that later points at a private address is refused too. - Requests don't come from fixed IP addresses, so don't rely on an IP allowlist. Check the signature instead. - Keep the secret on your server. Anyone with it can sign requests your server will accept. If it leaks, rotate it. ## Test your endpoint 1. Click **Send test event** in the endpoint's delivery log. AppliFlo sends a signed `webhook.test` event straight away. 2. Check the log. A `2xx` means your URL and your signature check both work. 3. For real events, send yourself an envelope and sign it. You get `envelope.sent`, `envelope.viewed`, `envelope.signed` and `envelope.completed`. To work on your own machine, expose your local server through an HTTPS tunnel and add the tunnel's URL as an endpoint. Remove the endpoint when you are done. Source: https://dev.appliflo.com/webhooks --- # Sandbox > A test workspace for trying the API without sending real email. Coming soon, with a waitlist. > **Coming soon** > > The sandbox is not live yet. Nothing on this page works today. The sandbox will be a test workspace where you can try every call, including sends, without emailing anyone. ## What you can use today Every call that does not email anyone is safe to try on your own workspace: - [Fill a PDF in one call](https://dev.appliflo.com/guides/fill-one-call), or [upload, detect and fill](https://dev.appliflo.com/guides/upload-detect-fill). Nothing is sent. - Make keys with only the **Read** and **Create drafts** scopes while you build, so your code can't email anyone by mistake. See [API keys and scopes](https://dev.appliflo.com/guides/api-keys). - To test a send, send to your own email address. ## Hear when it ships The sandbox ships with the Embed SDK. Leave your email and we will write once, when they are live. Join the waitlist on appliflo.com: https://appliflo.com/developers#developers-waitlist Source: https://dev.appliflo.com/sandbox --- # Make a single-use session link to sign inside your app > POST /api/v1/embed/signing-sessions: Make a single-use session link to sign inside your app. `POST https://appliflo.com/api/v1/embed/signing-sessions` Embedded signing (SDK): a single-use link for one signer of a sent envelope who hasn't finished, to open with @appliflo/embed (`openSigning`) or `<AppliFloSign>` in a page served from `origin`, one of the workspace's allowed sites (Settings → API & AI apps → Embed in your app). The link works once and expires after `expires_in` seconds (300 to 900, default 600); a reused or expired link shows the expired screen and raises the `expired` event. No email is sent: your app vouches for the signer (send them with recipient `delivery: "embedded"` on POST /documents/{id}/send or /templates/{id}/send so they get no invite, reminders or code either), and the signing history and certificate record that they signed inside `origin` through this API key, with the session id. The consent step stays; no access code is asked (your app vouches for who signs, and the certificate says so). A recipient_email that matches more than one signer still to sign is 409 `recipient_ambiguous`. Business plan, or a sandbox workspace on any plan (a key kept from before the plan gates doesn't change that). With an `Idempotency-Key`, a retry never makes a second session: the link (its token) is shown only once, so the retry gets 409 `session_already_created` with the `session_id` it made. Make a new session to get a new link. Send your API key in the `Authorization: Bearer` header. Every response is JSON: `{ success, data, error }`. ## Parameters | Name | In | Required | Description | | --- | --- | --- | --- | | `Idempotency-Key` | header | no | A client-generated key scoping this request as a retry of a prior identical request. A replay within 24h returns the first response instead of repeating the side effect (e.g. a second send). The key is bound to the request it was first used with: the same key with a different body or target is refused (422, code idempotency_key_reused) | ## Request body (application/json) | Field | Type | Required | Description | | --- | --- | --- | --- | | `envelope_id` | string | yes | A sent envelope | | `recipient_id` | string | no | The signer (or give recipient_email) | | `recipient_email` | string | no | The signer's email on the envelope (or give recipient_id). Format: email | | `origin` | string | yes | Where your page is served from: exactly one of the workspace's allowed sites, `https://host[:port]` (a sandbox workspace may also allow `http://localhost[:port]` or `http://127.0.0.1[:port]` for local testing) | | `expires_in` | integer | no | Seconds until the unused link expires. 300 to 900. Default: 600 | ## Responses | Status | Description | | --- | --- | | 201 | The session. `url` holds the only copy of its token: open it, don't store or log it. | | 401 | Missing or invalid API key, or `api_key_expired` for a key past its expiry. | | 402 | `plan_feature`: embedding is on the Business plan (or use a sandbox workspace). | | 403 | The API key's workspace does not have access to this resource, or `insufficient_scope` (with `required_scope`) for a key without the scope this route needs. | | 404 | `not_found`: no such envelope or recipient in this workspace. | | 409 | `envelope_not_open` (the envelope isn't out for signing), `recipient_not_signing` (that recipient isn't a signer waiting to sign now), `recipient_ambiguous` (use recipient_id) or `session_already_created` (a retry with the same Idempotency-Key; make a new session). | | 422 | `invalid` (the body) or `origin_not_allowed` (not one of the workspace's allowed sites). | | 500 | Internal error. | ## 201 response | Field | Type | Required | Description | | --- | --- | --- | --- | | `success` | true | yes | | | `data` | object | yes | | | `data.session_id` | string | yes | | | `data.url` | string | yes | https://appliflo.com/embed/sign/<token>, /embed/fill/<token>, /embed/prepare/<token>, /embed/library/<token> or /embed/builder/<token>. Single use. Format: uri | | `data.expires_at` | string | yes | Format: date-time | See also: [Errors](https://dev.appliflo.com/guides/errors), [Rate limits](https://dev.appliflo.com/guides/rate-limits), [Idempotency](https://dev.appliflo.com/guides/idempotency). Source: https://dev.appliflo.com/api/embed/create-signing-session --- # Make a single-use session link to fill a document inside your app > POST /api/v1/embed/fill-sessions: Make a single-use session link to fill a document inside your app. `POST https://appliflo.com/api/v1/embed/fill-sessions` Embedded fill (SDK): a single-use link to fill one document, to open with @appliflo/embed (`openFill`) or `<AppliFloFill>` in a page served from `origin`, one of the workspace's allowed sites. `prefill` sets starting values by field id (GET /api/v1/documents/{id}/fields). The link works once and expires after `expires_in` seconds (300 to 900, default 600). Progress is saved as the person types (the `saved` event) and `done` fires once the fill is confirmed. Business plan, or a sandbox workspace on any plan. With an `Idempotency-Key`, a retry never makes a second session: the link (its token) is shown only once, so the retry gets 409 `session_already_created` with the `session_id` it made. Make a new session to get a new link. Send your API key in the `Authorization: Bearer` header. Every response is JSON: `{ success, data, error }`. ## Parameters | Name | In | Required | Description | | --- | --- | --- | --- | | `Idempotency-Key` | header | no | A client-generated key scoping this request as a retry of a prior identical request. A replay within 24h returns the first response instead of repeating the side effect (e.g. a second send). The key is bound to the request it was first used with: the same key with a different body or target is refused (422, code idempotency_key_reused) | ## Request body (application/json) | Field | Type | Required | Description | | --- | --- | --- | --- | | `document_id` | string | yes | | | `origin` | string | yes | Where your page is served from: exactly one of the workspace's allowed sites, `https://host[:port]` (a sandbox workspace may also allow `http://localhost[:port]` or `http://127.0.0.1[:port]` for local testing) | | `prefill` | map of string \| boolean | no | Starting values by field id (at most 500) | | `expires_in` | integer | no | Seconds until the unused link expires. 300 to 900. Default: 600 | ## Responses | Status | Description | | --- | --- | | 201 | The session. `url` holds the only copy of its token: open it, don't store or log it. | | 401 | Missing or invalid API key, or `api_key_expired` for a key past its expiry. | | 402 | `plan_feature`: embedding is on the Business plan (or use a sandbox workspace). | | 403 | The API key's workspace does not have access to this resource, or `insufficient_scope` (with `required_scope`) for a key without the scope this route needs. | | 404 | `not_found`: no such document in this workspace. | | 409 | `session_already_created`: a retry with the same Idempotency-Key. The link is shown only once; make a new session. | | 422 | `invalid` (the body, or a prefill key that isn't a field of this document) or `origin_not_allowed`. | | 500 | Internal error. | ## 201 response | Field | Type | Required | Description | | --- | --- | --- | --- | | `success` | true | yes | | | `data` | object | yes | | | `data.session_id` | string | yes | | | `data.url` | string | yes | https://appliflo.com/embed/sign/<token>, /embed/fill/<token>, /embed/prepare/<token>, /embed/library/<token> or /embed/builder/<token>. Single use. Format: uri | | `data.expires_at` | string | yes | Format: date-time | See also: [Errors](https://dev.appliflo.com/guides/errors), [Rate limits](https://dev.appliflo.com/guides/rate-limits), [Idempotency](https://dev.appliflo.com/guides/idempotency). Source: https://dev.appliflo.com/api/embed/create-fill-session --- # Make a single-use session link for a member to prepare and send inside your app > POST /api/v1/embed/prepare-sessions: Make a single-use session link for a member to prepare and send inside your app. `POST https://appliflo.com/api/v1/embed/prepare-sessions` Embedded Prepare (SDK): a single-use link for a named workspace member (`member_email` or `member_id`) to upload a PDF (or open the draft `document_id`), let AI find and assign the boxes, and send, inside a page served from `origin`, one of the workspace's allowed sites. Open it with @appliflo/embed (`openPrepare`) or `<AppliFloPrepare>`. The screen acts as that member, with their own role and permissions (never the key's); the activity log records that it happened embedded, with the origin, the session and the key. `prefill` starts the screen with the client's details and the recipients. Browser events: `ready`, `uploaded`, `detected`, `sent` (with envelope_id), `expired`. The link works once and expires after `expires_in` seconds (300 to 900, default 600); after it opens the member has 2 hours. The key needs the `send` scope, because the screen can send. Business plan, or a sandbox workspace on any plan. With an `Idempotency-Key`, a retry never makes a second session: it gets 409 `session_already_created` with the `session_id` it made. Send your API key in the `Authorization: Bearer` header. Every response is JSON: `{ success, data, error }`. ## Parameters | Name | In | Required | Description | | --- | --- | --- | --- | | `Idempotency-Key` | header | no | A client-generated key scoping this request as a retry of a prior identical request. A replay within 24h returns the first response instead of repeating the side effect (e.g. a second send). The key is bound to the request it was first used with: the same key with a different body or target is refused (422, code idempotency_key_reused) | ## Request body (application/json) | Field | Type | Required | Description | | --- | --- | --- | --- | | `member_email` | string | no | The workspace member the screen acts as (or member_id). They must be an active member who can edit documents; the screen uses their own role and permissions, never the key's. Format: email | | `member_id` | string | no | The member's user id (or member_email) | | `origin` | string | yes | Where your page is served from: exactly one of the workspace's allowed sites, `https://host[:port]` (a sandbox workspace may also allow `http://localhost[:port]` or `http://127.0.0.1[:port]` for local testing) | | `document_id` | string | no | Open this draft (one the member can edit). Without it the screen starts at upload | | `prefill` | object | no | | | `prefill.client_fields` | map of string | no | The client's details, {key: value} (at most 200): AI maps them onto the form's boxes | | `prefill.recipients` | object[] | no | Up to 20 items | | `prefill.recipients[].name` | string | yes | | | `prefill.recipients[].email` | string | yes | Format: email | | `prefill.recipients[].role` | string | no | The role they fill, e.g. Client | | `prefill.recipients[].delivery` | string | no | email (default) or embedded: never emailed; your app signs them with a signing session. One of: email, embedded | | `expires_in` | integer | no | Seconds until the unused link expires. 300 to 900. Default: 600 | ## Responses | Status | Description | | --- | --- | | 201 | The session. `url` holds the only copy of its token: open it, don't store or log it. | | 401 | Missing or invalid API key, or `api_key_expired` for a key past its expiry. | | 402 | `plan_feature`: embedding is on the Business plan (or use a sandbox workspace). | | 403 | The API key's workspace does not have access to this resource, or `insufficient_scope` (with `required_scope`) for a key without the scope this route needs. | | 404 | `not_found`: no such member in this workspace, or no draft with that id the member can edit. | | 409 | `document_not_draft` (document_id has already gone out) or `session_already_created` (a retry with the same Idempotency-Key; make a new session). | | 422 | `invalid` (the body), `origin_not_allowed`, `member_inactive` (their account is suspended or deleted) or `member_cannot_prepare` (a viewer). | | 500 | Internal error. | ## 201 response | Field | Type | Required | Description | | --- | --- | --- | --- | | `success` | true | yes | | | `data` | object | yes | | | `data.session_id` | string | yes | | | `data.url` | string | yes | https://appliflo.com/embed/sign/<token>, /embed/fill/<token>, /embed/prepare/<token>, /embed/library/<token> or /embed/builder/<token>. Single use. Format: uri | | `data.expires_at` | string | yes | Format: date-time | See also: [Errors](https://dev.appliflo.com/guides/errors), [Rate limits](https://dev.appliflo.com/guides/rate-limits), [Idempotency](https://dev.appliflo.com/guides/idempotency). Source: https://dev.appliflo.com/api/embed/create-prepare-session --- # Make a single-use session link for a member to pick a form or template inside your app > POST /api/v1/embed/library-sessions: Make a single-use session link for a member to pick a form or template inside your app. `POST https://appliflo.com/api/v1/embed/library-sessions` Embedded library (SDK): a single-use link to the forms library picker (the workspace's saved templates, AppliFlo's contract templates and the official forms) inside a page served from `origin`, one of the workspace's allowed sites, read as a named workspace member (`member_email` or `member_id`). Open it with @appliflo/embed (`openLibrary`) or `<AppliFloLibrary>`. `filter` sets where the picker starts. Picking an item doesn't change anything in AppliFlo: it posts the browser event `chosen` with `item_id` and `kind` (official | library | saved); pass a library or official item to a builder session (`from_item_id`), or a saved template's id to `POST /api/v1/templates/{id}/send`. Browser events: `ready`, `chosen`, `expired`. The link works once and expires after `expires_in` seconds (300 to 900, default 600); after it opens the member has 2 hours. The key needs the `read` scope. Business plan, or a sandbox workspace on any plan. With an `Idempotency-Key`, a retry never makes a second session: it gets 409 `session_already_created` with the `session_id` it made. Send your API key in the `Authorization: Bearer` header. Every response is JSON: `{ success, data, error }`. ## Parameters | Name | In | Required | Description | | --- | --- | --- | --- | | `Idempotency-Key` | header | no | A client-generated key scoping this request as a retry of a prior identical request. A replay within 24h returns the first response instead of repeating the side effect (e.g. a second send). The key is bound to the request it was first used with: the same key with a different body or target is refused (422, code idempotency_key_reused) | ## Request body (application/json) | Field | Type | Required | Description | | --- | --- | --- | --- | | `member_email` | string | no | The workspace member the screen acts as (or member_id). The screen uses their own role and permissions, never the key's. Format: email | | `member_id` | string | no | The member's user id (or member_email) | | `origin` | string | yes | Where your page is served from: exactly one of the workspace's allowed sites, `https://host[:port]` (a sandbox workspace may also allow `http://localhost[:port]` or `http://127.0.0.1[:port]` for local testing) | | `filter` | object | no | Where the picker starts. It narrows the first view; it doesn't restrict what the member may pick | | `filter.kind` | string | no | official = government forms, library = AppliFlo's contract templates, saved = the workspace's own templates. One of: official, library, saved | | `filter.country` | string | no | A jurisdiction, as the library shows it, e.g. US or AU. Up to 20 characters | | `filter.category` | string | no | e.g. immigration, tax. Up to 60 characters | | `filter.query` | string | no | Search text. Up to 200 characters | | `expires_in` | integer | no | Seconds until the unused link expires. 300 to 900. Default: 600 | ## Responses | Status | Description | | --- | --- | | 201 | The session. `url` holds the only copy of its token: open it, don't store or log it. | | 401 | Missing or invalid API key, or `api_key_expired` for a key past its expiry. | | 402 | `plan_feature`: embedding is on the Business plan (or use a sandbox workspace). | | 403 | The API key's workspace does not have access to this resource, or `insufficient_scope` (with `required_scope`) for a key without the scope this route needs. | | 404 | `not_found`: no such member in this workspace. | | 409 | `session_already_created` (a retry with the same Idempotency-Key; make a new session). | | 422 | `invalid` (the body), `origin_not_allowed` or `member_inactive` (their account is suspended or deleted). | | 500 | Internal error. | ## 201 response | Field | Type | Required | Description | | --- | --- | --- | --- | | `success` | true | yes | | | `data` | object | yes | | | `data.session_id` | string | yes | | | `data.url` | string | yes | https://appliflo.com/embed/sign/<token>, /embed/fill/<token>, /embed/prepare/<token>, /embed/library/<token> or /embed/builder/<token>. Single use. Format: uri | | `data.expires_at` | string | yes | Format: date-time | See also: [Errors](https://dev.appliflo.com/guides/errors), [Rate limits](https://dev.appliflo.com/guides/rate-limits), [Idempotency](https://dev.appliflo.com/guides/idempotency). Source: https://dev.appliflo.com/api/embed/create-library-session --- # Make a single-use session link for a member to build a template inside your app > POST /api/v1/embed/builder-sessions: Make a single-use session link for a member to build a template inside your app. `POST https://appliflo.com/api/v1/embed/builder-sessions` Embedded template builder (SDK): a single-use link to the template builder (the box editor, roles, settings and finalise) inside a page served from `origin`, one of the workspace's allowed sites, acting as a named workspace member (`member_email` or `member_id`) who can build templates (an owner or admin). Name the saved template to edit (`template_id`), or start from a library item or official form (`from_item_id`): the screen makes the workspace's copy first. Open it with @appliflo/embed (`openBuilder`) or `<AppliFloBuilder>`. The screen acts as that member, with their own role (never the key's), only on that template; the activity log records that it happened embedded, with the origin, the session and the key. Finalise posts the browser event `built` with `template_id` and `template_version`; your server then sends it with `POST /api/v1/templates/{id}/send` or `create-document`. Browser events: `ready`, `built`, `expired`. The link works once and expires after `expires_in` seconds (300 to 900, default 600); after it opens the member has 2 hours. The key needs the `draft` scope. Business plan, or a sandbox workspace on any plan. With an `Idempotency-Key`, a retry never makes a second session: it gets 409 `session_already_created` with the `session_id` it made. Send your API key in the `Authorization: Bearer` header. Every response is JSON: `{ success, data, error }`. ## Parameters | Name | In | Required | Description | | --- | --- | --- | --- | | `Idempotency-Key` | header | no | A client-generated key scoping this request as a retry of a prior identical request. A replay within 24h returns the first response instead of repeating the side effect (e.g. a second send). The key is bound to the request it was first used with: the same key with a different body or target is refused (422, code idempotency_key_reused) | ## Request body (application/json) | Field | Type | Required | Description | | --- | --- | --- | --- | | `member_email` | string | no | The workspace member the screen acts as (or member_id). The screen uses their own role and permissions, never the key's. Format: email | | `member_id` | string | no | The member's user id (or member_email) | | `origin` | string | yes | Where your page is served from: exactly one of the workspace's allowed sites, `https://host[:port]` (a sandbox workspace may also allow `http://localhost[:port]` or `http://127.0.0.1[:port]` for local testing) | | `template_id` | string | no | Edit this saved template (finalise makes its next version). Or from_item_id | | `from_item_id` | string | no | Start from a library item (`lib_…`) or an official form id: the screen makes the workspace's copy first. Or template_id | | `expires_in` | integer | no | Seconds until the unused link expires. 300 to 900. Default: 600 | ## Responses | Status | Description | | --- | --- | | 201 | The session. `url` holds the only copy of its token: open it, don't store or log it. | | 401 | Missing or invalid API key, or `api_key_expired` for a key past its expiry. | | 402 | `plan_feature`: embedding is on the Business plan (or use a sandbox workspace). | | 403 | The API key's workspace does not have access to this resource, or `insufficient_scope` (with `required_scope`) for a key without the scope this route needs. | | 404 | `not_found`: no such member in this workspace, no saved template with that id, or no library item or official form with that id. | | 409 | `template_not_buildable` (a template made from a doc is edited in its doc) or `session_already_created` (a retry with the same Idempotency-Key; make a new session). | | 422 | `invalid` (the body: exactly one of template_id or from_item_id), `origin_not_allowed`, `member_inactive` (their account is suspended or deleted) or `member_cannot_build` (not an owner or admin). | | 500 | Internal error. | ## 201 response | Field | Type | Required | Description | | --- | --- | --- | --- | | `success` | true | yes | | | `data` | object | yes | | | `data.session_id` | string | yes | | | `data.url` | string | yes | https://appliflo.com/embed/sign/<token>, /embed/fill/<token>, /embed/prepare/<token>, /embed/library/<token> or /embed/builder/<token>. Single use. Format: uri | | `data.expires_at` | string | yes | Format: date-time | See also: [Errors](https://dev.appliflo.com/guides/errors), [Rate limits](https://dev.appliflo.com/guides/rate-limits), [Idempotency](https://dev.appliflo.com/guides/idempotency). Source: https://dev.appliflo.com/api/embed/create-builder-session --- # Get what an embed session produced > GET /api/v1/embed/sessions/{id}: Get what an embed session produced. `GET https://appliflo.com/api/v1/embed/sessions/{id}` One of this workspace's embed sessions, by `session_id`: whether it is open, used or expired, and what it produced. A builder session gives the `template_id` it edits and, once a version exists, its `template_version` (the last one finalised in the session, or the copy's own version), so your server sends only the template its own builder made (`POST /api/v1/templates/{id}/send`); a prepare session gives its document and the envelope it sent. Never returns the link's token. Any API key scope works (read, draft or send), so the key that made a session can always check it. Another workspace's session is 404. Send your API key in the `Authorization: Bearer` header. Every response is JSON: `{ success, data, error }`. ## Parameters | Name | In | Required | Description | | --- | --- | --- | --- | | `id` | path | yes | The session_id (es_…) a create returned | ## Responses | Status | Description | | --- | --- | | 200 | The session's status. | | 401 | Missing or invalid API key, or `api_key_expired` for a key past its expiry. | | 403 | The API key's workspace does not have access to this resource, or `insufficient_scope` (with `required_scope`) for a key without the scope this route needs. | | 404 | `not_found`: no session with that id in this workspace. | | 422 | Request failed validation. | | 500 | Internal error. | ## 200 response | Field | Type | Required | Description | | --- | --- | --- | --- | | `success` | true | yes | | | `data` | object | yes | | | `data.session_id` | string | yes | | | `data.kind` | string | yes | One of: sign, fill, prepare, library, builder | | `data.status` | string | yes | open: not opened yet and still in time; used: opened (it works once); expired: never opened, because its time ran out or it could no longer open (the member left, was suspended or lost the right; the signer can't sign any more). One of: open, used, expired | | `data.created_at` | string | yes | Format: date-time | | `data.expires_at` | string | yes | When the link stops opening. Format: date-time | | `data.used_at` | string | no | When it was opened (used sessions only). Format: date-time | | `data.member` | object \| null | yes | The member a prepare, library or builder session acts as | | `data.member.id` | string | yes | | | `data.template_id` | string \| null | no | builder: the template it edits (for from_item_id, the copy it made; null until made). Send only this one | | `data.template_version` | integer \| null | no | builder: set once a version exists: the version last finalised in this session, or, for a template the session made from a library item, that copy's own version. null before then | | `data.document_id` | string \| null | no | fill and prepare: the session's document | | `data.envelope_id` | string \| null | no | sign: its envelope; prepare: the envelope it sent (null until sent) | See also: [Errors](https://dev.appliflo.com/guides/errors), [Rate limits](https://dev.appliflo.com/guides/rate-limits), [Idempotency](https://dev.appliflo.com/guides/idempotency). Source: https://dev.appliflo.com/api/embed/get-embed-session