Add a field
add_fieldCreate a new fillable field on a page when detection missed an input (false negative).
Coordinates (`x`, `y`, `w`, `h`) are in percentages of page width/height
(`0.0`–`100.0`, top-left origin), read off `render_preview`. Assigns a
sequential agent field ID (`p{page_index}_a{n}`) with `confidence=1.0` and
`source="agent"`, and returns the created field object. Allowed `field_type`
values: `'text'` (default), `'number'`, `'date'`, `'checkbox'`, `'radio'`,
`'signature'`, `'dropdown'`, `'field'`, or `'cell'`. Optional `align`
(`'left'`, `'center'`, `'right'`) and `vertical_align` (`'top'`, `'middle'`,
`'bottom'`) control where text sits inside the box.
Persistence & review impact: persists immediately in the active workspace
(`workspace_id`) and invalidates any prior visual review receipt for
`page_index` on ML-detected layouts. Does not alter saved account templates
unless `save_template` is called after filling.
When to use:
- Use `add_field` only to create a missing field that detection missed.
- Use `update_field` (single) or `update_fields` (batch) to move, resize,
rename, or change the type/alignment of an existing field.
- Use `remove_field` or `remove_fields` to delete false-positive fields.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| h | Yes | Height of the field box as a percentage of page height (`> 0.0` and `<= 100.0 - y`). | |
| w | Yes | Width of the field box as a percentage of page width (`> 0.0` and `<= 100.0 - x`). | |
| x | Yes | Horizontal position of the box's left edge as a percentage of page width (`0.0` to `100.0`, origin at top-left). | |
| y | Yes | Vertical position of the box's top edge as a percentage of page height (`0.0` to `100.0`, origin at top-left). | |
| name | No | Short semantic label for the field (e.g. `'applicant_full_name'`, `'signature_date'`). Stored in the workspace and in templates saved via `save_template`. | |
| align | No | Horizontal text alignment inside the box: `'left'`, `'center'`, or `'right'`. Omit or pass `None` for the default alignment. | |
| field_type | No | Field input type: `'text'` (default), `'number'`, `'date'`, `'checkbox'`, `'radio'`, `'signature'`, `'dropdown'`, `'field'`, or `'cell'`. | text |
| page_index | No | 0-based page index (`0` to `page_count - 1`) on which to place the new field. | |
| workspace_id | Yes | Active workspace ID returned by `open_pdf` (`summary.workspace_id`). | |
| vertical_align | No | Vertical text alignment inside the box: `'top'`, `'middle'`, or `'bottom'`. Omit or pass `None` for the default vertical alignment. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||