Skip to content

Connect

Connect a website

Every website or tool that sends submissions to a form is a source. Each source has its own endpoint address, so you can see where submissions come from, pause one, or replace it without touching the others.

On this page you will learn

  • What a source is and where to find its endpoint
  • Step by step setup for each supported platform
  • How field names, allowed websites and file uploads work
  • What visitors see after they submit
  • How to test the connection before you go live
  • How to fix the most common problems

What a source is

A source connects one website, app or tool to one form. When you add it, Formpik makes a unique key and an endpoint address built from it. Your website posts each submission to that address, and Formpik stores it under the form and runs the form's live flows.

  1. 01Your websitePosts the answers to the source endpoint.
  2. 02SourceChecks the key, allowed websites, pauses and limits.
  3. 03FormStores the answers and any files as a submission.
  4. 04FlowsEvery live flow of the form runs on it.
  5. 05DestinationsEmail, chat and webhooks get the result.
The endpoint answers your website first, then runs the flows, so a slow destination never slows down your form.

A source has one of three statuses:

StatusWhat it means
Waiting for first submissionThe source was added but nothing has arrived yet.
ReceivingAt least one submission arrived. The source shows when the last one came in.
PausedThe endpoint refuses every submission with a 403 until you resume it.

Add a source

  1. 01

    Open the form

    Open the form and go to its Connect tab, or open the Sources page.
  2. 02

    Choose a platform

    Pick where the form lives: Webflow, Framer, WordPress, Wix, Squarespace, HTML form, JavaScript or API, Zapier or Make. The platform decides which setup steps and which snippet you get.
  3. 03

    Name it and add the website

    The name is shown on every submission, so you know where it came from. The website is optional. When the form already limits its allowed websites, the website you enter is added to that list.
  4. 04

    Copy the endpoint

    Formpik shows the endpoint address with a copy button, the setup steps, a ready snippet and the table of field names your website must send.
Endpoint
POST https://formpik.com/api/in/YOUR_SOURCE_KEY

The source key is the last part of the address. It is made of lowercase letters and digits. Your plan sets how many sources a workspace can have, see Plans and limits.

Platform guides

These are the same steps the Connect tab shows for each platform.

Webflow

Point a native Webflow form at your endpoint. The Connect tab gives you the .

  1. 01

    Step 1

    In the Webflow Designer, select the Form Block and open its settings.
  2. 02

    Step 2

    Set Action to your endpoint URL and Method to POST.
  3. 03

    Step 3

    Give every input a Name that matches a field key listed below.
  4. 04

    Step 4

    In Site settings, open Custom code and paste the script below into Footer code. Your Form Block's own success and error messages then show, and its Redirect URL works.
  5. 05

    Step 5

    Publish the site and send one test submission.

Framer

Send Framer form submissions to a webhook. The Connect tab gives you the cURL command.

  1. 01

    Step 1

    Select your form in Framer and open the form's settings.
  2. 02

    Step 2

    Choose to send submissions to a webhook and paste your endpoint URL.
  3. 03

    Step 3

    Name each input after a field key listed below.
  4. 04

    Step 4

    Publish and submit the form once to see it arrive.

WordPress

Use the HTML snippet or your form plugin webhook. The Connect tab gives you the HTML snippet.

  1. 01

    Step 1

    Add the HTML snippet below to a Custom HTML block, or paste the endpoint URL into your form plugin's webhook settings.
  2. 02

    Step 2

    Keep every input name exactly the same as the field keys below.
  3. 03

    Step 3

    Update the page and send one test submission.

Wix

Embed the HTML snippet with an Embed HTML element. The Connect tab gives you the HTML snippet.

  1. 01

    Step 1

    Add an Embed HTML element where the form should appear.
  2. 02

    Step 2

    Paste the HTML snippet below into it.
  3. 03

    Step 3

    Publish the site and send one test submission.

Squarespace

Paste the HTML snippet into a Code block. The Connect tab gives you the HTML snippet.

  1. 01

    Step 1

    Add a Code block to the page.
  2. 02

    Step 2

    Paste the HTML snippet below and save.
  3. 03

    Step 3

    Publish and send one test submission.

HTML form

Any website: set the form action to your endpoint. The Connect tab gives you the HTML snippet.

  1. 01

    Step 1

    Set your form's action to the endpoint URL and its method to POST.
  2. 02

    Step 2

    Name each input after a field key listed below.
  3. 03

    Step 3

    Keep the script line and the two message lines from the snippet, so visitors stay on the page and see the right message.
  4. 04

    Step 4

    Add a hidden _redirect input if visitors should land on your own thank-you page instead.

JavaScript or API

Send JSON from your app, backend or a custom form. The Connect tab gives you the JavaScript snippet.

  1. 01

    Step 1

    Send a POST request with a JSON body to the endpoint URL.
  2. 02

    Step 2

    Use the field keys below as JSON property names.
  3. 03

    Step 3

    A 200 response means the submission was accepted and your flows are running.

