Related services: FormsService —
lynkow.forms.getBySlug(),lynkow.forms.submit()
Form
Interface
A public form available for submission.
Returned by GET /public/forms/:slug.
Use schema to dynamically render the form fields, settings to configure
the submit button and post-submission behavior, and the spam protection fields
to set up honeypot or reCAPTCHA if enabled.
Only forms with status: 'active' are returned by the public API.
Draft, closed, and archived forms are never returned.
Property | Type | Optional | Description |
|---|---|---|---|
|
| No | Optional form description, displayed above the form fields.<br> |
|
| Yes | Whether honeypot spam protection is enabled for this form.<br><br>When |
|
| No | Unique numeric form ID. Auto-incremented. |
|
| Yes | BCP 47 locale code of this form (e.g. |
|
| No | Form display name (e.g. |
|
| Yes | Whether Google reCAPTCHA v3 is enabled for this form.<br><br>When |
|
| Yes | Google reCAPTCHA v3 public site key, needed to render the reCAPTCHA widget.<br>Only present when |
|
| No | Ordered array of field definitions that make up the form.<br>Render these in order to build the form UI dynamically. |
|
| No | Form behavior settings (submit button text, success message, redirect). |
|
| No | URL-friendly slug, unique within the site.<br>Lowercase, hyphenated (e.g. |
|
| No | Form status. Always |
FormField
Interface
A single field definition in a form schema. Describes the input type, label, validation, and layout for one form field.
Use these to dynamically render form fields in your frontend.
Property | Type | Optional | Description |
|---|---|---|---|
|
| Yes | Pre-filled default value for the field.<br>Type depends on the field type: |
|
| Yes | Help text displayed below the input to guide the user.<br>Max 500 characters. |
|
| No | Human-readable label displayed above or beside the input.<br>Max 255 characters. Always present — use this as the |
|
| No | Field identifier, used as the key in submission data.<br>Unique within the form. Lowercase, alphanumeric with underscores or hyphens<br>(e.g. |
|
| Yes | Selectable options for |
|
| Yes | Placeholder text shown inside the input when empty.<br>Max 255 characters. |
|
| No | Whether this field must be filled before submission.<br>When |
|
| No | HTML input type for this field.<br>Determines the rendered input element and applicable validation rules. |
|
| Yes | Validation rules applied to this field's value.<br> |
|
| Yes | Layout width hint for responsive form layouts:<br>- |
FormFieldOption
Interface
A selectable option for select, radio, and checkbox field types.
Property | Type | Optional | Description |
|---|---|---|---|
|
| No | Human-readable label displayed to the user in the form UI.<br>May differ from |
|
| No | The value sent in the form submission data.<br>This is the machine-readable identifier stored in the database.<br>Must be unique within the field's options array. |
FormFieldType
TypeAlias
Supported input types for form fields.
Maps to standard HTML input types, with a few additions:
'textarea': multi-line text input (<textarea>)'select': dropdown menu (<select>) — requiresoptions'radio': radio button group — requiresoptions'checkbox': checkbox or checkbox group — usesoptionsif present, otherwise single boolean'file': file upload input — accepts files via multipart form submission'hidden': hidden input — not displayed to users, useful for tracking parameters
type FormFieldType = "text" | "email" | "tel" | "url" | "textarea" | "number" | "date" | "datetime" | "time" | "select" | "radio" | "checkbox" | "file" | "hidden"FormFieldValidation
Interface
Validation rules for a form field. Applied both client-side (for UX) and server-side (for security).
Which rules are relevant depends on the field type:
minLength/maxLength: text-based fields (text,email,textarea,url,tel)min/max:numberfields onlypattern: any text-based field — validated as a JavaScript RegExp
Property | Type | Optional | Description |
|---|---|---|---|
|
| Yes | Maximum numeric value (inclusive).<br>Only applicable to |
|
| Yes | Maximum character length for text input.<br>Applicable to |
|
| Yes | Custom error message displayed when validation fails.<br> |
|
| Yes | Minimum numeric value (inclusive).<br>Only applicable to |
|
| Yes | Minimum character length for text input.<br>Applicable to |
|
| Yes | Regular expression pattern for custom validation (e.g. |
FormSettings
Interface
Form behavior settings controlling what happens after submission.
Property | Type | Optional | Description |
|---|---|---|---|
|
| Yes | Whether double opt-in email confirmation is enabled.<br>When |
|
| Yes | URL to redirect the user to after successful submission.<br>Max 500 characters. Must be a valid URL (e.g. |
|
| No | Text displayed on the submit button (e.g. |
|
| No | Success message displayed after a successful submission.<br>Max 1000 characters. Shown inline on the page.<br><br>Ignored if |
FormSubmitData
TypeAlias
Data payload for submitting a form.
Keys correspond to FormField.name values from the form's schema.
Value types depend on the field type:
Text fields (
text,email,textarea,url,tel):stringNumber fields:
numberCheckbox (single):
booleanFile fields:
File(browser File object)Select/radio/checkbox (with options):
string(the selected option'svalue)
All fields marked as required: true in the schema must be present.
Omit optional fields or set them to empty string.
type FormSubmitData = Record<string, string | number | boolean | File>