Connect with an AI assistant
This is the default way to connect a form: FormPostbox generates a prompt that contains your form’s real values, and your AI coding tool edits the existing form on your website to use them. The tool makes the code changes; FormPostbox receives each submission, stores it and tracks its email notification.
This page follows the five tasks of a real integration: get the form ready, hand the work to your AI tool, verify the first submission, fix problems, and change the form safely later.
1. Get your form ready, then copy the prompt
Complete the first-time setup in the quickstart first — a verified account email, a site and an enabled form; verify a notification recipient only if email notifications are enabled. Turnstile protection is optional; save its keys only if you want to protect the site. FormPostbox generates the prompt after it confirms the required account, origin, recipient (when notifications are enabled) and form settings.
- Open Forms → your form.
- In Connect your website, find Use AI to connect.
- Choose your target stack — HTML, React or Astro — and the language you want the instructions in.
- Select Copy AI prompt, or copy/download the full Markdown package.
Until then the panel lists exactly what is missing, with links — it deliberately does not produce a package that looks ready to use.
2. Let your AI tool edit your website
Paste the prompt (or the whole package) into Cursor, Claude Code, Codex, Lovable or a similar tool, working on the website project that contains your form. The generated text is a fixed template filled with your values — no model writes it, so the same form always produces the same instructions, and copying it changes nothing on your site. The prompt is self-contained: a tool that cannot open links or install skills can still do the work.
The package is the prompt plus the submission contract, capability boundaries and links. What the prompt asks the tool to do:
- Inspect your project and the existing form first, and keep your layout, styles, fields and reasonable validation.
- Submit to your real endpoint with the public configuration and
_intent_id. Includecf-turnstile-responseand load Turnstile only when the site has protection enabled; the unprotected prompt omits the widget, script, response field and token check. - Reuse the intent on a network retry so a message is saved once; create a new intent after a confirmed save or an explicit new message.
- When protection is enabled, load the Turnstile script once, take tokens from the widget, and renew the challenge after expiry or failure. On an unprotected site, do not add the widget or script.
- Treat the submission as saved only when the response contains
saved: true— and keep “saved” separate from the email notification. - Add tests that fit your project and report what was actually verified.
Supported stacks are HTML, React / Next.js and Astro forms. Reference material, for tools that can fetch links:
- llms.txt — a short index of FormPostbox pages for AI tools, with official links and capability boundaries.
- HTML skill, React skill, Astro skill — per-stack instructions and the same reference implementations. Each one also has a Simplified Chinese version (
.zh-CN.md). - Markdown integration guide (also in Chinese) — the submission contract in plain Markdown.
You do not need to install a skill: pasting the prompt or the package into your tool is enough. Some tools fetch links on their own, but that is a convention, not a guarantee.
Give your AI a concrete task
Append these requests to the real prompt or package copied from your workspace. They supplement that package; they do not replace its configuration and rules.
Connect an existing form
Connect my existing contact form using the FormPostbox package I provided. Keep its layout, fields and validation. Verify a real saved submission and report anything you could not test.Add a business field
Add a company string field to my existing form. Keep the package’s save confirmation, retry intent and protection rules. Verify that the new field is saved, and check a failed retry.If the integration fails, use the complete troubleshooting prompt below.
3. Verify the first submission
- Build or type-check the project if it has such a step, then publish the change.
- Send one test message from the real page where the form runs. An accepted test counts as one submission for the month.
- Open Inbox and confirm the message is listed as Saved.
- Open the message and check its separate email notification status — “saved” and the email are different outcomes, and an accepted notification is not proof of inbox delivery.
Generating or copying text changes nothing on your site, and a tool’s success report is not proof. After your tool finishes, send a test message and confirm the saved record in your inbox; the checklist inside the prompt covers the details.
4. Fix problems with a copy-ready prompt
Copy this template into the AI tool that edited your website. Let it inspect the available code and browser diagnostics first; fill in only details it cannot access. Before sharing error text or a page address, redact credentials, tokens and visitor content.
- What you see when a test message is submitted — an error message, nothing happening, or a save that is never confirmed.
- Relevant browser console errors, after removing credentials, tokens and visitor content.
- The HTTP status of the submission request and any error code from its JSON response, for example 400 with “origin”.
- The page origin and path you tested, with sensitive path values redacted and query parameters and fragments removed, plus the time.
- Review and redact these details first. Never share private keys, credentials, session cookies or visitor messages.
The FormPostbox integration on my website is not working as expected. Please inspect the form code and the request it makes when submitted, then fix the integration. Keep my existing layout, fields and the integration rules from the FormPostbox package I gave you earlier.
First inspect the available browser and project diagnostics yourself. Ask me only for information you cannot access, and distinguish verified results from anything you could not test.
What happens: [what I see when I submit a test message]
Browser console error: [relevant error text with credentials, tokens and visitor content redacted; or "none"]
Submission request: [HTTP status and any error code from the response, e.g. 400 origin]
Page tested: [origin and path, with sensitive path values redacted; remove query parameters and the fragment]
When: [date and time]
Do not ask me for private keys, credentials or session cookies, and do not put them in the code. Leave visitors’ message contents out as well.
Before sharing diagnostics, redact sensitive values in URLs and errors. Do not copy request bodies, authorization headers or full console logs.You can also work through the common errors page yourself. One common cause of an initial failure is a mismatch between the page’s allowed origin and the Cloudflare widget hostname — the Turnstile guide shows both side by side.
5. Change the form safely later
When you add a field, adjust validation or change the form’s behavior, give the same AI tool the original prompt or package plus the change you want, and let it edit. Keep the integration rules intact:
- Keep
_intent_idcreated once per message and reused on retries, and keep the saved check onsaved: true. If the site is protected, take Turnstile tokens from the widget callback; if it is unprotected, omit the widget, script, response field and token check. - Keep “saved” and the email notification separate in whatever status text the form shows.
- New fields only need a
name(1–128 characters); values are strings of at most 32768 characters, with at most 50 business fields per submission. - Never widen the allowed-origin check in the page code, and never move the submission through a server-side proxy.
- After any change, repeat task 3 — a test submission is the only proof.
What this covers — and what it does not
- Covered: browser integration with public values only — no Developer API key and no server-side proxy. It targets the same form as the code panel, so fields, limits and retry semantics match the platform exactly.
- Not covered: attachments and multipart uploads (the endpoint rejects them), reading submissions from your own servers (that is the Developer API, included with paid plans), and any endpoint for creating forms.
- For a protected site, your Cloudflare widget hostname is configured in your Cloudflare account — FormPostbox cannot verify it for you. Keep it and the allowed origin in sync; the Turnstile guide shows both.
This feature is available to every workspace that can already use its form; it adds no plan requirement, usage change or new charge. Prefer editing code by hand? The code examples page has the same reference implementations with placeholders.
Still need help? Contact support@formpostbox.com. Include the guide topic and redacted error details, without keys or visitor messages.
Browse all topics ↑