Forms

The public forms API behind Zoie's embedded and hosted forms: load a form's definition, submit entries as leads (with an optional per-form API key) and list a business's services.

Zoie forms have a small public API. The embedded form widget and the hosted form page use it, and you can call it yourself, for example to send entries from your own server. There is no public API for building or editing forms. Use the form builder in the app for that (see Creating a form).

All paths are relative to https://api-us.zoie.ai.

MethodPathAuthPurpose
GET/api/v1/public/forms/{form_id}NoneLoad a form’s public definition.
POST/api/v1/public/submitFormNone, or X-Form-Api-Key once the form has a keySubmit an entry. A real entry creates a lead.
GET/api/v1/public/getServiceOptions/{business_id}NoneList the business’s services, for a Service dropdown.

Before you start

  • Form ID. A UUID. It is the form_id attribute in the form’s embed code and the last part of its share link (…/consultation-form/<business>/<form_id>).
  • Field keys. Each field is submitted under the lead field it is mapped to (for example first_name), or under its own field ID if it isn’t mapped. The REST API tab of the Publish Form panel has a Request body template with the right keys for your form. See Embedding forms.

Access rules

Form API key

Generate a key in the form’s Publish Form panel, on the REST API tab. Keys look like zfk_ followed by 43 characters. Zoie stores only a hash, so the full key is shown once. Generate new key replaces the old key straight away. A form has one key at a time, and keys don’t expire. Generating keys is limited to 5 per hour per user by default.

Once a form has a key, every submission to it must send the key in the X-Form-Api-Key header. Without it, the response is 401 with “Invalid or missing API key.”

Keep the key on your server. Never put it in browser code.

Allowed domains

A form with Allowed Domains set (on the Embed Code tab) only loads and accepts entries from those sites. Zoie reads the request’s Origin header, or Referer if there is no Origin. It ignores ports and a leading www., and *.example.com also covers every subdomain. Zoie’s own domains are always allowed. A blocked request gets 403 with the message origin_not_allowed.

  • Submissions that carry a valid X-Form-Api-Key skip this check, so server-side callers aren’t affected.
  • Loading the form has no key bypass. A request with no Origin or Referer, such as one from a server, is refused when the list is set. Take the field keys from the publish panel instead.

A form with an empty list accepts requests from anywhere.

Calling from a browser

These endpoints only answer browsers on Zoie’s own sites and on websites Zoie has registered for a business. On any other site the browser blocks the response with a CORS error. Server-to-server calls don’t send an Origin header and aren’t affected. If an embedded form fails like this on your website, ask Zoie support to register the domain for your business.

Load a form

GET /api/v1/public/forms/{form_id}

Returns the fields and styling the form widget needs to render the form.

Path parameterTypeDescription
form_idUUIDThe form’s ID.
curl "https://api-us.zoie.ai/api/v1/public/forms/6f1c2d3e-8a4b-4c1d-9e2f-0a1b2c3d4e5f"
const formId = '6f1c2d3e-8a4b-4c1d-9e2f-0a1b2c3d4e5f';
const res = await fetch(`https://api-us.zoie.ai/api/v1/public/forms/${formId}`);
const { data } = await res.json();
console.log(data.fields);

Response

200 OK. fields is the array of steps from the builder, and each step has its own fields. Abridged:

{
  "success": true,
  "data": {
    "id": "6f1c2d3e-8a4b-4c1d-9e2f-0a1b2c3d4e5f",
    "form_title": "Get Free Consultation",
    "form_subtitle": "All-in-One Solutions - Done Right, All in One Place.",
    "fields": [
      {
        "id": 1,
        "name": "Step 1",
        "isConditional": false,
        "conditions": [],
        "fields": [
          { "id": "first_name", "label": "First Name", "type": "text", "required": true, "mappedFieldName": "first_name" },
          { "id": "email", "label": "Email Address", "type": "email", "required": true, "mappedFieldName": "email" }
        ]
      }
    ],
    "status": "published",
    "primary_color": "#3900DB",
    "background_color": "#FBFBFB",
    "background_image": null,
    "background_type": "color",
    "font_family": "Arial",
    "overlay_opacity": 10,
    "collect_abandoned_leads": false,
    "Business": {
      "id": 42,
      "business_logo": "https://example.com/logo.png",
      "business_name": "Bright Smile Dental"
    }
  }
}

Only these fields are returned. Share URLs, allowed domains and API-key details are never included. Business.id is the ID to pass to List services.

Errors

StatusmessageCause
403origin_not_allowedThe form has Allowed Domains and the request came from somewhere else, or had no Origin or Referer.
404Form not foundNo form has this ID.
500Server errorAlso returned when form_id isn’t a valid UUID.

Submit an entry

POST /api/v1/public/submitForm
HeaderRequiredValue
Content-TypeYesapplication/json
X-Form-Api-KeyWhen the form has a keyThe form’s API key.

Body

FieldTypeRequiredDescription
formIdstring (UUID)YesThe form to submit to.
leadDetailsobjectYesThe entry, keyed by field key. You can also leave this out and put the field keys at the top level of the body, next to formId.
form_statusstringNoStored on the lead. The form widget sends Form Sent. Any value containing abandon (for example Abandoned Form) marks a partial capture.
lead_typestringNoDefaults to Form_Lead. Leave it out unless you have a reason to change it.
company_websitestringNoAnti-bot honeypot. Leave it out or empty. If it has a value, Zoie answers with success and saves nothing.
cf_turnstile_tokenstringNoA Cloudflare Turnstile token. It is checked only when Turnstile verification is switched on for the platform, and ignored otherwise.

Lead fields

These keys in leadDetails fill the matching lead fields:

KeyLead field
first_name or firstnameFirst name
last_name or lastnameLast name
emailEmail
phone_number or phonePhone number, normalised to E.164 (for example +15551234567)
titleTitle
serviceService. If it matches the name of one of the business’s services and you don’t send service_value, that service’s price is copied to the lead’s service value.
service_valueService value
additional_notes, inquiry or messageNotes
locationLocation
website_nameWebsite name
ip_addressThe visitor’s IP address. It defaults to the caller’s IP, so a server relaying entries should pass the visitor’s real IP.
utm_source, utm_medium, utm_campaign, utm_term, utm_network, utm_adgroup, utm_matchtype, utm_deviceCampaign tracking
gclid, gbraid, wbraidGoogle Ads click IDs
ad_consent_stategranted or denied
appointment_date_time, appointment_date_time_endISO 8601 timestamps

Any other key whose name matches an active custom field (ignoring case) is saved to that custom field. Other keys don’t reach the lead, but the full leadDetails object is kept with the form entry.

Example

curl -X POST "https://api-us.zoie.ai/api/v1/public/submitForm" \
  -H "Content-Type: application/json" \
  -H "X-Form-Api-Key: $ZOIE_FORM_API_KEY" \
  -d '{
    "formId": "6f1c2d3e-8a4b-4c1d-9e2f-0a1b2c3d4e5f",
    "form_status": "Form Sent",
    "leadDetails": {
      "first_name": "Jane",
      "last_name": "Smith",
      "email": "[email protected]",
      "phone_number": "+15551234567",
      "service": "Teeth Whitening",
      "utm_source": "google"
    }
  }'
// Server-side (Node 18+). Never ship the form API key to the browser.
const res = await fetch('https://api-us.zoie.ai/api/v1/public/submitForm', {
  method: 'POST',
  headers: {
    'Content-Type': 'application/json',
    'X-Form-Api-Key': process.env.ZOIE_FORM_API_KEY,
  },
  body: JSON.stringify({
    formId: '6f1c2d3e-8a4b-4c1d-9e2f-0a1b2c3d4e5f',
    form_status: 'Form Sent',
    leadDetails: {
      first_name: 'Jane',
      last_name: 'Smith',
      email: '[email protected]',
      phone_number: '+15551234567',
      service: 'Teeth Whitening',
      utm_source: 'google',
    },
  }),
});
const body = await res.json();
if (!res.ok) throw new Error(body.message);
console.log('Lead', body.data.id);

What Zoie does with an entry

  1. Checks the API key and allowed domains, as described in Access rules.
  2. Validates the entry against the form: every required field must have a value, and email fields must look like an email address. Conditional fields, and fields on conditional steps, are not checked.
  3. Runs the anti-bot checks, then checks the phone number, email and IP address against the business’s blocked list.
  4. Creates the lead with status New, marks it as a duplicate or related lead if the same email or phone number is already in the business, and saves the form entry.
  5. Starts AI follow-up and sends new-lead notifications, according to the business’s AI and notification settings.

