# 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_<slug>). 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 <name> 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).
