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

# Create comment on article

> Adds a comment to the article. The stored status is `approved` or `pending` depending on the tenant/article `autoApproveComments` setting. Pass `parentId` to reply to an existing comment on the same article; the parent must exist and not be deleted. Rejected with 403 when the article, its category, or its sub-category disables comments.



## OpenAPI

````yaml /api-reference/ai-cms/openapi.json post /articles/{id}/comments
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/{id}/comments:
    post:
      tags:
        - Articles
      summary: Create comment on article
      description: >-
        Adds a comment to the article. The stored status is `approved` or
        `pending` depending on the tenant/article `autoApproveComments` setting.
        Pass `parentId` to reply to an existing comment on the same article; the
        parent must exist and not be deleted. Rejected with 403 when the
        article, its category, or its sub-category disables comments.
      parameters:
        - in: path
          name: id
          required: true
          schema:
            type: string
            pattern: ^[a-fA-F0-9]{24}$
            example: '{{objectId}}'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              additionalProperties: false
              required:
                - content
              properties:
                content:
                  type: string
                  description: Comment body, trimmed before storing. Max 4000 characters.
                parentId:
                  type: string
                  pattern: ^[a-fA-F0-9]{24}$
                  description: Optional id of the comment being replied to
                captchaToken:
                  type: string
                  description: >-
                    Captcha token. Required when the caller is treated as a
                    guest and the tenant has `requireCaptchaForGuestEngagement`
                    enabled.
                guestId:
                  type: string
                  description: >-
                    Stable client-generated guest identifier. Used to build the
                    guest fingerprint together with IP and user agent when the
                    caller is unauthenticated.
            examples:
              Top Level Comment:
                value:
                  content: Great write-up, thanks for sharing.
              Reply As Guest:
                value:
                  content: I had the same issue.
                  parentId: '{{objectId}}'
                  guestId: guest-7f3a1
                  captchaToken: 03AGdBq26...
      responses:
        '201':
          description: Created
          content:
            application/json:
              example:
                success: true
                statusCode: 201
                message: Comment created 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: Great write-up, thanks for sharing.
                    likes: 0
                    dislikes: 0
                    status: approved
                    isDeleted: false
                    createdAt: '2025-05-22T21:42:41.596Z'
                    updatedAt: '2025-05-22T21:42:41.596Z'
        '400':
          description: >-
            Bad request (invalid article id, invalid parentId, empty content, or
            missing guest identity)
          content:
            application/json:
              example:
                success: false
                statusCode: 400
                message: Comment content is required
                data: null
        '401':
          description: >-
            Unauthorized (missing auth context, or captchaToken required for
            guest engagement)
          content:
            application/json:
              example:
                success: false
                statusCode: 401
                message: captchaToken is required for guest engagement
                data: null
        '403':
          description: >-
            Forbidden (comments disabled, or guest comments disabled for this
            tenant)
          content:
            application/json:
              example:
                success: false
                statusCode: 403
                message: Comments are disabled for this article
                data: null
        '404':
          description: Article or parent comment not found
          content:
            application/json:
              example:
                success: false
                statusCode: 404
                message: Article not found
                data: null
        '429':
          description: Too many requests (guest rate limit exceeded)
          content:
            application/json:
              example:
                success: false
                statusCode: 429
                message: Too many guest reactions, please try later
                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

````