Skip to Content
Documents

Fill a document's fields with values

POST
/api/v1/documents/{id}/fill

Authorization

bearerAuth
headerAuthorizationBearer <token>

Workspace API key, e.g. "Authorization: Bearer aflo_live_<64 hex chars>". Keys are hashed at rest and shown only once at creation. A key has scopes: read (GET routes), draft (create or change documents, fields and templates) and send (send, void, remind and bulk send); a call outside them gets 403 insufficient_scope. A key may expire (401 api_key_expired). Keys made before scopes existed have full access.

Path Parameters

id*string

Document id.

Header Parameters

Idempotency-Key?string

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

Lengthlength <= 255

Request Body

application/json
  1. body
values*

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

Response Body

Per-field fill results, and one result per choice group. An answer a group refuses is a 422 and nothing is stamped.

application/json
  1. response
success*boolean
data*
Example Request
curl -X POST 'https://appliflo.com/api/v1/documents/string/fill' \  -H 'Content-Type: application/json' \  -d '{  "values": {    "property1": "string",    "property2": "string"  }}'
Example Response
{  "success": true,  "data": {    "results": [      {        "field_id": "string",        "status": "filled",        "rendered_text": "string",        "font_size": 0,        "lines": 0,        "reason": "string"      }    ],    "groups": [      {        "group_id": "string",        "status": "filled",        "chosen": [          "string"        ],        "field_ids": [          "string"        ]      }    ],    "download": {      "artifact": "filled"    }  }}