> ## Documentation Index
> Fetch the complete documentation index at: https://docs.raykoi.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Validate Form Data

> Check data against a form's schema without submitting it.

Runs the exact same validation function `submit` uses internally — there's no separate, looser "preview" validator that could disagree with what actually happens on submit.

<ParamField path="public_id" type="string" required>
  The form's public ID.
</ParamField>

<ParamField body="data" type="object" required>
  Field values to check, same shape as [Submit a Form](/api-reference/submit-form).
</ParamField>

### Response

<ResponseField name="valid" type="boolean">
  Whether the data passes every field's rules.
</ResponseField>

<ResponseField name="errors" type="array">
  Empty when `valid` is `true`. Otherwise the same per-field error shape `submit`'s `422` response returns.
</ResponseField>

<RequestExample>
  ```bash cURL theme={null}
  curl -X POST "https://api.raykoi.com/api/v1/forms/p/YOUR_PUBLIC_ID/validate" \
    -H "Content-Type: application/json" \
    -d '{"data": {"email": "not-an-email"}}'
  ```
</RequestExample>

<ResponseExample>
  ```json 200 Invalid theme={null}
  {
    "valid": false,
    "errors": [
      { "field": "email", "fieldId": "email", "message": "Enter a valid email address", "type": "pattern" }
    ]
  }
  ```
</ResponseExample>
