Reference

Templates & Fields

A Template is a saved, reusable list of Fields you want extracted from a document — one field per output column. Pass a Template's id to Start processing a batch instead of re-listing your fields on every call. You can also build a Template from a built-in preset, or skip Templates entirely and pass ad-hoc fields directly to process for a one-off run.

List templates

Returns your saved templates, each with its full, ordered field list embedded.

GET /api/v1/templates

Parameters

NameLocationTypeDescription
limitquery, optionalinteger1–100. Default 50.
page_tokenquery, optionalstringOpaque cursor from a previous response's next_page_token. See Pagination.

Possible errors

  • missing_api_key / invalid_api_key / plan_required — see Error Handling.
  • invalid_parameter — bad limit or page_token.

Create a template

Two ways to create a template in one endpoint: from scratch (optionally cloning another template's fields via base_template_id), or from a built-in preset via preset_id. Accounts are capped at 30 templates — delete an existing one before creating another once you hit the limit.

POST /api/v1/templates

Parameters

NameLocationTypeDescription
namebody (JSON)stringRequired unless preset_id is given (in which case it falls back to the preset's own name, disambiguated with a timestamp suffix if you already have a template with that name).
preset_idbody (JSON)string, optionalBuild the template (and its fields) from a built-in preset — see List presets for valid IDs.
base_template_idbody (JSON)integer, optionalOnly used when preset_id is not given — clones this existing template's fields into the new one.

Possible errors

  • missing_api_key / invalid_api_key / plan_required — see Error Handling.
  • missing_parameter (param: "name") — no name and no preset_id.
  • invalid_parameter (param: "name") — a template with this name already exists (non-preset creation path only).
  • invalid_parameter (param: "preset_id") — unknown preset ID.
  • template_limit_reached — already at the 30-template cap for this account.
  • internal_error

Update template settings

Sets a template's global format requirement (applied on top of every field's own) and its Multi-Page Merge configuration — whether multiple uploaded pages that belong to the same logical record (a multi-page lease, a stapled receipt bundle) should fold into a single output row instead of staying one row per page. Once enabled here, merge is applied automatically wherever this template is used for both processing and results — see ?merge=true on Get batch results and Export a batch (which always applies it, no opt-in needed there). Every field in the request body below is optional; only the keys you send get updated, everything else is left as-is (there's no separate draft/preview state to confirm — this call takes effect immediately, same as the web app's Template Settings dialog).

PUT /api/v1/templates/{id}/settings

Parameters

NameLocationTypeDescription
idpathintegerThe template to update.
global_format_requirementbody (JSON), optionalstringExtra instructions applied on top of every field's own format_requirement.
merge_enabledbody (JSON), optionalbooleanTurns Multi-Page Merge on/off. Every merge_* field below is meaningless while this is false.
merge_modebody (JSON), optionalstring or null"sequential" (new record when a Data Column's value changes), "key_match" (group by matching Data Column value regardless of upload order), or "fixed_count" (group every N uploads).
merge_field_namebody (JSON), optionalstring or nullThe Data Column (field name) used by sequential's value-based triggers and by key_match's grouping key.
merge_trigger_typebody (JSON), optionalstring or nullOnly for sequential: "value_change", "blank", "has_value", or "equals_value".
merge_trigger_valuebody (JSON), optionalstring or nullOnly for merge_trigger_type: "equals_value" — the text or regex to match.
merge_fixed_countbody (JSON), optionalinteger or nullOnly for merge_mode: "fixed_count" — group size, minimum 1.
merge_conflict_policybody (JSON), optionalstring or nullWhen grouped pages disagree on a field's value: "split" (one output row per page instead of merging), "first", "last", or "concat" (default).
merge_conflict_separatorbody (JSON), optionalstring or nullUsed when merge_conflict_policy: "concat", max 20 characters. null falls back to the default " / "; "" is a deliberate "no separator" choice and is stored as-is.
merge_skip_previewbody (JSON), optionalbooleanWeb-app-only concern (gates the export-preview confirmation screen) — has no effect on API behavior, since the API has no interactive preview step to skip. Settable here purely so a template's full config round-trips through this one endpoint.

Possible errors

  • missing_api_key / invalid_api_key / plan_required — see Error Handling.
  • template_not_found
  • invalid_parameter — bad merge_mode / merge_trigger_type / merge_fixed_count / merge_conflict_policy / merge_conflict_separator.
  • internal_error

Delete a template

Deletes a template and all of its fields (cascades — no separate cleanup call needed). Does not affect documents that already used this template in a past process call; their already-extracted results are untouched.

DELETE /api/v1/templates/{id}

Parameters

NameLocationTypeDescription
idpathintegerThe template to delete.

Possible errors

  • missing_api_key / invalid_api_key / plan_required — see Error Handling.
  • template_not_found
  • internal_error

List presets

Built-in field lists for common document types (invoices, receipts, bank statements, and more) — pass a preset's id as preset_id to Create a template to get a working template without hand-listing fields yourself. Presets are static configuration, not database rows — there's no way to create, edit, or delete one through the API.

GET /api/v1/presets

Parameters

NameLocationTypeDescription
categoryquery, optionalstringFilter to one category (e.g. "Finance & Accounting"). Omit to list all categories.
limitquery, optionalinteger1–100. Default 50.
page_tokenquery, optionalstringOpaque cursor from a previous response's next_page_token.

Possible errors

  • missing_api_key / invalid_api_key / plan_required — see Error Handling.
  • invalid_parameter — bad limit or page_token.

List and create fields

fields is the v1-public name for what the product UI calls "match rules" — one field per output column, in the order extraction will emit them. GET returns every field on the template, already sorted by sort_order. POST adds a new field to the end.

GET POST /api/v1/templates/{id}/fields

Parameters

NameLocationTypeDescription
idpathintegerThe template these fields belong to.
namebody (JSON), POST onlystringRequired. Must be unique within this template — see errors below.
format_requirementbody (JSON), POST onlystring, optionalFree-text hint about the expected value format (e.g. "YYYY-MM-DD", "Number").

Possible errors

  • missing_api_key / invalid_api_key / plan_required — see Error Handling.
  • template_not_found
  • missing_parameter (param: "name") — POST only.
  • duplicate_field_name — a field with this name already exists on this template.
  • internal_error

Update and delete a field

PUT renames a field (and replaces its format_requirement) — it's a full replace, not a partial patch, so include both values even if only one changed. DELETE removes it.

PUT DELETE /api/v1/templates/{id}/fields/{field_id}

Parameters

NameLocationTypeDescription
idpathintegerThe template this field belongs to.
field_idpathintegerThe field to update or delete.
namebody (JSON), PUT onlystringRequired. New name.
format_requirementbody (JSON), PUT onlystring, optionalNew format hint — omit and it's cleared to an empty string, not left unchanged.

Possible errors

  • missing_api_key / invalid_api_key / plan_required — see Error Handling.
  • template_not_found — the template doesn't exist/isn't yours, or (with a message noting this) the field_id isn't on this template.
  • missing_parameter (param: "name") — PUT only.
  • duplicate_field_name — PUT only, renaming to a name another field on this template already has.
  • internal_error

Reorder fields

Explicitly sets field order, which determines output column order in line_items and in Excel/Word exports. IDs in the list that don't belong to this template are silently ignored rather than rejecting the whole request.

PATCH /api/v1/templates/{id}/fields/order

Parameters

NameLocationTypeDescription
idpathintegerThe template to reorder.
field_idsbody (JSON)array of integersEvery field ID on this template, in the order you want them to appear. Required.

Possible errors

  • missing_api_key / invalid_api_key / plan_required — see Error Handling.
  • template_not_found
  • invalid_parameter (param: "field_ids") — not a list of integers.
  • internal_error
📮 contact email: [email protected]