AI agents

Add a Formlane form with an AI coding agent

Your coding agent can wire up a working contact form in one step. Give it the prompt below and your access key; it adds a form that posts to Formlane. No server code, no email setup.

Works with any agent that edits your code from a chat prompt, for example: Claude Code, Cursor, GitHub Copilot, v0, Lovable, Bolt.

Copy-paste prompt

Paste this into your agent's chat. Replace fl_YOUR_ACCESS_KEY with the access key from your Formlane dashboard, or let the agent ask you for it.

Prompt
Add a contact form (name, email, message) to this project using Formlane as the form backend.

- POST to https://smallwerk.com/formlane/api/submit
- Include the field access_key with the value fl_YOUR_ACCESS_KEY (public key, safe in client code).
- Include a hidden, unchecked checkbox named "botcheck" as a honeypot.
- Plain HTML form: set action to the endpoint and method POST. Optionally add a hidden field "redirect" with an absolute https URL of a thank-you page.
- JavaScript: send JSON with headers Content-Type: application/json and Accept: application/json. Show a thank-you message when the response has success: true; otherwise show a short error based on the "error" code (the "message" field is English).
- Do not add a server route, API key or email provider; Formlane stores the submission.

Full reference: https://smallwerk.com/formlane/llms.txt
  1. Sign in to Formlane and create a form. Copy its access key (fl_…).
  2. Paste the prompt into your agent and replace the placeholder key.
  3. Send a test message from your local or preview site and check it in the dashboard.

Endpoint

  • POST https://smallwerk.com/formlane/api/submit
  • Content types: application/x-www-form-urlencoded, multipart/form-data (text fields only), application/json.
  • Required: access_key. Optional: redirect, subject (email subject), email (used as reply-to).
  • CORS is open to any origin. You can restrict allowed domains per form in the dashboard.
  • Limits: 64 KB per submission, 50 fields, 10 submissions per 10 minutes per visitor and form, plus the monthly quota of your plan.

HTML form

Works on any static site. Without JavaScript the browser follows a redirect after the POST.

contact.html
<form action="https://smallwerk.com/formlane/api/submit" method="POST">
  <input type="hidden" name="access_key" value="fl_YOUR_ACCESS_KEY">
  <!-- Optional: your own thank-you page -->
  <input type="hidden" name="redirect" value="https://example.com/thanks">
  <!-- Honeypot: hidden, never checked -->
  <input type="checkbox" name="botcheck" style="display:none" tabindex="-1" autocomplete="off">

  <input type="text" name="name" placeholder="Name" required>
  <input type="email" name="email" placeholder="Email" required>
  <textarea name="message" placeholder="Message" required></textarea>
  <button type="submit">Send</button>
</form>

fetch()

For React, Next.js, Vue or AI-built apps. Send Accept: application/json to get JSON back instead of a redirect.

fetch()
const res = await fetch("https://smallwerk.com/formlane/api/submit", {
  method: "POST",
  headers: { "Content-Type": "application/json", Accept: "application/json" },
  body: JSON.stringify({ access_key: "fl_YOUR_ACCESS_KEY", name, email, message }),
});
const json = await res.json();
// success: { success: true, message: "Form submitted successfully", id }
// error:   { success: false, message, error: "invalid_key" | "rate_limited" | "limit_reached" | ... }

Honeypot

  • Add a hidden, unchecked checkbox named botcheck (_gotcha and _honey also work).
  • If a bot fills it in, Formlane answers with success and stores nothing.
  • Formlane also filters spam without a captcha, so the agent does not need to add one.

Redirect and thank-you page

  • HTML form: after the POST the browser is sent to the redirect field (absolute http(s) URL), else to the form's default redirect from the dashboard, else to a hosted thank-you page.
  • fetch() with Accept: application/json: no redirect. Read success from the JSON and show your own message.

Give your agent more context

  • llms.txt: the full endpoint reference in one plain-text file, written for AI agents
  • Docs: step-by-step guides for HTML, Next.js, Astro, Framer, Webflow, Hugo and more
  • Lovable, Bolt and v0 guide: a shorter prompt for AI app builders
  • API and MCP server: read your forms and submissions from scripts and AI agents with a read-only token

Get your access key

Free for 250 submissions a month. Submissions stored in Frankfurt.

Get your access key