Zapier or Make

Forward data from any app that Zapier or Make supports. The Connect tab gives you the cURL command.

  1. 01

    Step 1

    Add a Webhooks step that sends a POST request at the end of your Zap or scenario.
  2. 02

    Step 2

    Paste the endpoint URL and map your data to the field keys below.
  3. 03

    Step 3

    Run it once to send a test submission.

Generated snippets

For a Contact form with a name, an email, a topic, a message and a file, the Connect tab generates these snippets. Yours use your own fields and your own endpoint:

HTML
<form action="https://formpik.com/api/in/YOUR_SOURCE_KEY" method="POST" enctype="multipart/form-data">
  <label for="full_name">Full name</label>
  <input id="full_name" name="full_name" type="text" required>
  <label for="email">Email</label>
  <input id="email" name="email" type="email" required>
  <label for="topic">What can we help with?</label>
  <select id="topic" name="topic" required>
    <option value="">Choose one</option>
    <option value="sales">Sales</option>
    <option value="support">Support</option>
    <option value="other">Something else</option>
  </select>
  <label for="message">Message</label>
  <textarea id="message" name="message" rows="4" required></textarea>
  <label for="brief">Project brief</label>
  <input id="brief" name="brief" type="file" accept=".pdf">

  <!-- Spam trap: keep it hidden and empty -->
  <input type="text" name="_gotcha" tabindex="-1" autocomplete="off" style="display:none">

  <button type="submit" data-wait="Sending...">Send</button>

  <!-- Shown after sending, by the Formpik script below -->
  <p data-formpik-success hidden>Thanks, we've received your submission.</p>
  <p data-formpik-error hidden></p>
</form>
<script src="https://formpik.com/formpik.js" defer></script>

The JavaScript and cURL versions send JSON, which cannot carry files, so they leave the file field out.

Match the field names

Your website must send each answer under the key of its field, not its label. In HTML the key is the input's name, in JSON it is the property name. The Connect tab lists every key with its type and what it should look like. For the example form:

NameFieldSendsRequired
full_nameFull nameTextYes
emailEmailAn email addressYes
topicWhat can we help with?The value of one optionYes
messageMessageText, line breaks keptYes
briefProject briefA file in a multipart upload, up to 10 MB eachNo
_gotchaSpam trapHidden, leave emptyNo
  • Fields that take several values, such as checkboxes and multi-selects, end in [] in HTML: interests[]. A repeated name collects its values into a list too. In JSON, send an array.
  • Choice fields send the option value, such as sales, not the label. Flows and emails show the label.
  • Answers with names the form does not know are still stored with the submission.
  • With Learn new fields automatically on (the default), unknown names are added to the form as new fields when they arrive, up to 50 per submission. Only names made of lowercase letters, digits and underscores, up to 40 characters, are learned: company_size is learned, Company Size is only stored. Names starting with _ are never learned.
  • See Field types for the exact format of every type.

Allowed websites

Under the form's Settings, Allowed websites limits which websites may post to it. Formpik reads the website from the request's Origin header, or the host of its Referer.

  • With no websites listed, the form accepts submissions from anywhere.
  • A listed website also allows its subdomains: yourcompany.com allows www.yourcompany.com and shop.yourcompany.com. The other way round does not work, so list the main domain.
  • You can type a full address such as https://yourcompany.com/contact. Only the host is kept.
  • Requests without an Origin or Referer, such as calls from a server, Zapier or cURL, always pass.
  • Requests with a valid API key in Authorization: Bearer skip the check, and the bot check too.
  • Anything else is refused with a 403 that names the website, and browsers get no CORS headers for it.

File uploads

Files need a multipart upload: an HTML form with enctype="multipart/form-data", or a FormData body in JavaScript. JSON cannot carry files.

LimitValue
Files per submission10
Size of one file10 MB
Whole request25 MB
File name120 characters, slashes and line breaks replaced
  • Empty file inputs are ignored, so an optional upload left blank is fine.
  • The answer of a file field is the file name, or a list of names for several files.
  • Files are stored privately. Open them from the submission in your inbox, where each one opens through a link that works for 15 minutes. Webhooks and the API carry the file names, not the files.
  • Files are removed together with their submission, also when it passes the form's retention period.
JavaScript with files
const form = document.querySelector("#contact")

form.addEventListener("submit", async event => {
  event.preventDefault()

  const response = await fetch("https://formpik.com/api/in/YOUR_SOURCE_KEY", {
    method: "POST",
    body: new FormData(form)
  })
  const result = await response.json()

  form.querySelector(".status").textContent = result.message
})

Leave the Content-Type header out with FormData. The browser sets it with the boundary of the upload.

After someone sends a form

