If your website already has a form, it can hand its values over to a Formify public link. The visitor submits your form, lands in the Formify document with the matching fields already filled in, reviews them and signs. All it takes is an ordinary HTML form with method="POST". No API key, OAuth, JSON or server code is involved.
HTML form prefill sits between a plain public link and a full API integration. Use it when the values are things the visitor may enter and change themselves: name, email, phone, address, company, free text. When values must be trusted or locked (a price, a discount, an approved amount), create the document through the API instead. See Integration Flows.
How it works
An ordinary HTML form, on a website you have allowed in Formify
POST to the action URL of your public link303 See Other to the public link, so a refresh never re-sends the formA notice asks the visitor to check the prefilled fields
Formify does not store the submitted values when the form is posted. They travel in an encrypted token in the address the visitor is redirected to, and are written into the document only when the visitor opens it. The token is valid for 30 minutes and is removed from the address bar as soon as the document page loads.
Set it up in Formify
Prefill is off for every public link until its owner allows a website. This is done per link:
- Open Links in Formify and click the public link to open its details.
- Click HTML form prefill.
- Under Allow your website, paste the address of the page the form will be on, copied from the browser's address bar, for example
https://www.example.com/contact. Formify keeps the website part,www.example.com, and shows it before you save. - Tick the fields that this website may prefill. Nothing is ticked by default.
- Click Allow this website.
- Under Send to your developer, click Copy instructions and pass them on to the person who builds the web page. They can also be downloaded as a Markdown file.
The instructions hold everything needed to build the form: the form action URL, every allowed field with its input name and accepted values, the rules, and an example form. If you build the page yourself, Show form address and code gives you the action URL and the example form directly, and lets you download the example as a ready-to-run page.
- Only the owner of the link can add, change or remove websites. Colleagues who can see a shared link can read the settings and the instructions.
- A link can have up to 10 websites, each with its own set of allowed fields.
- Removing a website takes effect immediately, also for visitors who have submitted the form but not yet opened the document.
- To change which fields a website may prefill, use Edit fields on the website.
Set it up through the API or an AI assistant
The same settings can be read and changed through the REST API, for example right after creating the link with POST /links. A website allowed through the API shows up in the Formify app and the other way round. The endpoints are available when GET /account/capabilities reports htmlFormPrefill: true.
Read the fields that can be prefilled, the allowed websites and the form code (scope read):
curl -H "Authorization: Bearer YOUR_ACCESS_TOKEN" \ "https://docs-api.formify.eu/v1/links/LINK_ID/prefill"
Allow a website for chosen fields, or replace the fields of a website that is already allowed (scope write). The answer holds the form code and the developer instructions for that website:
curl -X POST -H "Authorization: Bearer YOUR_ACCESS_TOKEN" -H "Content-Type: application/json" \
-d '{"website": "www.example.com", "fields": ["first_name", "email"]}' \
"https://docs-api.formify.eu/v1/links/LINK_ID/prefill/websites"
Stop a website (scope write):
curl -X DELETE -H "Authorization: Bearer YOUR_ACCESS_TOKEN" \ "https://docs-api.formify.eu/v1/links/LINK_ID/prefill/websites?website=www.example.com"
- The same rules apply as in the app: only the link's owner can change websites,
www.example.comandexample.comare two different websites, and at most 10 websites per link. - The field keys are in
fields[].keyof the answer. List every field the website may fill: the list replaces the previous one. - A copy made with
POST /links/{linkId}/duplicatedoes not carry the websites over. - Through the Formify MCP server, an AI assistant can do the same with
get_link_prefill,set_link_prefill_websiteandremove_link_prefill_website. It asks you to confirm the website and the fields before it allows a website.
Full details are in the API reference.
Build the form
Copy the form action URL from Formify. Do not construct it yourself. The example below shows the shape:
<form method="POST"
action="https://docs.formify.eu/YOUR-LINK-CODE/prefill"
accept-charset="UTF-8">
<label>First name <input type="text" name="first_name"></label>
<label>Last name <input type="text" name="last_name"></label>
<label>Email <input type="email" name="email"></label>
<label>Company <input type="text" name="company"></label>
<button type="submit">Continue to agreement</button>
</form>
- Use
method="POST"and the default encoding (application/x-www-form-urlencoded). Do not setenctype="multipart/form-data". - Submit the form as a normal page navigation.
target="_blank"is fine if the document should open in a new tab. - A
fetchor XHR call does not open the document. The browser must navigate. From JavaScript, build a form and submit it:
const values = { first_name: "Anna", email: "anna@example.com" };
const form = document.createElement("form");
form.method = "POST";
form.action = "https://docs.formify.eu/YOUR-LINK-CODE/prefill";
for (const [name, value] of Object.entries(values)) {
const input = document.createElement("input");
input.type = "hidden";
input.name = name;
input.value = value;
form.appendChild(input);
}
document.body.appendChild(form);
form.submit();
Website builders that send forms with their own script, such as Webflow forms and many WordPress form plugins, do not navigate the browser to the action URL. Use a plain HTML embed with the form instead.
Input names
Each input is matched to a field in the PDF by name. The input name is derived from the field's label, which is the part of the PDF field name before the first pipe character. Any tink-* attributes after the pipe are not part of it. See PDF Form Attributes for how field names are built.
| PDF field name | Input name |
|---|---|
first_name |
first_name |
First name |
first_name |
Företagsnamn|tink-search-companyname |
foretagsnamn |
E-post|tink-format-email |
e_post |
phone|tink-format-mobile |
phone |
- The label is lower-cased, accents are removed (
å ä ö ébecomea a o e), and every other run of characters becomes a single underscore. - Posted names are normalised the same way, so
E-post,e-postande_postall address the same field. - The exact input name of every allowed field is listed in the developer instructions Formify generates for the link. Use those names.
- Two fields whose labels give the same input name cannot be prefilled. Give the fields distinct names in the PDF.
- Inputs that match no allowed field are ignored. So are empty values: a prefill never clears a default value in the document.
Values
| Field in the document | What to send |
|---|---|
| Text | Any text. Line breaks are kept in multi-line fields and become spaces in single-line fields. |
| Radio buttons | The value or the label of one option. |
| Checkbox | The value or the label of the option to tick. For a single checkbox, on, true, 1 or yes also ticks it. Repeat the input name to tick several options in a group. |
| Dropdown | The value or the label of one option. |
| List | The value or the label of each option to select. Repeat the input name for several. |
A value that matches no option is skipped and the field is left for the visitor to fill in. Control characters and invisible characters are removed from all values.
Which fields can be prefilled
Only the fields ticked for the website in Formify. Some fields can never be ticked, because Formify fills, verifies or replaces them itself:
- read-only fields and signature fields
- one-time-code verification fields (
tink-email-verification,tink-sms-verification) - BankID and organisation verification fields, and the verified data they produce (
tink-orgnumber-verification*,tink-verified-*) - ID scan triggers and scanned data (
tink-scan-id*,tink-scanned-id-*) - the automatic date (
tink-date-now), attachment upload fields and the Sign & Pay email field
Fields that only carry formatting or search attributes, such as tink-format-email or tink-search-*, can be prefilled like any other field. Note that a link which verifies the visitor's email or phone with a one-time code cannot have that email or phone prefilled, since the verified value comes from the code dialog.
Requirements for your web page
Formify checks which website the form was sent from, using the Origin header and, when the browser does not send one, the Referer header. The form is accepted only from the website allowed in Formify.
- Exact address.
example.comandwww.example.comare two different websites, and other subdomains are not included. Add each address the form is served from. Only the host name is compared: the page's path and the port do not matter. - HTTPS. The page with the form must be served over HTTPS.
- Referrer policy. The browser default works. A page that sends
Referrer-Policy: no-referrerorsame-originhides where the form came from, and the document then opens without prefill. The same applies to a form inside a sandboxed iframe. - Testing. Add
localhostas a website in Formify and serve the example page from a local web server on any port, for examplehttp://localhost:3000.127.0.0.1counts as a different address thanlocalhost. Opening the HTML file directly from disk does not work, since the browser then sends no website address. Removelocalhostagain when you are done: while it is allowed, anyone can prefill the link from a page on their own computer.
What the visitor sees
- The document opens with a notice that some fields have been filled in, asking the visitor to check them before signing.
- Prefilled values are never locked. The visitor can change every one of them.
- The history of the signed document records that fields were prefilled from a web form, from which website, and which fields. The values themselves are not logged.
- If the link asks the visitor to verify by email, SMS or BankID before opening, the prefill is applied after the verification.
Limits
| Limit | Value |
|---|---|
| Values per submission | 100 |
| Length of one value | 2 000 characters. Longer values are skipped. |
| All names and values together | About 6 000 bytes (UTF-8). What does not fit is left empty for the visitor. |
| Request body | 64 KB |
| Time to open the document | 30 minutes after the form was submitted |
| Websites per link | 10 |
Submissions are rate limited per client address. A burst is answered with 429 Too Many Requests and a Retry-After header.
Responses and troubleshooting
The visitor is always taken to the document when the link exists. If the values cannot be used, the document simply opens without prefill. The reason is given in the X-Formify-Prefill response header of the form submission, which you can read in the browser's network tab (enable "Preserve log" to keep the request after the redirect).
X-Formify-Prefill |
Meaning |
|---|---|
accepted |
The values were accepted. If a field is still empty, check its input name and, for choices, that the value matches an option. |
empty |
No posted input matched a field allowed for this website, or all values were empty or too long. |
not-allowed |
The form was not sent from a website allowed for this link. Check the exact address (including www), HTTPS, and the page's referrer policy. |
link-not-open |
The link is closed, expired or still being processed. |
disabled |
HTML form prefill is not available in this environment. |
error |
Something went wrong on Formify's side. The document opens without prefill. |
These cases answer with an error instead of a redirect:
| Status | Cause |
|---|---|
404 |
The action URL does not belong to a public link. Copy it again from Formify. |
413 |
The request body is larger than 64 KB. |
415 |
The request is not an HTML form post (application/x-www-form-urlencoded). |
429 |
Too many submissions from the same address. Retry after the time in Retry-After. |
Security and trust
A form post comes from the visitor's browser, and the visitor can change anything in it. Use prefill for details the visitor is allowed to enter themselves. Do not send prices, discounts, roles, approvals or anything else the visitor must not be able to change, and leave such fields unticked in Formify.
- Off by default. A public link can only be prefilled from websites its owner has allowed, and only for the fields ticked for that website.
- The website check stops other websites. A browser does not let one website claim to be another. It does not stop someone who sends the request from their own server and forwards the resulting link, which is why prefilled fields are always shown to the visitor, always editable and recorded in the document history.
- The action URL is not a secret. It is visible in your page's source. It works only from the allowed website.
- Treat write access accordingly. An integration or AI assistant that holds a
writetoken for your account can allow websites on your links. Every allowed website is listed in the link's HTML form prefill dialog with who added it and when. - Nothing stored before opening. Submitted values are not stored by Formify unless the visitor opens the document.
- Need trusted values? Create the document through the API from your server, where you control every value. See Integration Flows.
Good to know
- HTML form prefill works with public links. Documents sent to named recipients are prefilled through the API.
- If the document behind the link is edited and its fields change, export the developer instructions again. Inputs for fields that no longer exist are ignored.
- Each visitor who submits your form gets their own copy of the document, exactly as when opening the public link directly.