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

# Create a new collection



## OpenAPI

````yaml post /collections
openapi: 3.0.0
info:
  title: Thena Help Center API Documentation
  description: The Thena Help Center API description
  version: '1.0'
  contact: {}
servers:
  - url: https://helpcenter.thena.ai
    description: Production
security:
  - ApiKey: []
    base-access: []
    OrgId: []
    UserId: []
tags: []
paths:
  /collections:
    post:
      tags:
        - Collection
      summary: Create a new collection
      operationId: CollectionController_create
      parameters: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateCollectionDto'
      responses:
        '201':
          description: Collection created successfully.
          content:
            application/json:
              schema:
                properties:
                  data:
                    $ref: '#/components/schemas/CollectionDto'
                  message:
                    type: string
                    example: Collection created successfully.
        '400':
          description: The maximum depth of the collection has been reached.
          content:
            application/json:
              schema:
                example:
                  message: The maximum depth of the collection has been reached.
                  error: API Error
                  statusCode: 400
        '404':
          description: Help center not found.
          content:
            application/json:
              schema:
                example:
                  message: Help center not found.
                  error: API Error
                  statusCode: 404
        '500':
          description: Collection creation failed.
          content:
            application/json:
              schema:
                example:
                  message: Collection creation failed.
                  error: API Error
                  statusCode: 500
components:
  schemas:
    CreateCollectionDto:
      type: object
      properties:
        helpCenterId:
          type: string
          description: Help Center ID
          example: 507f1f77bcf86cd799439011
        name:
          type: string
          description: Name of the collection
          example: Getting Started Guide
          minLength: 1
        description:
          type: string
          description: Description of the collection
          example: Learn how to get started with our platform
          minLength: 1
        icon:
          type: string
          description: Icon identifier for the collection
          example: book
          minLength: 1
        isProtected:
          type: boolean
          description: Whether the collection requires authentication to access
          example: false
        parentId:
          type: string
          description: Parent collection ID
          example: 507f1f77bcf86cd799439013
      required:
        - helpCenterId
        - name
    CollectionDto:
      type: object
      properties:
        _id:
          type: string
          example: 671b855619d8f51c01c0d28f
        orgId:
          type: string
          example: 667d37bb3a401eba4a609426
        uid:
          type: number
          example: 3115095248
        helpCenterId:
          example: 671a2ddbccca6b1c3dc0d3b6
          allOf:
            - $ref: '#/components/schemas/ObjectId'
        name:
          type: string
          example: General
        description:
          type: string
          example: Description of the collection
        slug:
          type: string
          example: 3115095248-general
        parentId:
          type: string
          example: null
        order:
          type: number
          example: 0
        createdBy:
          type: string
          example: 66d9652332a786110182e40c
        isProtected:
          type: boolean
          description: Whether the collection requires authentication to access
          example: false
        createdAt:
          type: string
          example: '2024-10-25T11:47:35.005Z'
        updatedAt:
          type: string
          example: '2024-11-18T07:37:11.001Z'
        articles:
          example:
            - 6735b68c2baad6fe6f6da745
          type: array
          items:
            type: string
        icon:
          type: string
          example: AnnotationIcon
        meta:
          type: object
          example:
            title: null
            description: null
            image: null
      required:
        - _id
        - orgId
        - uid
        - helpCenterId
        - name
        - slug
        - order
        - createdBy
        - isProtected
        - createdAt
        - updatedAt
    ObjectId:
      type: object
      properties: {}
  securitySchemes:
    ApiKey:
      type: apiKey
      in: header
      name: x-api-key
      description: Enter your API key

````