What visitors see is set per form, under After submitting in its Settings: a message, your own page, or a different page depending on their answers, with an optional short pause on the message first and your own error text.

Without the script, a form that posts to Formpik leaves the page, the way every plain form does. Visitors land on the page those settings pick, and otherwise on a short thank you page, or back on the page they came from with ?submitted=1 added. Webflow's own success and error messages never show, because Webflow only shows them for forms it sends itself.

Add the Formpik script once to keep visitors on the page instead. It sends every form whose action is a Formpik endpoint in the background, shows the button's data-wait text while it sends, and then shows the message you designed.

Before the closing body tag, or Footer code in Webflow
<script src="https://formpik.com/formpik.js" defer></script>
On your pageWhat the visitor sees
Webflow Form BlockIts own success state, with the form hidden, or its own error state. The Redirect URL in the Form Block settings still works.
data-formpik-success and data-formpik-errorInside the form: the message shows and the form is cleared for the next one. Next to the form: the form is hidden, like Webflow.
No message elementsA short line under the form with the success message from the form settings, or the reason it was not sent.
A page to go toA matching Pages by answer rule wins. Then the redirect set on your website (Webflow's Redirect URL, or a hidden _redirect input), then Go to a page. With a pause set, the message shows first.

Messages you wrote stay as they are. Formpik fills in a message element only when it is empty, or the text of an element marked data-formpik-message inside it. Put that attribute on the text of a Webflow error block (Element settings, Custom attributes) to show the form's Error message, or the exact reason, such as a paused form or too many tries, when you left it empty.

Your own steps after sending

Most forms need no code: pages by answer and answers in the address cover booking pages, personal thank you pages and prefilled calendars. For anything else, the script sends three events from the form, so one listener covers every form on the page. Each one can be stopped with event.preventDefault(), and on success you can change event.detail.message, event.detail.redirect or event.detail.delay before the visitor sees them.

EventWhendetail
formpik:submitBefore sending. Stop it to run your own checks first.values, form
formpik:successThe submission is saved and your flows are running.id, message, redirect, delay, values, form
formpik:errorIt was refused or could not be sent. status is 0 when the visitor is offline.status, message, values, form
Book a call for big budgets
<script>
  document.addEventListener("formpik:success", event => {
    if (event.detail.values.budget === "50k_plus") {
      event.detail.redirect = "https://cal.com/yourcompany/intro"
    }
  })
</script>
  • With Google Tag Manager on the page, every send also adds a formpik_success or formpik_error event to the data layer, with the form's name, so you can fire a conversion without writing code.
  • Formpik.submit(form) sends a form from your own code, for example from the last step of a multi-step form. It checks required fields first.
  • Forms on another address are picked up when they carry data-formpik, and data-formpik="off" leaves a form alone.
  • Answers still go through your flows on Formpik, so routing, AI, emails and webhooks work the same with or without the script.

Sending with your own JavaScript

Requests that send JSON, send an X-Requested-With header, or do not ask for text/html (which includes fetch with FormData) get JSON back instead of a redirect. The Formpik script reads the same answer.

200 OK
{
  "ok": true,
  "id": "sub_7k2m9x4q1w3e5r6t",
  "message": "Thanks, we've received your submission."
}

message is the form's Success message. When the form sends visitors to a page, the answer also carries redirect and redirectDelay. Errors come back with "ok": false and a message you can show as it is: the form's Error message when you set one, otherwise the exact reason. See Errors and limits.

Field errors on your website

Each field can carry rules, such as a length, the countries a visitor may pick, work emails only or dates on weekdays. With Refuse answers that break the field rules on, the endpoint refuses a submission that breaks one with a 422 and stores nothing. The answer names every field and what to fix, keyed by the field key:

422 Unprocessable Content
{
  "ok": false,
  "message": "Please check the highlighted answers and try again.",
  "reason": "Email: Use your work email address. Preferred date: Pick a Monday, Tuesday, Wednesday, Thursday or Friday",
  "errors": {
    "email": "Use your work email address",
    "preferred_date": "Pick a Monday, Tuesday, Wednesday, Thursday or Friday"
  }
}
  • The Formpik script shows each message right under its field, marks the input with aria-invalid and moves focus to the first one. Put an element with data-formpik-error-for="email" in the form to choose where the email message goes, and style .formpik-field-error to change how the messages look.
  • A message for a field the page does not have is added to the general error message, so the visitor always sees it.
  • A classic form post without the script gets a page listing every message with a link back to the form.
  • The HTML snippet carries the rules a browser can check by itself, such as lengths, patterns and earliest dates, so most problems show before anything is sent.

Check answers without sending

Every endpoint has a check-only address next to it. It takes the same answers, runs the same rules and stores nothing, so your page can tell visitors what to fix while they fill in the form. Add data-formpik-validate="live" to a form and the script checks each field as the visitor leaves it. Formpik.validate(form) checks a whole step of a multi-step form before moving on.

HTML
<form action="https://formpik.com/api/in/YOUR_SOURCE_KEY" method="POST" data-formpik-validate="live">
  ...
</form>
<script src="https://formpik.com/formpik.js" defer></script>
  • POST https://formpik.com/api/in/YOUR_SOURCE_KEY/validate answers { "ok": true, "valid": false, "errors": { ... } }, or "valid": true with no errors, whether or not the form refuses broken answers.
  • GET https://formpik.com/api/in/YOUR_SOURCE_KEY/rules lists the fields with their types, options and rules, for code that checks answers in the browser itself.
  • Blocked words and One per answer are checked only when the form is really sent, so neither address reveals your word list or whether someone already signed up.
  • Both addresses follow the allowed websites of the form, like the endpoint itself.

Spam protection

  • Spam trap field (on by default): keep the hidden _gotcha input in your form and leave it empty. People never see it, bots fill it in. A filled trap stores the submission under Spam with the reason, and no flows run.
  • Bot check: with Cloudflare Turnstile or Google reCAPTCHA chosen in the form settings, add the widget to your page. It sends cf-turnstile-response or g-recaptcha-response with the form. A missing or failed check also stores the submission as spam.
  • Spam is answered like a normal submission, so bots learn nothing. Review it under the Spam or invalid filter of the inbox, and choose Not spam on anything real, which runs its flows.
  • Limit per visitor caps submissions from one address per hour (30 by default, 0 turns it off), on top of 120 posts a minute per address for every endpoint.

More in Spam, privacy and security.

Test the connection

  1. 01

    Open the endpoint in a browser

    A GET on the address answers with the form it belongs to, such as This is the Formpik endpoint for "Contact". Send submissions with POST. A 404 means the key is wrong.
  2. 02

    Send one real submission

    Submit your live form once, or run the cURL command from the Connect tab. Use answers you recognize.
  3. 03

    Check the source

    The source changes from Waiting for first submission to Receiving and shows the time of the last submission.
  4. 04

    Check the inbox

    Open Submissions. The new submission shows its answers, the page it came from and every flow run with its steps. The inbox refreshes on its own every 30 seconds.

Troubleshooting

SymptomCauseFix
404 "This form endpoint does not exist"The key in the address is wrong, was replaced with New endpoint URL, or the source was removed.Copy the address again from the Connect tab.
403 "Submissions from ... are not allowed"The page’s website is not in the form’s allowed websites.Add the main domain under Settings, Allowed websites. Subdomains are included.
403 "This form source is paused" or "This form is paused"The source is paused, or Accept submissions is off on the form.Resume the source, or turn Accept submissions back on.
The browser console shows a CORS errorThe page is not an allowed website, so the preflight is refused.Add the website to the allowed websites.
Answers arrive but not under your fieldsThe input names differ from the field keys, for example Email instead of email.Rename the inputs to the keys in the Connect tab.
New names are stored but not added as fieldsOnly lowercase names with letters, digits and underscores are learned, or learning is off.Use names like company_size, or add the field yourself.
The file field only holds a file nameThe form was not sent as a multipart upload.Add enctype="multipart/form-data" to the form, or send FormData.
Submissions land under SpamThe spam trap was filled in, for example by autofill on a visible input, or the bot check failed.Keep _gotcha hidden and empty, and check the bot check widget is on the page.
429 "Too many submissions"More than 120 posts a minute from one address, the form’s hourly limit per visitor, or the plan’s monthly submissions.Wait and try again, raise the form’s limit, or change plan.
415 "Send the form as JSON..."The body type is not JSON, a form post or a multipart upload.Set Content-Type to application/json, or post a regular form.
A second identical submission is missingThe same answers from the same source within 10 seconds count as one.Nothing to fix. This protects against double clicks.
Visitors land on a plain Thank you pageThere is no redirect and the browser sent no page address.Add the Formpik script to keep visitors on the page, or pick Go to a page under After submitting in the form settings.

Common questions

Can one form have several sources?
Yes. Add one source per website or tool. Each gets its own endpoint and its own status, and a flow can be limited to some sources in its trigger.
Is the endpoint address a secret?
No, it sits in your page’s HTML for everyone to see. Protect a form with allowed websites, the spam trap, a bot check and the limit per visitor. Keep API keys secret instead.
Do I need an API key to send submissions?
No. An API key is only useful from your own server: it skips the allowed websites check and the bot check. Never put one in a web page. See API overview.
What happens to submissions when I pause a source?
They are refused with a 403 and not stored. Your website shows the error. Submissions that arrived before stay in the inbox.
Can I send to the endpoint from a mobile app or a backend?
Yes. Send JSON with a POST. A request without an Origin or Referer header is never blocked by allowed websites.