Skip to Content
Saved templates

Create a document from a saved template

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.

POST
/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.

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

Saved template id from GET /saved-templates.

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
name?string

Defaults to the template's name.

Length1 <= length <= 255

Response Body

The new draft document.

application/json
  1. response
success*boolean
data*
Example Request
curl -X POST 'https://appliflo.com/api/v1/saved-templates/string/create-document' \  -H 'Content-Type: application/json' \  -d '{}'
Example Response
{  "success": true,  "data": {    "document_id": "string",    "template_id": "string",    "name": "string",    "field_count": 0,    "roles": [      {        "key": "string",        "label": "string"      }    ],    "fields": [      {        "field_id": "string",        "label": "string",        "semantic_type": "string",        "page": 0,        "role": "string"      }    ]  }}