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

# Create a folder

Create a new folder in a deployment's workspace.

Provide a `name`, and optionally a `parentId` to nest the folder inside an existing one (omit it to create the folder at the workspace root). An optional `position` controls the folder's ordering among its siblings.

Requires the **AI BI User** role (or higher). When `parentId` is set, the caller must additionally have **edit** or **manage** access to that parent folder.

Folders can be nested up to a fixed maximum depth; exceeding it returns `400`.


## OpenAPI

````yaml /api-reference/api.yaml post /v1/deployments/{deploymentId}/folders
openapi: 3.1.0
info:
  title: Cube Cloud REST API
  version: 1.0.0
  description: >-
    Programmatically manage Cube Cloud: deployments and everything scoped to
    them

    (environments, folders, reports, workbooks, notifications, workspace, and
    agents),

    plus account-level users, groups, policies, embedding, and AI settings.
servers:
  - url: https://{tenant}.cubecloud.dev/api
    description: >-
      Cube Cloud API base URL. Replace the whole host if you use a custom
      domain.
    variables:
      tenant:
        default: your-tenant
        description: Your Cube Cloud tenant subdomain
security:
  - bearerAuth: []
tags:
  - name: Deployments
  - name: Environments
  - name: Folders
  - name: Reports
  - name: Workbooks
  - name: Notifications
  - name: Workspace
  - name: Embed
  - name: Embed Tenants
paths:
  /v1/deployments/{deploymentId}/folders:
    post:
      tags:
        - Folders
      summary: Create a folder
      operationId: createFolder
      parameters:
        - in: path
          name: deploymentId
          required: true
          schema:
            type: number
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateFolderInput'
        description: CreateFolderInput
        required: false
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Folder'
          description: ''
components:
  schemas:
    CreateFolderInput:
      properties:
        name:
          maxLength: 255
          type: string
        parentId:
          oneOf:
            - type: integer
            - type: 'null'
        position:
          oneOf:
            - type: integer
            - type: 'null'
      required:
        - name
      type: object
    Folder:
      properties:
        createdAt:
          oneOf:
            - format: date
              type: string
            - format: date-time
              type: string
        createdBy:
          type: integer
        deploymentId:
          type: integer
        id:
          type: integer
        name:
          type: string
        parentId:
          oneOf:
            - type: integer
            - type: 'null'
        position:
          type: integer
        type:
          $ref: '#/components/schemas/FolderDtoType'
        updatedAt:
          oneOf:
            - format: date
              type: string
            - format: date-time
              type: string
        updatedBy:
          oneOf:
            - type: integer
            - type: 'null'
      required:
        - name
        - position
        - id
        - deploymentId
        - createdAt
        - updatedAt
        - type
      type: object
    FolderDtoType:
      enum:
        - FOLDER
        - WORKBOOK
        - REPORT
      type: string
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: 'Token authentication. Send `Authorization: Bearer <YOUR_TOKEN>`.'

````