> ## 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.

# Get a Form's Schema

> Fetch a form's fields and resolved CAPTCHA configuration.

Used internally by the SDK to build local validation and auto-acquire a CAPTCHA token — you generally don't need to call this directly unless you're building a fully custom UI driven off the schema.

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

### Response

<ResponseField name="form" type="object">
  The form's public configuration — `id` (the public ID, never the internal primary key), `name`, `accepting_submissions`, `schema.fields[]`, `allowed_origins`. Internal-only fields (workspace ID, CAPTCHA integration secrets) are never included.
</ResponseField>

<ResponseField name="captcha" type="object | null">
  `{ provider, siteKey, widgetMode }` if this form has CAPTCHA configured, otherwise `null`. `provider` is one of `turnstile`, `hcaptcha`, `recaptcha`.
</ResponseField>

<RequestExample>
  ```bash cURL theme={null}
  curl "https://api.raykoi.com/api/v1/forms/p/YOUR_PUBLIC_ID"
  ```
</RequestExample>

<ResponseExample>
  ```json 200 Success theme={null}
  {
    "form": {
      "id": "YOUR_PUBLIC_ID",
      "name": "Contact form",
      "accepting_submissions": true,
      "allowed_origins": [],
      "schema": {
        "fields": [
          { "id": "email", "type": "email", "label": "Email", "required": true }
        ]
      }
    },
    "captcha": { "provider": "turnstile", "siteKey": "0x4AAA...", "widgetMode": "invisible" }
  }
  ```
</ResponseExample>

## Field schema shape

Each entry in `schema.fields[]`:

<ResponseField name="id" type="string">
  Stable field identifier.
</ResponseField>

<ResponseField name="key" type="string">
  Optional override for the submission key — when present, the field's value is submitted under `key` instead of `id`.
</ResponseField>

<ResponseField name="type" type="string">
  One of `text`, `textarea`, `email`, `phone`, `number`, `select`, `multiselect`, `radio`, `checkbox`, `date`, `time`, `datetime`, `file`, `signature`, `rating`, `scale`, and others — see the SDK's `FieldType` export for the complete list.
</ResponseField>

<ResponseField name="required" type="boolean">
  Whether the field must be present and non-empty.
</ResponseField>

<ResponseField name="allowedTypes / maxSizeMB" type="string[] / number">
  File-type fields only — see [File Uploads](/essentials/file-uploads).
</ResponseField>
