API
Legacy form authoring API
Create and edit form drafts by API, with an fa_ key scoped to one business. Publishing stays a human action.
What an authoring key can do
A form authoring key (fa_…) creates and edits drafts in one business. It cannot publish a form, delete a form, or read or export leads. Publishing a draft is a human action taken in the dashboard, after review.
A new key defaults to create scope: it can create forms, and afterward read or edit only the forms that same key created. Choose forms scope instead to read and edit a specific list of existing form IDs, without the ability to create. Expiry is 1 to 72 hours, 24 by default. Whoever issues the key must keep forms edit permission for the key to keep working.
fa_ key is a local development credential, not a production secret. Put it in a gitignored .inflow.env at the repo root and source it per command. Do not put it in .env, or .env.local — framework env files get loaded into builds and the key can end up in the client bundle. Never commit it, never set it as a deployed environment variable, and never put it in a URL. The pk_ public key is the one that ships in browser code; the fa_ key never leaves your machine.Create a key from a form editor's Settings. The secret is shown once. Older unscoped keys are blocked from authoring operations; revoke and reissue them.
Endpoints
Base URL is https://api.inflow.build. Every request sends Authorization: Bearer $INFLOW_FORM_AUTHORING_KEY. The global body limit is 1 MiB, and responses carrying keys or definitions send Cache-Control: no-store.
| Endpoint | What it does |
|---|---|
| GET /api/form-authoring/catalog | Live JSON Schema, endpoint list, and valid field types and variants. Fetch this before writing a form — it is canonical. |
| POST /api/form-authoring/validate-definition | Checks a document and returns field-level issues without writing anything. |
| GET /api/form-authoring/forms | Lists only the forms this key may read. |
| POST /api/form-authoring/forms | Creates a new draft. Create-scope keys only. The new form stays unpublished. |
| GET /api/form-authoring/forms/:id | Returns an allowed form's effective draft definition and its current revision. |
| PUT /api/form-authoring/forms/:id | Writes an edited draft. Requires expectedRevision from the latest GET. |
Forms are a portable document: {"format":"inflow-form","version":1,"definition":{...}}. Keep it in a file and reuse that file for validation and creation, so what you validate is what you send.
source .inflow.env
curl -sS -H "Authorization: Bearer $INFLOW_FORM_AUTHORING_KEY" \
"$INFLOW_API_BASE/api/form-authoring/catalog"
curl -sS -X POST "$INFLOW_API_BASE/api/form-authoring/validate-definition" \
-H "Authorization: Bearer $INFLOW_FORM_AUTHORING_KEY" \
-H "Content-Type: application/json" \
--data-binary @form.json
curl -sS -X POST "$INFLOW_API_BASE/api/form-authoring/forms" \
-H "Authorization: Bearer $INFLOW_FORM_AUTHORING_KEY" \
-H "Content-Type: application/json" \
--data-binary @form.jsonEditing a draft
Editing is read, modify, write, with a revision check. GET the form to get its current definition and revision. Edit the definition. Add expectedRevision set to that revision at the top level of the document. PUT it back.
currentRevision. Re-GET the form, reapply your change onto the newer draft, and retry. Never retry by bumping the number to match — that silently overwrites a human's edit made in the dashboard.Mapping answers to a lead
Set mapping on an answer step, or on a field inside a composite step, to send that answer to a specific place on the lead rather than leaving it in the response list. Targets: contact.name, contact.email, contact.phone, notes, field (with a stable lowercase key, for example {"target":"field","key":"project_budget"}), and none.
Each destination may be used only once per form, including across conditional branches. Without an explicit mapping, the destination is inferred from the question's label, which breaks the first time someone rewords that label. Set it explicitly on anything you want to land in the CRM. none keeps the answer in form responses without copying it anywhere.
pk_ key, the site's production, preview, and localhost origins must be registered in inFlow under Environments. A submission from an origin that isn't registered is rejected. This is the most common reason a correctly built form returns a 403 once it's live.