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

# Create form

> Create a new form template (title and type required). Supports automatic name deduplication.



## OpenAPI

````yaml /api-reference/cx/swagger.json post /library/forms
openapi: 3.0.0
info:
  description: CX API.
  title: CX API
  contact:
    name: API Support
    url: https://stax.ai
    email: support@stax.ai
  version: '1.0'
servers:
  - url: https://api.cx.stax.ai
security: []
paths:
  /library/forms:
    post:
      tags:
        - library
      summary: Create form
      description: >-
        Create a new form template (title and type required). Supports automatic
        name deduplication.
      requestBody:
        content:
          application/json:
            schema:
              type: object
              additionalProperties: true
        description: Form creation data (title and type required)
        required: true
      responses:
        '200':
          description: Created form
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/types.FormTemplate'
        '400':
          description: Bad request - invalid request body, PDF ID, or questions
          content:
            application/json:
              schema:
                type: object
                additionalProperties: true
        '500':
          description: Internal server error
          content:
            application/json:
              schema:
                type: object
                additionalProperties: true
      security:
        - ApiKeyAuth: []
components:
  schemas:
    types.FormTemplate:
      type: object
      properties:
        _id:
          type: string
        created_at:
          type: string
        deleted_at:
          type: string
        description:
          type: string
        fields:
          type: string
        hidden:
          type: boolean
        incomplete:
          type: integer
        info:
          type: object
          additionalProperties: true
        most_recent:
          description: For returning
          type: string
        pdf:
          type: string
        public:
          type: boolean
        questions:
          type: array
          items:
            $ref: '#/components/schemas/types.FormQuestion'
        replace_pdf:
          type: boolean
        tags:
          type: array
          items:
            type: string
        team:
          type: string
        title:
          type: string
        total:
          type: integer
        type:
          type: string
    types.FormQuestion:
      type: object
      properties:
        _id:
          type: string
        conditions:
          type: array
          items:
            $ref: '#/components/schemas/types.Condition'
        data:
          type: object
          additionalProperties: true
        default: {}
        hint:
          type: string
        key:
          type: string
        link:
          type: string
        multiple:
          type: boolean
        on_type:
          type: string
        options:
          type: array
          items:
            type: string
        required:
          type: boolean
        title:
          type: string
        type:
          type: string
    types.Condition:
      type: object
      properties:
        expression:
          type: string
        op:
          type: string
        value:
          type: string
  securitySchemes:
    ApiKeyAuth:
      description: CX API key. Create one in CX under Settings → Advanced → API Keys.
      in: header
      name: x-api-key
      type: apiKey

````

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