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

# Create Query Folder Under Parent

> Creates a new query folder as a child of the specified parent folder. The gateway resolves the parent folder's path and creates the new folder at "{parentPath}/{folderName}".

<span style={{display: "flex", gap: "10px", flexDirection: "row", alignItems: "center"}}>
  <img src="https://cdn.peaka.com/badges/partner-api-key-badge.png" />

  <img src="https://cdn.peaka.com/badges/project-api-key-badge.png" />
</span>


## OpenAPI

````yaml post /data/projects/{projectId}/queries/folders/{parentFolderId}
openapi: 3.0.1
info:
  title: Peaka Gateway API
  description: Peaka Gateway API Documentation
  version: '1.0'
servers:
  - url: https://partner.peaka.studio/api/v1
    description: Default Server URL (US Zone)
  - url: https://partner.eu.peaka.studio/api/v1
    description: EU Zone
security:
  - bearerAuth: []
paths:
  /data/projects/{projectId}/queries/folders/{parentFolderId}:
    post:
      tags:
        - Data -- Query Folders
      summary: Create Query Folder Under Parent
      description: >-
        Creates a new query folder as a child of the specified parent folder.
        The gateway resolves the parent folder's path and creates the new folder
        at "{parentPath}/{folderName}".
      operationId: createQueryFolderWithParentId
      parameters:
        - name: projectId
          in: path
          description: ID of the Project
          required: true
          schema:
            type: string
          example: mtKDhe1U
        - name: parentFolderId
          in: path
          description: ID of the parent Query Folder
          required: true
          schema:
            type: string
          example: 550e8400-e29b-41d4-a716-446655440000
      requestBody:
        description: Folder creation request
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/QueryFolderCreateRequest'
            example:
              folderName: Monthly
        required: true
      responses:
        '201':
          description: Folder created successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/QueryFolderItem'
              example:
                id: 550e8400-e29b-41d4-a716-446655440001
                name: Monthly
                path: /Reports/Monthly
                parentId: 550e8400-e29b-41d4-a716-446655440000
                createdAt: '2025-01-15T10:31:00Z'
        '404':
          description: Parent folder not found
          content:
            '*/*':
              schema:
                $ref: '#/components/schemas/QueryFolderItem'
        '409':
          description: Folder already exists at this path
          content:
            '*/*':
              schema:
                $ref: '#/components/schemas/QueryFolderItem'
components:
  schemas:
    QueryFolderCreateRequest:
      type: object
      properties:
        folderName:
          type: string
    QueryFolderItem:
      type: object
      properties:
        id:
          type: string
          description: Unique identifier of the folder (UUID)
          example: 550e8400-e29b-41d4-a716-446655440000
        name:
          type: string
          description: Display name of the folder
          example: Monthly Reports
        path:
          type: string
          description: Full path of the folder in the hierarchy
          example: /reports/monthly
        parentId:
          type: string
          description: ID of the parent folder, null if root-level
          example: 550e8400-e29b-41d4-a716-446655440001
        createdAt:
          type: string
          description: Timestamp when the folder was created (ISO 8601)
          example: '2025-01-15T10:30:00Z'
      description: Represents a query folder
  securitySchemes:
    bearerAuth:
      type: http
      description: >-
        Use the Authorization header with the value 'Bearer <apiKey>' to
        authenticate. Partner API Keys have full access; Project API Keys are
        limited to their project scope. Learn more:
        https://docs.peaka.com/api-reference/authentication
      scheme: bearer
      bearerFormat: Api Key

````