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

# Get the JSON Schema for submitting to a published form

> Returns the JSON Schema that `field_values` must satisfy when submitting an entry to a
published form — the same schema the submit endpoint validates against. Only public
fields are listed. Access follows reading the published form: if it is
password-protected, pass the password in the `X-Form-Access-Password` header.

**Required scope:** `form:respond`.




## OpenAPI

````yaml /api-reference/openapi.yaml get /api/v1/f/{form_token}/entry_schema
openapi: 3.0.1
info:
  title: FormHug API V1
  version: v1
  description: >
    FormHug public REST API. All request/response keys are snake_case.


    Successful response:


    ```json

    {
      "data": { ... }
    }

    ```


    Paginated response:


    ```json

    {
      "data": [ ... ],
      "pagination": {
        "total": 123,
        "next_cursor": "NQ=="
      }
    }

    ```


    Error response:


    ```json

    {
      "error": "Human-readable message",
      "code": "password_required",
      "error_details": [
        { "attribute": "field_name", "message": "specific error" }
      ]
    }

    ```


    `code` is a machine-readable reason, present only where a client may need to
    branch

    on it (see `CodedErrorEnvelope`). `error_details` appears on validation
    failures and

    lists each offending attribute.
servers:
  - url: https://formhug.ai
security: []
tags:
  - name: Forms
    description: Form CRUD
  - name: Attachments
    description: >-
      2-step upload for form-element images (theme, rich-text, or field-element
      images). Prepare returns an `upload_id`; consume it in a theme update,
      attachment_commitments, or the form `fields` payload depending on purpose.
  - name: Entries
    description: Entries collected by a form owned by the current user
  - name: Entry Schemas
    description: The JSON Schema a form's `field_values` must satisfy when writing an entry
  - name: Folders
    description: Folder CRUD
  - name: Participated Forms
    description: Forms the current user has submitted to (does not own)
  - name: Published Form Entries
    description: Submit entries to a published form
  - name: Published Forms
    description: Read a published form's public structure for filling
  - name: Linked Form Options
    description: >-
      Discover candidate entries (and their `entry_token`s) for a `linked_form`
      field while filling a published form
  - name: Entry Attachments
    description: >-
      2-step upload for `attachment` field submissions. Prepare returns an
      `upload_id`; submit it under the attachment field in `field_values` when
      creating the entry.
  - name: Me
    description: Current authenticated user
  - name: Webhooks
    description: Webhook integrations attached to a form
  - name: Form Themes
    description: Read and update a form's visual theme
  - name: Form Settings
    description: >-
      Per-form settings — submission flow, availability, access control,
      presentation
  - name: Field Rules
    description: >-
      Read and replace a form's conditional field-display and post-submission
      redirect rules.
  - name: Form Folder
    description: Per-user folder placement for a shared form
  - name: OAuth
    description: OAuth 2.0 PKCE token issuance and revocation
  - name: Public Queries
    description: Public query pages that let visitors look up entries by chosen fields
paths:
  /api/v1/f/{form_token}/entry_schema:
    parameters:
      - name: form_token
        in: path
        description: Token of a published form
        required: true
        schema:
          type: string
    get:
      tags:
        - Entry Schemas
      summary: Get the JSON Schema for submitting to a published form
      description: >
        Returns the JSON Schema that `field_values` must satisfy when submitting
        an entry to a

        published form — the same schema the submit endpoint validates against.
        Only public

        fields are listed. Access follows reading the published form: if it is

        password-protected, pass the password in the `X-Form-Access-Password`
        header.


        **Required scope:** `form:respond`.
      parameters:
        - name: X-Form-Access-Password
          in: header
          required: false
          schema:
            type: string
          description: Access password, when the form is password-protected
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                type: object
                required:
                  - data
                properties:
                  data:
                    $ref: '#/components/schemas/EntrySchemaDocument'
        '401':
          description: Missing or invalid credentials
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorEnvelope'
        '403':
          description: Closed form, caller has not participated
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CodedErrorEnvelope'
        '404':
          description: Form not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorEnvelope'
      security:
        - PersonalAccessToken:
            - form:respond
components:
  schemas:
    EntrySchemaDocument:
      type: object
      required:
        - $schema
        - title
        - type
        - additionalProperties
        - properties
      description: >
        A JSON Schema (draft 2020-12) document for `field_values`: one property
        per field of

        the form that holds a value, keyed by `api_code`, each carrying the
        field's label as `title`, its

        `type` in `description`, and the exact value shape it accepts — choice
        `api_code`s,

        number ranges, statement and column keys. Read-only fields, and the
        entry's own keys an

        entry read carries (`serial_number`, `token`, `created_at`, `info_*`,
        ...), are listed with

        `readOnly: true`; a value sent for them is accepted and ignored, so an
        entry as read

        can be written back whole. Feed it to any JSON Schema validator, or use
        it

        as tool parameters for an LLM. Required fields are not marked: whether a
        field must

        be filled can depend on other answers, and is checked when the entry is
        written.
      properties:
        $schema:
          type: string
          example: https://json-schema.org/draft/2020-12/schema
        title:
          type: string
          description: Form name
          example: Customer visit log
        type:
          type: string
          enum:
            - object
        additionalProperties:
          type: boolean
          enum:
            - false
        properties:
          type: object
          description: Value schema per field, keyed by `api_code`
          additionalProperties:
            type: object
    ErrorEnvelope:
      type: object
      required:
        - error
      properties:
        error:
          type: string
          description: Error message
    CodedErrorEnvelope:
      type: object
      required:
        - error
        - code
      description: An error clients may need to branch on; `code` names the reason.
      properties:
        error:
          type: string
          description: Error message
        code:
          type: string
          description: >-
            Machine-readable reason. Published-form 403s carry the form's access
            status (`password_required`, `password_invalid`, `login_required`,
            `closed`, `not_opened`, `disabled`, …); submitting to a form that
            requires a captcha returns `captcha_required`; listing your entries
            on a form you own or collaborate on returns `form_cooperator`.
  securitySchemes:
    PersonalAccessToken:
      type: http
      scheme: bearer
      bearerFormat: PAT
      description: >
        Personal Access Token prefixed with `fh_`. Sent as `Authorization:
        Bearer fh_xxx`.

        The scope required by each endpoint is listed in that endpoint's
        description.

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.