smartformify
Pricing

AI website form setup

A form backend for your AI-built website

If a site generated with Lovable, Bolt, ChatGPT, or another AI tool has a form but no submission handler, connect it to a SmartFormify endpoint. Keep the design, save responses, and configure email notifications without adding a separate form server.

Create Free EndpointView Plan Limits

If the form already has a working backend, review its setup before replacing it.

1. Create the endpoint and allow your website

  1. Create a SmartFormify account, choose Form Endpoint, and name it for this website.
  2. Copy the public submit URL from the endpoint overview. Replace the example key below with your own.
  3. Add the production domain to the allowed domains. Add localhost or a preview domain only when you need to submit from it.
  4. Configure the notification recipients and after-submission behavior in the endpoint settings.

2. Give your AI tool the integration instructions

Paste this into the tool that edits your website. Replace the submit URL first, then review the resulting changes.

Prompt for your AI website builder

Connect the existing contact form to this public SmartFormify submit URL:
https://api.smartformify.com/fe/YOUR_ENDPOINT_KEY

Keep the current design and accessible field labels. Use POST. For plain HTML,
set the form action and give each submitted field a name attribute. For a React
or JavaScript submit handler, send JSON as { "data": { "name": "...",
"email": "...", "message": "..." } } with Content-Type: application/json.
Use the real input values, not these placeholders.

For JSON submissions, disable the submit button while sending. Read the HTTP
status and the response JSON. Show success only if response.ok and result.success
are true. If result.data.redirect_url is present, navigate to it. Otherwise show
a plain-text success confirmation and reset the form. On failure, keep the
entered values and show an accessible error with a retry option. Catch network
errors and re-enable the button in a finally block. Do not expose private API
tokens. This submit URL is public; I will configure allowed domains in SmartFormify.
Do not create a second backend or change unrelated parts of the website.

3. Check the form submission code

A plain HTML form needs an action, a POST method, and named fields. SmartFormify handles the response page or configured redirect.

Plain HTML form

<form id="contact-form" action="https://api.smartformify.com/fe/YOUR_ENDPOINT_KEY" method="POST">
  <label>Name <input name="name" required></label>
  <label>Email <input type="email" name="email" required></label>
  <label>Message <textarea name="message" required></textarea></label>
  <button type="submit">Send message</button>
</form>

For a JavaScript form that stays on the page, use the HTML above and add this handler. For React or Next.js, use the framework guides below.

JavaScript submission handler

const form = document.querySelector("#contact-form");
const status = document.createElement("p");
status.setAttribute("role", "status");
form.after(status);

form.addEventListener("submit", async (event) => {
  event.preventDefault();
  const button = form.querySelector('button[type="submit"]');
  button.disabled = true;
  status.textContent = "Sending...";
  try {
    const data = Object.fromEntries(new FormData(form).entries());
    const response = await fetch("https://api.smartformify.com/fe/YOUR_ENDPOINT_KEY", {
      method: "POST",
      headers: { "Content-Type": "application/json" },
      body: JSON.stringify({ data }),
    });
    const result = await response.json();
    if (!response.ok || !result.success) {
      throw new Error(result.message || "Submission failed. Please try again.");
    }
    if (result.data?.redirect_url) {
      window.location.assign(result.data.redirect_url);
      return;
    }
    status.textContent = "Thanks, your message has been received.";
    form.reset();
  } catch (error) {
    status.textContent = error.message || "Could not send. Please try again.";
  } finally {
    button.disabled = false;
  }
});
React guideNext.js guideHTML guide

4. Test the published website

Submit a test from the published domain. Confirm that it appears in Responses and that the configured notification arrives. A success animation alone is not proof that a response was saved.

  • 401: copy the current submit URL again; the key may be wrong or have been regenerated.
  • 403: check allowed domains, endpoint restrictions, and account limits. Read the returned message.
  • 429: check the daily endpoint limit or short-term rate limit. Preserve the message so the visitor can retry.
  • Network error: check the URL, connection, and browser console. Test from an allowed domain.
  • Saved response but no email: check notification recipients and spam folders separately.

Remove temporary preview domains when testing is complete. Check your form again after changing the generated website.