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

# Create component folders

> Creates one or more folders in the component library. Each folder can optionally specify a developer ID (must be unique within the workspace) and a parentId (the developer ID of an existing folder to nest the new folder inside — omit to create the folder at the library root).



## OpenAPI

````yaml openapi.json post /componentFolders
openapi: 3.0.0
info:
  version: 1.0.0
  title: Ditto API
  description: Programmatically read and write data in your Ditto workspace.
servers:
  - url: https://api.dittowords.com/v2
security: []
paths:
  /componentFolders:
    post:
      tags:
        - Component Folders
      summary: Create component folders
      description: >-
        Creates one or more folders in the component library. Each folder can
        optionally specify a developer ID (must be unique within the workspace)
        and a parentId (the developer ID of an existing folder to nest the new
        folder inside — omit to create the folder at the library root).
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                folders:
                  type: array
                  items:
                    type: object
                    properties:
                      name:
                        type: string
                        description: The name of the new folder
                      developerId:
                        type: string
                        description: >-
                          Optional preconfigured developer ID for the folder.
                          Must be unique within the workspace. If omitted, one
                          is generated automatically from the name.
                      parentId:
                        type: string
                        description: >-
                          Developer ID of the parent folder to nest the new
                          folder inside (from list_component_folders). Omit or
                          set to "root" to create the folder at the library
                          root.
                    required:
                      - name
                  minItems: 1
                  description: Array of new folders to create
              required:
                - folders
              example:
                folders:
                  - name: Inputs
                  - name: Text Fields
                    developerId: text-fields
                    parentId: inputs
      responses:
        '200':
          description: Returns the developer IDs of the created folders, in request order
          content:
            application/json:
              schema:
                type: object
                properties:
                  developerIds:
                    type: array
                    items:
                      type: string
                    description: >-
                      Array of developer IDs for the created folders, in request
                      order
                required:
                  - developerIds
                example:
                  developerIds:
                    - inputs
                    - text-fields
        '400':
          description: >-
            Returned when the request body fails validation. Common causes
            include: a parentId not matching any existing folder in the
            workspace.
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                    description: Error message describing the validation failure
                required:
                  - message
              example:
                message: Folder id not found
        '409':
          description: >-
            Returned when a supplied developer ID already exists in the
            workspace
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                    description: Error message describing the conflict
                required:
                  - message
              example:
                message: already exists in workspace
      security:
        - ApiKeyAuth: []
components:
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: Authorization

````