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