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

# Update Comment

> Update Comment.



## OpenAPI

````yaml PATCH /articles/comments/{commentId}
openapi: 3.1.0
info:
  title: Blog API
  version: 1.0.0
servers:
  - url: https://api.octaviatech.app/cms
    description: Production
security:
  - ApiKeyAuth: []
tags:
  - name: Tags
    description: Tag management endpoints
paths:
  /articles/comments/{commentId}:
    patch:
      tags:
        - Articles
      summary: Update comment
      description: >-
        Partial update — send `content`, `status`, or both (at least one is
        required). A caller may only edit their own comment; changing `status`
        additionally requires a privileged role (SUPER_USER, MANAGER,
        CHIEF_EDITOR, PUBLISHER, EDITOR) and is rejected with 403 otherwise.
      parameters:
        - in: path
          name: commentId
          required: true
          schema:
            type: string
            pattern: ^[a-fA-F0-9]{24}$
            example: '{{objectId}}'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              additionalProperties: false
              properties:
                content:
                  type: string
                  description: >-
                    New comment body, trimmed before storing. Max 4000
                    characters.
                status:
                  type: string
                  description: New moderation status. Requires a privileged moderator role.
                  enum:
                    - pending
                    - approved
                    - rejected
                captchaToken:
                  type: string
                  description: >-
                    Captcha token. Used when the caller is editing a guest
                    comment and the tenant has
                    `requireCaptchaForGuestEngagement` enabled.
            examples:
              Edit Own Comment:
                value:
                  content: 'Updated: the issue was a stale cache.'
              Moderate Comment:
                value:
                  status: approved
      responses:
        '200':
          description: OK
          content:
            application/json:
              example:
                success: true
                statusCode: 200
                message: Comment updated successfully
                data:
                  comment:
                    _id: '{{objectId}}'
                    articleId: '{{objectId}}'
                    actorType: user
                    userId:
                      _id: '{{objectId}}'
                      firstName: Ada
                      lastName: Lovelace
                      avatar: https://cdn.example.com/a.jpg
                    parentId: null
                    content: 'Updated: the issue was a stale cache.'
                    likes: 2
                    dislikes: 0
                    status: approved
                    isDeleted: false
                    createdAt: '2025-05-22T21:42:41.596Z'
                    updatedAt: '2025-05-23T09:10:02.114Z'
        '400':
          description: >-
            Bad request (invalid comment id, or neither content nor status
            provided)
          content:
            application/json:
              example:
                success: false
                statusCode: 400
                message: Comment content or status is required
                data: null
        '401':
          description: >-
            Unauthorized (missing x-user-id for a user-owned comment, or
            captchaToken required for guest engagement)
          content:
            application/json:
              example:
                success: false
                statusCode: 401
                message: x-user-id is required
                data: null
        '403':
          description: >-
            Forbidden (not the comment owner, or status change without a
            privileged role)
          content:
            application/json:
              example:
                success: false
                statusCode: 403
                message: You are not allowed to change comment status
                data: null
        '404':
          description: Comment not found
          content:
            application/json:
              example:
                success: false
                statusCode: 404
                message: Comment not found
                data: null
        '500':
          description: Server error
          content:
            application/json:
              example:
                success: false
                statusCode: 500
                message: Server Error
                data: null
      security:
        - ApiKeyAuth: []
components:
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: x-api-key

````