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

# Create form

> Creates a new form. Optionally pass `fields` to add questions to the form's first page in one call. SINGLE_OPTION / MULTIPLE_OPTION fields must include a non-empty `values` list of allowed options.



## OpenAPI

````yaml /openapi.v2.json post /forms
openapi: 3.1.1
info:
  title: Heffl API v2 (Beta)
  version: 2.0.0
  description: >-
    Heffl REST API v2 (beta) — resource-oriented endpoints with consistent
    response envelopes. Endpoints, schemas, and behavior may change until GA.
    See Agent workflows and ID prefixes guides for automation.
  contact:
    name: Heffl Support
    url: https://heffl.com/support
    email: support@heffl.com
servers:
  - url: https://api.heffl.com/api/v2
    description: Production API Server
security:
  - ApiKeyAuth: []
paths:
  /forms:
    post:
      tags:
        - Objects
      summary: Create form
      description: >-
        Creates a new form. Optionally pass `fields` to add questions to the
        form's first page in one call. SINGLE_OPTION / MULTIPLE_OPTION fields
        must include a non-empty `values` list of allowed options.
      operationId: objects.forms.create
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/FormInput'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Form'
        '400':
          description: Validation error or bad request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/V2ApiError'
        '401':
          description: Missing or invalid API key
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/V2ApiError'
        '403':
          description: Insufficient permission
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/V2ApiError'
        '404':
          description: Resource not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/V2ApiError'
        '429':
          description: Rate limit exceeded
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/V2ApiError'
components:
  schemas:
    FormInput:
      type: object
      properties:
        title:
          type: string
          description: Form title
        description:
          type:
            - string
            - 'null'
          description: Form description shown to respondents
        fields:
          type: array
          items:
            $ref: '#/components/schemas/FormFieldInputBase'
          description: >-
            Questions to add to the form's first page. Each becomes an
            answerable field.
      required:
        - title
    Form:
      type: object
      properties:
        id:
          type: string
          description: Form ID (frm_ prefix)
        title:
          type: string
          description: Form title
        description:
          type:
            - string
            - 'null'
          description: Form description shown to respondents
        entity:
          type:
            - string
            - 'null'
          description: CRM entity this form is associated with (e.g. leads, deals), if any
        submissionCount:
          type: number
          description: Total number of submissions received
        createdById:
          type:
            - string
            - 'null'
          description: ID of the user who created the form (usr_ prefix)
        createdByName:
          type:
            - string
            - 'null'
          description: Name of the user who created the form
        createdAt:
          type: string
          format: date-time
          description: When the form was created
        updatedAt:
          type:
            - string
            - 'null'
          format: date-time
          description: When the form was last updated
      required:
        - id
        - title
        - description
        - entity
        - submissionCount
        - createdById
        - createdByName
        - createdAt
        - updatedAt
    V2ApiError:
      type: object
      required:
        - error
      properties:
        error:
          type: object
          required:
            - code
            - message
          properties:
            code:
              type: string
            message:
              type: string
            details:
              type: object
    FormFieldInputBase:
      type: object
      properties:
        label:
          type: string
          description: Question label shown to respondents
        dataType:
          type: string
          enum:
            - TEXT
            - LONG_TEXT
            - EMAIL
            - MOBILE
            - NUMBER
            - DATE
            - SINGLE_OPTION
            - MULTIPLE_OPTION
            - FILE_PICKER
            - SIGNATURE
            - CURRENCY
            - LINK
            - RATING
            - OPINION_SCALE
          description: Field data type. SINGLE_OPTION / MULTIPLE_OPTION require `values`.
        description:
          type:
            - string
            - 'null'
          description: Optional help text under the question
        required:
          type: boolean
          description: Whether an answer is required. Defaults to false.
        placeholder:
          type:
            - string
            - 'null'
          description: Optional input placeholder
        values:
          type: array
          items:
            type: string
          description: >-
            Allowed options. Required (non-empty) for SINGLE_OPTION and
            MULTIPLE_OPTION fields.
        settings:
          type: object
          additionalProperties: true
          description: 'Extra config for RATING / OPINION_SCALE fields (e.g. { max: 5 }).'
      required:
        - label
        - dataType
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: x-api-key
      description: >-
        API key for authentication. Get yours at
        app.heffl.com/settings/developers

````