embedio
Cómo funcionaMódulosPrecios
enes
Iniciar sesión
Comenzar

Primeros pasos

Primeros pasosSDK y fragmento de inserción

Conexiones y automatización

ConexionesValidacionesAcciones de respuestaReglas del formulario

Referencia

Referencia de API

Personalización

Personalización del widget

Desarrolladores

Validaciones

Rechaza envíos no válidos antes de que se almacenen, con reglas a nivel de campo.

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

Documentos relacionados

ConexionesAcciones de respuestaReglas del formulario

Contenido

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

Tu sitio web. Nuestro backend.

Producto

  • Módulos
  • Precios
  • Registro de cambios
  • Estado

Desarrolladores

  • Documentación
  • Primeros pasos
  • Referencia de API
  • SDK
  • Conexiones
  • Personalización del widget

Empresa

  • Nosotros
  • Blog
  • Contacto

© 2026 embedio. Todos los derechos reservados.

Política de privacidadTérminos de servicioUso aceptableDivulgación sobre IA
GitHubX