The API doesn’t check whether the form is published. Any existing form ID accepts entries.

Response

201 Created. data is the new lead record, abridged here:

{
  "success": true,
  "message": "Lead created successfully from form submission.",
  "data": {
    "id": 18342,
    "business_id": 42,
    "first_name": "Jane",
    "last_name": "Smith",
    "email": "[email protected]",
    "phone_number": "+15551234567",
    "service": "Teeth Whitening",
    "service_value": "250",
    "lead_type": "Form_Lead",
    "lead_status": "New",
    "form_status": "Form Sent",
    "utm_source": "google",
    "is_duplicate": false,
    "is_related": false,
    "related_group_id": 18342,
    "created_on": "2026-10-02T09:14:07.512Z"
  }
}

Partial captures

When a visitor has typed something and leaves the page, the widget sends it with form_status: "Abandoned Form". It does this whether or not the form’s abandoned-lead capture setting is on, and the server doesn’t check that setting. A partial capture is stored as an incomplete form entry only. It skips validation and the anti-bot and blocked-list checks, and it doesn’t create a lead or start any AI. The response is 201 with "message": "Abandoned form data saved successfully." and the stored entry in data. See Abandoned form settings.

Errors

Errors have the shape { "success": false, "message": "…" }.

StatusmessageCause
400formId and leadDetails are required (or send a flat body with formId and field keys).formId is missing.
400Please correct the highlighted fields.Validation failed. An errors object maps each field key to its problem, for example { "email": "Please enter a valid email address" }.
400Bot verification failed. Please try again.Turnstile is switched on and the token was missing or invalid.
401Invalid or missing API key.The form has a key and the header is missing or wrong.
403origin_not_allowedBlocked by Allowed Domains.
403We could not submit this form. Please contact us directly.The contact is on the business’s blocked list. The wording doesn’t reveal the block, because the widget shows this message to the visitor.
404Form not found.No form has this ID.
413Submission payload exceeds maximum allowed size.leadDetails is over 256 KB.
429Too many requests, please try again later.Rate limit reached. See Limits.
500An error occurred while submitting the form.The lead wasn’t created.

List services

GET /api/v1/public/getServiceOptions/{business_id}

Lists the business’s products and services, newest first. The form widget uses it to fill a Service dropdown. Send the chosen service’s name as service when you submit.

ParameterInTypeDefaultDescription
business_idpathinteger—The business ID, from Business.id in the form.
pagequeryinteger1Page number.
limitqueryinteger10Items per page, up to 100.
curl "https://api-us.zoie.ai/api/v1/public/getServiceOptions/42?page=1&limit=50"
const res = await fetch(
  'https://api-us.zoie.ai/api/v1/public/getServiceOptions/42?page=1&limit=50'
);
const { data, pagination } = await res.json();
{
  "success": true,
  "data": [
    {
      "id": 311,
      "name": "Teeth Whitening",
      "description": "In-office whitening, about 60 minutes.",
      "price": "From $299",
      "currency_code": "USD",
      "type": "Starting at",
      "image_url": null
    }
  ],
  "pagination": { "totalRecords": 12, "currentPage": 1, "totalPages": 1 }
}
FieldDescription
priceThe price as display text, for example 250 or From $299. It is null when AI Can Share Price is off for that item, which means the business doesn’t publish the price, not that the item is free. See Products and services.
typeThe pricing type shown next to the price: Fixed, Hourly, Starting at or Custom.
StatusmessageCause
400Invalid business_id.business_id isn’t a positive whole number.
500Internal server error.—

Limits

LimitDefault
Requests to each endpoint30 per 15 minutes per IP address, counted separately for each form (or each business, for services). A server relaying entries from one IP can send 30 entries per 15 minutes to each form.
Any request to the API600 per minute per IP address.
leadDetails size256 KB.

Responses carry RateLimit and RateLimit-Policy headers. A 429 response also has a Retry-After header (in seconds) and this body:

{
  "success": false,
  "error": "Too many requests",
  "message": "Too many requests, please try again later.",
  "limit": "public-lead",
  "retryAfter": 840
}