Skip to content
Formward
Log inStart free

For AI assistants

Add a Formward form with your AI assistant

This page is written for AI coding assistants. Give your assistant this address, or the Markdown version, and ask it to add a form. Want it to manage several forms? Use the MCP route.

# Add a Formward form to a project: instructions for AI assistants

You are helping someone add a working form to their website or app. Formward is a European form backend: an HTML form posts to an endpoint, and Formward stores the submission and emails a notification. You do not need an SDK, a CLI, an MCP server or an API key for this. You build one link, the user opens it, and they give you back an endpoint URL.

Follow the steps in order.

## 1. What only the user can do

* Open the link you give them, in their own browser.
* Sign in to Formward, or create a free account and confirm their email address.
* Check the form on the confirm page and press the create button ("Create form" in English). Nothing is created before that.
* Copy the endpoint URL from the page that follows and paste it back to you.

Do not try to do these for them. Never ask for their Formward password, and never put an email address, a name or any other personal data in the link: notifications go to the email address of their account, and they can change that in the form settings afterwards.

## 2. Decide the fields

Read the project first, then pick the case that fits.

* One form in the project: use its inputs. Each input's name attribute becomes a field name. Skip buttons, CSRF tokens and inputs whose name starts with an underscore.
* Several forms: each form needs its own link and gets its own endpoint. Ask the user which one to start with, and do them one at a time.
* A form that already posts to a Formward endpoint (its action starts with https://forms.formward.eu/f/): do not create another form. Tell the user it is already connected and ask what they want changed.
* No form yet: propose a short field list for what the user asked for (a contact form is usually name, email and message), confirm it with them, and write the HTML after you have the endpoint.
* No access to the project: ask the user to paste the form's HTML or to list the fields they want.

Field names are lowercase letters, digits and underscores (first_name, not firstName or first-name). If an input uses another style, rename the input so both sides match.

## 3. Build the claim link

```
https://formward.eu/claim?name=<form name>&field.<name>=<type>[,<modifier>...]
```

* name: the form's name as the user will see it in their dashboard, at most 100 characters. Required.
* field.<name>: one per field, in the order they should appear, at most 30. The value is a type, then optional modifiers, separated by commas.
* mode: optional. Leave it out for a form on the user's own site. Use mode=hosted only when the user has no page to put the form on and wants Formward to host one.

Types: text, email, tel, textarea, select, radio, checkbox, number, date, rating, file.

Modifiers:

* required
* label:<text> for the label shown in the dashboard and in emails. Without it the label is made from the field name. A label cannot contain a comma.
* maxlength:<n> and minlength:<n>, for text, email, tel and textarea.
* min:<n> and max:<n>, for number.
* options:<a|b|c>, the choices of a select or radio field. These two types need it.

Percent-encode the values: a space is + or %20, the | between options is %7C. The whole query string may be at most 2000 characters. Any other parameter is rejected.

A contact form:

```
https://formward.eu/claim?name=Contact+form&field.name=text,required&field.email=email,required&field.message=textarea,required,maxlength:5000
```

A demo request with a custom label, a select, a bounded number and a checkbox:

```
https://formward.eu/claim?name=Demo+request&field.full_name=text,required,label:Full+name&field.work_email=email,required&field.team_size=select,options:1-10%7C11-50%7C51-200&field.seats=number,min:1,max:500&field.newsletter=checkbox
```

A file field needs a plan with file uploads. On a plan without them the confirm page says so and the form is created without that field.

## 4. Check the link before you share it

Request the link without following redirects and look at the status code:

```
curl -s -o /dev/null -w "%{http_code}" "<your link>"
```

* 307: the link is valid. It redirects to sign-up for you, because you are not signed in. Do not follow it.
* 400: the body is a numbered plain-text list of what is wrong (an unknown type, a bad modifier, a duplicate or badly formed field name, a missing or too long name, too many fields, an unknown parameter). Fix every item and check again.
* 429: you checked too often. Wait a minute.

If you cannot make requests, check the link against section 3 by hand.

## 5. Give the link to the user and wait

Send the user the link and tell them, in your own words: open it, sign in or create an account, review the form, press the create button, then copy the box with the endpoint address (in English it is titled "Copy and paste this back to your AI assistant") and paste it here.

Then stop and wait. Do not guess an endpoint and do not use a placeholder. The endpoint looks like https://forms.formward.eu/f/ followed by the form's id.

## 6. Connect the form and send one test

With the endpoint the user pasted:

* Set the form's action to the endpoint and its method to POST.
* Keep each input's name equal to the field name you put in the link.
* A form with a file input also needs enctype="multipart/form-data".
* If the pasted text says that file fields were not created, remove those inputs: the user's plan has no file uploads, and a post that carries a file would be refused.

```html
<form action="ENDPOINT" method="POST">
  <label>Name <input type="text" name="name" required></label>
  <label>Email <input type="email" name="email" required></label>
  <label>Message <textarea name="message" required maxlength="5000"></textarea></label>
  <button type="submit">Send</button>
</form>
```

Keep required, maxlength and similar attributes in the HTML. For a form on the user's own site the endpoint stores every named field it receives; Formward applies the field rules itself only on forms it renders (hosted pages).

Optional, and only when it fits the project:

* JavaScript submit: if the project already submits forms with fetch, post to the same endpoint with the header Accept: application/json. The answer is JSON, { "ok": true, "id": "..." } on success and { "ok": false, "error": "..." } with an error status otherwise. Details: https://formward.eu/docs/ajax.
* _redirect: a hidden input that sets where a classic (non-JavaScript) post goes after success. A path such as /thank-you is resolved against the page that sent the form. An absolute URL works only when its origin is in the form's allowed origins. Without it the visitor sees Formward's thank-you page, or the redirect set in the form settings. It is ignored for JSON requests.
* _gotcha: a honeypot. If the form already has a hidden trap field, name it _gotcha and keep it empty; a submission that fills it is filed as spam.
* _consent: only when the user has switched on a consent requirement for the form. Then add a checkbox named _consent.

The full list of special fields is at https://formward.eu/docs/fields and the status codes are at https://formward.eu/docs/responses.

Send exactly one test submission, with obviously fake values:

```
curl -s -X POST "ENDPOINT" -H "Accept: application/json" -d "name=Test&email=test@example.com&message=Test+from+setup"
```

* 200 with "ok": true: it worked. Ask the user to look for it in their Formward inbox and their email. It counts as one submission of their month, so do not send more.
* 404 "form not found": the endpoint is not the one the user pasted.
* 403 "origin not allowed": the user has limited which sites may post. The test must come from the real page, or they add the origin in the form settings.
* 429: wait a minute and try once more.

Then tell the user what you changed and that the form is live.

## 7. When to use the MCP route instead

The claim link fits one form, set up once. If the user wants you to create several forms, fetch a ready snippet for their framework, or confirm from your side that submissions arrive, pair with Formward over MCP instead: https://formward.eu/agents.