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

# Obtener formulario

> Obtener la configuración y campos de un formulario.

## Endpoint

```
GET /api/forms/{formId}
```

<Info>
  Este endpoint es **público** y no requiere autenticación.
</Info>

## Path Parameters

<ParamField path="formId" type="string" required>
  ID único del formulario
</ParamField>

<RequestExample>
  ```bash cURL theme={null}
  curl -X GET "https://app.horneross.com/api/forms/form_abc123"
  ```

  ```javascript JavaScript theme={null}
  const response = await fetch('https://app.horneross.com/api/forms/form_abc123');
  const form = await response.json();
  ```

  ```python Python theme={null}
  import requests

  response = requests.get('https://app.horneross.com/api/forms/form_abc123')
  form = response.json()
  ```
</RequestExample>

## Response

<ResponseField name="id" type="string" required>
  ID único del formulario
</ResponseField>

<ResponseField name="name" type="string" required>
  Nombre del formulario
</ResponseField>

<ResponseField name="description" type="string">
  Descripción del formulario mostrada al usuario
</ResponseField>

<ResponseField name="fields" type="array" required>
  Array de campos del formulario

  <Expandable title="Propiedades de cada campo">
    <ResponseField name="fields[].id" type="string" required>
      ID único del campo
    </ResponseField>

    <ResponseField name="fields[].name" type="string" required>
      Nombre del campo (usado como key en formValues)
    </ResponseField>

    <ResponseField name="fields[].label" type="string" required>
      Etiqueta mostrada al usuario
    </ResponseField>

    <ResponseField name="fields[].type" type="string" required>
      Tipo de campo: `text`, `email`, `phone`, `textarea`, `select`, `radio`, `checkbox`, `number`, `date`, `file`
    </ResponseField>

    <ResponseField name="fields[].required" type="boolean">
      Si el campo es obligatorio
    </ResponseField>

    <ResponseField name="fields[].placeholder" type="string">
      Texto placeholder
    </ResponseField>

    <ResponseField name="fields[].options" type="array">
      Opciones para campos select/radio/checkbox

      <Expandable title="Propiedades de option">
        <ResponseField name="fields[].options[].value" type="string">
          Valor de la opción
        </ResponseField>

        <ResponseField name="fields[].options[].label" type="string">
          Texto mostrado
        </ResponseField>
      </Expandable>
    </ResponseField>
  </Expandable>
</ResponseField>

<ResponseField name="settings" type="object">
  Configuración de UI del formulario

  <Expandable title="Propiedades de settings">
    <ResponseField name="settings.submitButtonText" type="string">
      Texto del botón de envío
    </ResponseField>

    <ResponseField name="settings.successMessage" type="string">
      Mensaje mostrado después de enviar
    </ResponseField>
  </Expandable>
</ResponseField>

<ResponseExample>
  ```json 200 - Success theme={null}
  {
    "id": "form_abc123",
    "name": "Formulario de Contacto",
    "description": "Dejanos tus datos y te contactamos",
    "fields": [
      {
        "id": "field_name",
        "name": "name",
        "label": "Nombre completo",
        "type": "text",
        "required": true,
        "placeholder": "Ingresá tu nombre"
      },
      {
        "id": "field_email",
        "name": "email",
        "label": "Email",
        "type": "email",
        "required": true,
        "placeholder": "tu@email.com"
      },
      {
        "id": "field_phone",
        "name": "phone",
        "label": "Teléfono",
        "type": "phone",
        "required": false
      },
      {
        "id": "field_message",
        "name": "message",
        "label": "Mensaje",
        "type": "textarea",
        "required": true,
        "placeholder": "¿En qué podemos ayudarte?"
      },
      {
        "id": "field_plan",
        "name": "plan",
        "label": "Plan de interés",
        "type": "select",
        "options": [
          {"value": "starter", "label": "Starter"},
          {"value": "pro", "label": "Pro"},
          {"value": "enterprise", "label": "Enterprise"}
        ],
        "required": false
      }
    ],
    "settings": {
      "submitButtonText": "Enviar consulta",
      "successMessage": "¡Gracias! Te contactaremos pronto."
    }
  }
  ```
</ResponseExample>

## Tipos de campos

| Tipo       | Descripción          |
| ---------- | -------------------- |
| `text`     | Texto libre          |
| `email`    | Email con validación |
| `phone`    | Teléfono             |
| `textarea` | Texto largo          |
| `select`   | Lista desplegable    |
| `radio`    | Opciones únicas      |
| `checkbox` | Opciones múltiples   |
| `number`   | Valor numérico       |
| `date`     | Selector de fecha    |
| `file`     | Upload de archivo    |
