> ## 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.

# Update a collection



## OpenAPI

````yaml patch /collections/{collectionId}
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/{collectionId}:
    patch:
      tags:
        - Collection
      summary: Update a collection
      operationId: CollectionController_update
      parameters:
        - name: collectionId
          required: true
          in: path
          description: Collection ID
          schema:
            example: 507f1f77bcf86cd799439011
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateCollectionDto'
      responses:
        '200':
          description: Collection updated successfully.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UpdateCollectionResponse'
        '500':
          description: Failed to update collection.
          content:
            application/json:
              schema:
                example:
                  message: Failed to update collection.
                  error: API Error
                  statusCode: 500
components:
  schemas:
    UpdateCollectionDto:
      type: object
      properties:
        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
        meta:
          description: Meta information for SEO
          example:
            title: SEO Title
            description: SEO Description
            image: https://example.com/image.jpg
          allOf:
            - $ref: '#/components/schemas/ArticleMetaDto'
    UpdateCollectionResponse:
      type: object
      properties:
        data:
          $ref: '#/components/schemas/CollectionDto'
        message:
          type: string
          example: Collection updated successfully.
      required:
        - data
        - message
    ArticleMetaDto:
      type: object
      properties:
        title:
          type: string
          description: Article title for SEO
        description:
          type: string
          description: Article description for SEO
        image:
          type: string
          description: Article image URL for SEO
    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

````