Headless: strict and loose mode

Strict mode checks submissions against the form’s schema. Loose mode accepts unknown fields and learns their schema from submitted values.

Beta

This feature is available to all accounts. Its request and response format can change without a new API version. Do not depend on it for anything you cannot update quickly.

Compare the modes

StrictLoose
Unknown fieldsRejected with “Unknown field for this form”Accepted and learned into the form’s schema before storage
Types and optionsEnforced against the schema. An option that is not configured returns 400, with a message such as tags includes an option that is not configured.Learned from the submitted values

A new Headless form starts in loose mode. A Page form must use strict mode; submitting a Page form in loose mode returns 400. Partial saves also require strict mode.

How loose mode learns fields

An array value is learned as a checkboxes field with options. A string is learned as a short_text_input, including when the field name is email. Other objects are stored as JSON strings. For a learned checkbox field, options continue to grow while the endpoint is in loose mode. When you switch the endpoint to strict mode, those options freeze.

For example, a submission with an unrecognized interests field and an array of values can teach the schema about that field:

curl -X POST https://submit.makeform.ai/f/ENDPOINT_ID \ -H "Authorization: Bearer mfh_live_YOUR_KEY" \ -H "Content-Type: application/json" \ -d '{ "name": "Ada Lovelace", "email": "[email protected]", "interests": ["research", "education"] }'

Choose a mode

Use loose mode when you want submissions to add fields to the schema as they arrive. Use strict mode when you want the form schema to validate field names, types, and options.

If the schema is locked while a loose-mode request is in flight, the request returns 409 with code schema_changed.