embedio
How it worksModulesPricing
enes
Sign in
Get started

Getting Started

Getting StartedSDK & Embed Snippet

Connections & Automation

ConnectionsValidationsResponse ActionsForm Rules

Reference

API Reference

Customization

Widget Customization

Developers

Validations

Reject invalid submissions before they're ever stored, with field-level rules.

How validation works

Validations reject a bad submission before it's ever stored — a missing required field, a malformed email, a value out of range. Rules run per form, right after the honeypot spam check and before duplicate/burst detection, so a bot never learns that validation exists (it still gets a silent fake success), while a real visitor sees exactly what to fix.

Validations are free on every plan — no module or premium tier required.

For safety, each form can have up to five custom regex rules. Patterns are limited to 256 characters, and regex checks are time-bounded; values longer than 10,000 characters fail regex validation.

Validation kinds

KindParameterFails when
required—the field is empty
email—the value doesn't look like an email address
min_lengtha numberthe value is shorter than the minimum (empty values pass — pair with required)
max_lengtha numberthe value is longer than the maximum
regexa patternthe value doesn't match the pattern
number_rangemin,maxthe value isn't a number in range

Adding a validation rule

  • Open the form: go to the form's detail page and select the Connections tab, then the Validations panel.
  • Name the field: use the exact field name the form submits, e.g. email or phone_number.
  • Pick a kind and parameter: kinds needing a parameter (min_length, max_length, regex, number_range) show a second input.
  • Write the message: shown to the visitor when this rule fails.
terminal
curl -X POST https://api.tryembedio.com/v1/forms/frm_xxxxxxxxxx/validations \
  -H "Authorization: Bearer sk_live_..." \
  -H "Content-Type: application/json" \
  -d '{"field": "email", "kind": "email", "param": null, "message": "Enter a valid email address."}'

What happens when validation fails

Every failing rule is collected, not just the first — a JS-embedded form gets every error at once instead of a frustrating one-at-a-time reveal. The submission is rejected with a 422 status.

RequestResponse
fetch/AJAX (Accept: application/json)422 { "error": "validation_failed", "fields": [{ "field": "email", "message": "..." }] }
Plain HTML form post422, a rendered error page telling the visitor to go back and try again

Related documents

ConnectionsResponse ActionsForm Rules

Contents

  1. How validation works
  2. Validation kinds
  3. Adding a validation rule
  4. What happens when validation fails
embedio

Your website. Our backend.

Product

  • Modules
  • Pricing
  • Changelog
  • Status

Developers

  • Docs
  • Getting started
  • API reference
  • SDK
  • Connections
  • Widget customization

Company

  • About
  • Blog
  • Contact

© 2026 embedio. All rights reserved.

Privacy PolicyTerms of ServiceAcceptable UseAI Disclosure
GitHubX