# 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).
