Skip to content

Receive forms from your site

Page

Guide

Updated 13/11/2026

A form is a receiver for enquiries or requests: the visitor submits from the site, staff read, export and erase on request. It is closed by default at three layers; all three must be on.

Before you start

Layer What to do When it is off
Server CMS_FORMS_ENABLED=true, with CMS_WORKERS_ENABLED=true in production (a background job removes expired records) the route does not exist (404)
Store key the key has the forms feature 401 cms_key_invalid
Content type declare the type as a form with PUT /admin/cms/forms/{code}, permission cms.type.write: enabled and retention_days (1 to 3650, default 90) 404 cms_form_not_found

Steps

  1. Each time the form is shown, generate a new UUID as the Idempotency-Key.

  2. Send from the site’s server, not the browser, so the store key stays private:

    Terminal window
    curl -X POST "$CMS_URL/store/cms/forms/contact/submissions" \
    -H "x-publishable-api-key: $CMS_STORE_KEY" \
    -H "Idempotency-Key: $(uuidgen)" \
    -H "Content-Type: application/json" \
    -d '{"name":"…","email":"…","message":"…"}'
  3. The JSON body is at most 16 KB. Add a hidden hp field as a trap: a person leaves it empty; if it has text the CMS answers 201 but stores nothing.

  4. Sending again with the same Idempotency-Key returns 200 with the header x-idempotent-replay and creates no second record. A double click or a flaky network is therefore safe.

  5. On 429 cms_rate_limited, read Retry-After and try again. The default per-IP limit is 5 per minute and 200 per day, set in server configuration; the CMS keeps only a one-way hash, never the IP.

Visitor data

  • Records cannot be edited. Sensitive fields are stored apart and masked by default when staff view them; seeing them in clear needs the extra permission cms.report.export.
  • Records are removed when the retention period ends. To erase early on a data subject’s request: DELETE /admin/cms/forms/{code}/submissions/{id}.
  • The cms.form.submitted event carries only the record id, never what the visitor wrote.

See also

  • Forms: configuration and data life cycle.

Last updated: