Skip to content
Browse documentation

Getting Started

Hand off a form integration

Save how a published form should be installed and share one live guide with your developer or coding agent.

Open Markdown
For new setup with a coding agent or multiple businesses, start with Website integration. Its ik_ integration key can publish forms within its form access. This page covers a published form’s Connect handoff and older fa_ draft-authoring credentials, which cannot publish, delete forms, or read leads.

Author a draft with JSON

In the form editor’s Settings, download the current draft as a portable JSON document or paste/upload one to validate and preview it. Apply makes one Undo step. Review and publish separately before connecting the form to a website.

You can create a personal authoring key in Settings. The default 24-hour key creates forms and later edits only forms that key created. Or select specific existing forms for read and edit access without creation. Expiry can be 1–72 hours. You must retain forms edit permission to use it. It cannot publish forms or access leads. Copy the secret when it appears; inFlow shows it only once. Older unscoped keys are blocked and must be revoked and reissued.

An authoring key (fa_...) is a local development credential, not a production secret. Store it in a gitignored .inflow.env at the consuming repo's root and source it per command, not in .env or .env.local, since framework env files get loaded into builds and can leak into client bundles. Never commit it, never put it in a deployed environment variable or the website's source, and never paste it back into a chat. Only the pk_ public key ships in browser code.
sh
export INFLOW_FORM_AUTHORING_KEY='fa_paste_secret_here'
export INFLOW_API='https://YOUR_INFLOW_HOST'
curl -H "Authorization: Bearer $INFLOW_FORM_AUTHORING_KEY" "$INFLOW_API/api/form-authoring/catalog"
curl -X POST "$INFLOW_API/api/form-authoring/validate-definition" -H "Authorization: Bearer $INFLOW_FORM_AUTHORING_KEY" -H 'Content-Type: application/json' --data-binary @form.json
curl -X POST "$INFLOW_API/api/form-authoring/forms" -H "Authorization: Bearer $INFLOW_FORM_AUTHORING_KEY" -H 'Content-Type: application/json' --data-binary @form.json
curl -H "Authorization: Bearer $INFLOW_FORM_AUTHORING_KEY" "$INFLOW_API/api/form-authoring/forms/FORM_ID"
curl -X PUT "$INFLOW_API/api/form-authoring/forms/FORM_ID" -H "Authorization: Bearer $INFLOW_FORM_AUTHORING_KEY" -H 'Content-Type: application/json' --data-binary @form-with-revision.json
Use the revision returned by GET for PUT. A stale revision returns 409, so fetch the latest draft before retrying. New forms stay unpublished; open editorUrl from the response to review and publish. The catalog supplies the canonical schema and practical field rules.

To choose where an answer appears on a lead, set its mapping in the editor or portable JSON: mapping: { target: "contact.email" }, or mapping: { target: "field", key: "project_budget" } for a custom field. Destinations include contact name, email, phone, notes, custom field, and response only. A destination stays stable when you rename a question. Leaving mapping unset keeps older automatic name/variant matching; response only keeps the answer in form responses without copying it to lead summary fields. Each explicit destination must be unique and match its answer type. Review mapping changes with the form owner before publishing; then see projected values in the lead’s contact, notes, or custom fields.

Create the handoff

  1. 1Publish the form you want visitors to use. The integration guide always reads the live version, not an unpublished draft.
  2. 2Open the form’s Connect section. Choose the inFlow design or your site’s design, then choose HTML or React. For the inFlow design, choose inline, popup, or full-page placement.
  3. 3Save setup choices, then copy the integration link. Share it with your developer or coding agent. The link includes a public pk_ key and requires no account sign-in.
  4. 4Register your live and development website origins in Domains & environments (Settings → Connections), including localhost if you test there, before submitting test leads.
The link is for integration collaborators. It contains a public key and the published form definition, so share it intentionally. It cannot edit your form or expose a secret sk_ key.

What the guide contains

The page includes the saved design, framework, and placement choices; ready-to-use code; stable field IDs and requirements; published form details; and a contract hash. A Markdown version is available for coding agents.

If you publish different required questions, field types, or option IDs, reopen the link and compare the contract hash. Custom site code may need updating. Existing widget embeds read the current published form automatically.

Choose the right design

ChoiceBest forResponsibility
inFlow designA ready-made form that follows your site appearanceAdd the widget code and register site origins
Your site’s designA fully custom formBuild controls and handle validation, submission, errors, redirects, and analytics
The custom-site starter example does not implement every advanced form behavior. Review any limitation notice and the published definition before shipping.

Custom website quickstart

Use the saved integration page’s generated example as your starting point. For a custom form, style native controls with your own CSS and give every input an accessible label. Keep stable step, nested field, and option IDs from the published definition; labels are display text and can change.

js
const response = await fetch("https://api.inflow.build/api/leads", {
  method: "POST",
  headers: {
    "Content-Type": "application/json",
    Authorization: "Bearer pk_your_public_key",
  },
  body: JSON.stringify({
    submissionVersion: 2,
    formId: "FORM_ID",
    source: "website",
    responses: [
      { stepId: "name-step-id", stepTitle: "Name", type: "text", variant: "short", textValue: "Alex" },
      { stepId: "budget-step-id", stepTitle: "Budget", type: "number", variant: "input", numberValue: 0 },
      { stepId: "consent-step-id", stepTitle: "Consent", type: "boolean", variant: "toggle", booleanValue: false },
    ],
  }),
});
const result = await response.json();
if (!response.ok || !result.success) throw new Error(result.message || "Could not send");

For a composite step, send one top-level response with compositeValues containing its nested field responses. For a choice, send selectedOptions with the published option IDs and labels. A one-of-group requirement needs at least one answered field in that group. Treat numeric 0 and boolean false as real answers, not missing values.

Submit from the visitor’s browser with the public key, after registering that browser origin under Domains & environments. Disable repeat submits while pending, show success or the server error, and keep answers in place when a request fails. Test a real submission and confirm it appears in the right business. Review required fields, conditions, redirects, hidden metadata, and analytics when the published contract changes.