Add a field to the template
Request
- Base URL: https://api.korala.ai
- URL: https://api.korala.ai/api/v1/templates/{id}/fields
- Auth: one of:
- API key in header X-API-Key
- bearer (a scheme the document does not define)
Path parameters
Request body
Links repeated text fields for the same signer. Signer edits or clears one occurrence to update every field with this valueKey. Independent of the merge variable used for prefills.
Signer role ID (optional for non-signing fields)
1-based page number (coordinate mode). Use -1 for the last page. Ignored for anchor placement.
Required for coordinate placement; ignored for anchor.
Required for coordinate placement; ignored for anchor.
Field box width in points. Korala fits a signature image inside the box, preserving its aspect ratio, then centres it, so a wide box scales the signature by width and leaves vertical padding. The box bounds the ink; it does not size it.
Field box height in points. Text, date and dropdown values render left-aligned with 4pt padding, centred against the box height, at min(12, height * 0.6) points.
Treat a value resolved from variables or defaultValue as a suggestion: the generated field stays unfilled and the signer can change the value before signing. Applies to text, date, and checkbox fields.
One signer role owns the generated field, but until that signer signs any signer able to act may fill or correct it. Refused on signature and initials fields.
Date fields only. True fills the field with the date the signer signs: the signing page shows today and the signer does not type it. False makes it an ordinary date the signer enters. Refused on any other type. Copied onto every document made from the template.
Human-readable label shown to the signer for this field
Fully-qualified name of an embedded AcroForm field in the base PDF (see GET /templates/{id}/form-fields). When set, generated document fields inherit the link and values are written through the PDF form field at completion — comb boxes, checkboxes, and length limits render natively — instead of being overlay-stamped.
For radio-group AcroForm fields: the option (export value) this field selects when checked.
Allowed values for dropdown fields. The signer picks one; fills with a value outside this list are rejected.
Maximum characters accepted at fill time. Imported automatically from AcroForm comb fields by detection.
Single-line signer input mask. Each # accepts one digit; Korala inserts every other character as a literal.
Regular expression the filled value must match (text and date fields). Rejected fills return validationMessage.
Signer-facing error when validationPattern does not match
Date fields only: format the auto-filled date is rendered in. Combines D/DD, M/MM, and YY/YYYY tokens with a consistent "-", "/", or "." separator. Copied onto generated document fields.
Point size the value is drawn at, copied onto generated document fields. Imported automatically from the base PDF's form fields; omit to fit the size to the box.
Color the value is drawn in, as #rrggbb
Horizontal alignment of the value inside the field box
Base font the value is drawn in, copied onto generated document fields. Imported from the base PDF's form fields; honored when the platform can render that face, otherwise the default font is used.
Whether the value may contain line breaks. Imported from multiline PDF form fields and copied onto generated document fields.
Semantic group key. Checkbox members sharing a groupKey are mutually exclusive (checking one clears the others) even with distinct PDF fill targets — e.g. a W-9 federal tax classification.
Require at least one member of this field's group to be selected before signing can complete.
Make this field conditionally required: on generated documents it must be filled before signing only while the referenced template field (same template, same signer role) is checked/filled — e.g. a W-9 LLC tax-classification code required only when the LLC box is checked. Refused on choose-one group members.
Narrow the condition to an exact value of the referenced field. Omit to trigger on any checked/filled state.
Literal string to locate in the rendered document for anchor placement. A field is placed at EVERY occurrence. Required when placement is "anchor". Must not contain {{ }} (reserved for merge fields). Hiding a marker (white text, or hideAnchor) leaves it in the PDF text layer, where it survives into the signed document. Anchor on text that already belongs in the document when the output must carry no implementation markers.
Horizontal offset in points applied after anchor resolution. Positive moves the field right, negative left.
Vertical offset in points applied after anchor resolution. Coordinates are top-left origin, so positive moves the field DOWN the page and negative moves it UP.
Draw a white rectangle over each visible anchor marker after resolving it (use when the anchor text is not already invisible). This hides the marker without removing it: the anchor string stays in the PDF text layer, where pdftotext, copy-paste, search and indexing still surface it in the signed document.
Match anchorText only at word boundaries. Off by default, because matching has always been a plain substring search and tightening it would silently drop fields that resolve today. Turn it on for short anchors: "By:" otherwise also matches inside "Standby:".
Word bookmark whose position locates this field. Required when placement is "bookmark", and DOCX templates only. A bookmark carries a position without carrying text, so unlike an anchor it leaves nothing in the PDF text layer, and Word keeps names unique so it always resolves to exactly one position. Use letters, digits and hyphens: the converter rewrites every other character to a hex code, so "Sig_Seller" is stored as "Sig5FSeller" and could collide with a bookmark of that literal name.
Example request
{
"pageNumber": 1,
"xPosition": 100,
"yPosition": 200,
"width": 200,
"height": 50,
"required": true,
"mergeFieldName": "client_name",
"defaultValue": "Default value",
"signingDate": true,
"label": "Your full name",
"acroFieldName": "topmostSubform[0].Page1[0].f1_01[0]",
"acroOptionValue": "married",
"options": [
"CA",
"NY"
],
"maxLength": 11,
"inputMask": "###-##-####",
"validationPattern": "^\\d{3}-\\d{2}-\\d{4}$",
"validationMessage": "Enter your SSN as XXX-XX-XXXX",
"dateFormat": "MM-DD-YYYY",
"fontSize": 9,
"textColor": "#000080",
"fontFamily": "Helvetica-Bold",
"groupKey": "fed_tax_class",
"groupRequired": true,
"requiredWhenValue": "Other",
"anchorText": "Fund Lead Signature:",
"bookmarkName": "SigSeller"
}Response
Repeated text value key, scoped to the owning signer.
1-based page number, or -1 for last page.
When true, a prefilled value is a suggestion the signer can change before signing.
One signer role owns the generated field, but until that signer signs any signer able to act may fill or correct it. Never true on signature or initials fields.
Date fields only. True fills the field with the date the signer signs: the signing page shows today and the signer does not type it. False makes it an ordinary date the signer enters. Refused on any other type. Null on a date made before the flag existed: a date on the signer’s own signature line is then the date of signing.
Human-readable label shown to the signer for this field
Embedded AcroForm field this field is linked to; generated document fields inherit the link.
For radio-group AcroForm fields: the option this field selects.
Allowed values for dropdown fields
Maximum characters accepted at fill time
Input mask where # represents one digit
Regex the filled value must match
Signer-facing error when validationPattern does not match
Date fields only: format the auto-filled date is rendered in, e.g. 'MM-DD-YYYY'
Point size the value is drawn at, copied onto generated document fields. Null fits the size to the box.
Color the value is drawn in, as #rrggbb
Horizontal alignment of the value inside the field box
Base font the value is drawn in, copied onto generated document fields
Whether the value may contain line breaks (a multiline form field)
Whether at least one member of this group must be selected
Id of the template field whose checked/filled state makes this field required on generated documents; null when unconditional
Exact controller value the condition triggers on; null means any checked/filled state
Example response
{
"inputMask": "###-##-####",
"fontSize": 9,
"textColor": "#000080",
"fontFamily": "Helvetica-Bold"
}Changes
No recorded changes to this operation across all 1 revision of this API.