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

# Get a form definition

> Returns the definition of an active form by slug so a storefront can render it: the field list (with names, labels, types, options and whether each is required) plus display settings such as the success message.



## OpenAPI

````yaml /api-reference/openapi.json get /forms/{slug}
openapi: 3.0.0
info:
  title: Marzipan API
  version: 1.0.0
servers:
  - url: https://api.marzipan.co/v1
security:
  - tenantAuth: []
tags:
  - name: Account
    description: >-
      Account management endpoints including registration, login, and user
      details
  - name: Carts
    description: Shopping cart management endpoints
  - name: Products
    description: Product catalog and search endpoints
  - name: Subscriptions
    description: Subscription management and renewal endpoints
  - name: CMS
    description: Content management system endpoints
  - name: Messaging
    description: Message and communication endpoints
  - name: Search
    description: Search functionality endpoints
  - name: Settings
    description: >-
      Storefront settings and market detection used to configure the web
      components and checkout.
  - name: Analytics
    description: Storefront visit and attribution tracking.
  - name: Rewards
    description: >-
      Loyalty and rewards programme endpoints for the authenticated customer,
      covering points balance, tier status, perks, exclusive products and
      transaction history.
  - name: Forms
    description: Render and submit dynamic storefront forms defined in the CMS.
  - name: Events
    description: >-
      Check event availability, browse occurrences and recurring dates, generate
      ticket QR codes, and manage event waitlists (join, leave, check status,
      and claim promoted spots).
paths:
  /forms/{slug}:
    get:
      tags:
        - Forms
      summary: Get a form definition
      description: >-
        Returns the definition of an active form by slug so a storefront can
        render it: the field list (with names, labels, types, options and
        whether each is required) plus display settings such as the success
        message.
      parameters:
        - name: slug
          in: path
          required: true
          description: URL-friendly identifier of the form.
          schema:
            type: string
      responses:
        '200':
          description: The form definition.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Form'
              example:
                name: Contact us
                fields:
                  - name: name
                    label: Your Name
                    type: text
                    required: true
                    placeholder: ''
                    options: []
                  - name: email
                    label: Email
                    type: email
                    required: true
                    placeholder: ''
                    options: []
                  - name: message
                    label: Message
                    type: textarea
                    required: true
                    placeholder: ''
                    options: []
                settings:
                  successMessage: Thank you for your submission!
        '404':
          description: No active form with the given slug exists.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                message: No query results for model [Form].
components:
  schemas:
    Form:
      type: object
      description: >-
        Definition of a storefront form, used to render it and validate
        submissions.
      properties:
        name:
          type: string
          description: Form name.
        fields:
          type: array
          description: The form's fields, in display order.
          items:
            $ref: '#/components/schemas/FormField'
        settings:
          type: object
          description: Display settings for the form.
          properties:
            successMessage:
              type: string
              description: Message shown after a successful submission.
    Error:
      type: object
      properties:
        message:
          type: string
          description: Error message
      required:
        - message
    FormField:
      type: object
      description: A single field within a form definition.
      properties:
        name:
          type: string
          description: Field name; used as the key when submitting the form.
        label:
          type: string
          description: Human-readable field label.
        type:
          type: string
          enum:
            - text
            - email
            - phone
            - textarea
            - select
            - checkbox
            - radio
            - date
            - hidden
          description: Field input type, which determines how the value is validated.
        required:
          type: boolean
          description: Whether a value is required for this field.
        placeholder:
          type: string
          description: Placeholder text for the field.
        options:
          type: array
          description: Allowed values for select, radio and checkbox fields.
          items:
            type: string
  securitySchemes:
    tenantAuth:
      type: http
      scheme: bearer
      description: >-
        Bearer authentication header of the form `Bearer <token>`, where
        `<token>` is your API token.
      bearerFormat: JWT

````