Folia
API

Intake forms

What a published form looks like over the API, how each question type wants its answer, and what happens after you submit.

An intake form is an ordered list of typed questions that a planner publishes under a public token. Rendering one yourself is two calls: read the form, then post the answers.

Reading a form

GET /public/forms/{token} returns the published definition — heading, intro, successMessage, redirectUrl, questions, and design:

{
  "data": {
    "id": "…",
    "heading": "Tell us about your day",
    "intro": null,
    "successMessage": "Thanks — we'll be in touch within two business days.",
    "redirectUrl": null,
    "questions": [
      { "id": "3f1c…", "label": "Your name", "helpText": null, "type": "short_text", "required": true, "options": [], "autocomplete": "name" },
      { "id": "9a40…", "label": "Email", "helpText": null, "type": "email", "required": true, "options": [], "autocomplete": "email" },
      { "id": "c77e…", "label": "Wedding date", "helpText": "Leave blank if undecided", "type": "date", "required": false, "options": [] }
    ],
    "design": {
      "logo": { "url": "https://…/storage/v1/object/public/crm-form-assets/…/….webp", "width": 640, "height": 160 },
      "logoSize": "medium",
      "headerAlign": "left",
      "pageColor": "#f8f4ec",
      "textColor": "#000000",
      "fieldColor": "#ffffff",
      "fieldShape": "rounded",
      "buttonShape": "pill",
      "buttonColor": "#2f4a3a",
      "buttonTextColor": "#ffffff"
    }
  }
}

Order in the array is display order. Render label, helpText, and a required marker from each question; the id is what you key the answer by. When a question has autocomplete, put it on the input's autocomplete attribute so the browser can fill in the visitor's own details; off means the question asks about someone else. Fetch the form on each page load rather than caching it — planners edit live forms, and answers are validated against the questions as they are at the moment of submission.

Matching the planner's design

design is how the planner styled their hosted page and embed, from the builder's Design tab. Follow it if your page should match them, or ignore it and use your site's own look; submitting doesn't depend on it.

  • logo is null or an image to draw above the heading, with its pixel width and height so you can reserve its box before it loads. A logo file is never overwritten, so the URL is safe to cache; a new logo comes with a new URL.
  • logoSize is the height to draw the logo at — small 32px, medium 48px, large 72px — with the width following the image.
  • headerAlign lines up the logo, heading, and intro: left or center. Questions are always left-aligned.
  • pageColor is the background of the whole page, and textColor the words on it, #000000 or #ffffff. The hosted page blends a little of the background into the text for the heading and questions, and more for the intro and help text.
  • fieldColor is the inside of the answer fields, checkboxes, and unchosen Yes and No buttons, #ffffff or #000000. What's typed in a field is black on a white one and white on a black one.
  • fieldShape is the corners of the answer fields and the Yes and No buttons: boxy (square), rounded, or pill (fully round ends). Under pill, the hosted page keeps a long-answer box and an open dropdown list softly rounded, since fully round corners would cut into their text.
  • buttonShape is the submit button's corners, with the same three values.
  • buttonColor is the submit button's color, and the hosted page fills chosen answers with it too: a ticked box and the chosen Yes or No. buttonTextColor is the text on it, #ffffff or #000000.

Every color is six-digit hex in lowercase. The hosted page draws in these colors whatever the visitor's system theme. Planners will get more choices over time; they arrive as new fields and new enum values, so ignore fields you don't recognise and fall back to medium, left, and rounded for values you don't.

Answer formats

Send one entry per question in answers, keyed by question id. Optional questions may be omitted, null, or blank; required ones must carry a value. Values are trimmed and normalised on the way in, and these shapes are accepted:

typeSendNotes
short_text, phonestringUp to 2,000 characters. Line breaks are collapsed.
long_textstringUp to 20,000 characters. Line breaks are kept.
emailstringMust parse as an email address.
numbernumber or numeric string"1,200" and "$1200" are accepted; the value must be zero or more.
date"YYYY-MM-DD" stringDate only, no time.
single_selectstringOne of options, matched case-insensitively.
multi_selectarray of stringsEach one of options. Duplicates are dropped.
yes_noboolean, or "yes" / "no"Stored as a boolean.

Anything that does not fit is a 422 unprocessable with errors["answers.{id}"] set to a sentence you can show beside that question. See Errors.

Submitting

POST /api/v1/public/forms/{token}/submissions
Content-Type: application/json

{
  "answers": { "3f1c…": "Emma Stone", "9a40…": "emma@example.com", "c77e…": "2027-06-12" },
  "pageUrl": "https://www.example.com/contact"
}

pageUrl is optional and is shown to the planner alongside the submission, so they know which page the lead came from. turnstileToken is optional too; pass it if your page renders Cloudflare Turnstile.

A 201 means the submission was stored:

{ "data": { "id": "…", "successMessage": "Thanks — we'll be in touch within two business days.", "redirectUrl": null } }

Show successMessage, or if redirectUrl is set, send the visitor there instead. Both come from the form the planner configured, so a design change on their side needs no change on yours.

After the submission

From here the lead is the planner's. The submission appears in their Folia CRM, where it becomes a contact — automatically, or after the planner has looked it over. The API does not report which; the response is the same either way, so your page should treat 201 as done and not poll for anything further. If the planner has webhooks configured, their systems hear about the outcome through those — see Webhooks.