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

# Create Comment

> Create a new comment on a card.



## OpenAPI

````yaml /openapi.json post /api/v1/comments/card/{card_id}
openapi: 3.1.0
info:
  description: >-
    Okto Pulse REST API schema generated from okto-pulse-core 0.2.0 source for
    docs.oktolabs.ai.
  title: Okto Pulse
  version: 0.2.0
servers: []
security: []
paths:
  /api/v1/comments/card/{card_id}:
    post:
      tags:
        - comments
      summary: Create Comment
      description: Create a new comment on a card.
      operationId: create_comment_api_v1_comments_card__card_id__post
      parameters:
        - in: path
          name: card_id
          required: true
          schema:
            title: Card Id
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CommentCreate'
        required: true
      responses:
        '201':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CommentResponse'
          description: Successful Response
        '422':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
          description: Validation Error
      security:
        - HTTPBearer: []
components:
  schemas:
    CommentCreate:
      description: |-
        Schema for creating a comment.

        For text comments, only ``content`` is needed.
        For choice boards, set ``comment_type`` to "choice" or "multi_choice"
        and provide ``choices``.
      properties:
        allow_free_text:
          default: false
          title: Allow Free Text
          type: boolean
        choices:
          anyOf:
            - items:
                $ref: '#/components/schemas/ChoiceOption'
              type: array
            - type: 'null'
          title: Choices
        comment_type:
          default: text
          title: Comment Type
          type: string
        content:
          minLength: 1
          title: Content
          type: string
      required:
        - content
      title: CommentCreate
      type: object
    CommentResponse:
      description: Schema for comment response.
      properties:
        allow_free_text:
          default: false
          title: Allow Free Text
          type: boolean
        author_id:
          title: Author Id
          type: string
        card_id:
          title: Card Id
          type: string
        choices:
          anyOf:
            - items:
                $ref: '#/components/schemas/ChoiceOption'
              type: array
            - type: 'null'
          title: Choices
        comment_type:
          default: text
          title: Comment Type
          type: string
        content:
          title: Content
          type: string
        created_at:
          format: date-time
          title: Created At
          type: string
        id:
          title: Id
          type: string
        responses:
          anyOf:
            - items:
                $ref: '#/components/schemas/ChoiceResponse'
              type: array
            - type: 'null'
          title: Responses
        updated_at:
          format: date-time
          title: Updated At
          type: string
      required:
        - id
        - card_id
        - content
        - author_id
        - created_at
        - updated_at
      title: CommentResponse
      type: object
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          title: Detail
          type: array
      title: HTTPValidationError
      type: object
    ChoiceOption:
      description: A single option in a choice board.
      properties:
        id:
          title: Id
          type: string
        label:
          title: Label
          type: string
      required:
        - id
        - label
      title: ChoiceOption
      type: object
    ChoiceResponse:
      description: A response to a choice board.
      properties:
        free_text:
          anyOf:
            - type: string
            - type: 'null'
          title: Free Text
        responder_id:
          title: Responder Id
          type: string
        responder_name:
          title: Responder Name
          type: string
        selected:
          default: []
          items:
            type: string
          title: Selected
          type: array
      required:
        - responder_id
        - responder_name
      title: ChoiceResponse
      type: object
    ValidationError:
      properties:
        ctx:
          title: Context
          type: object
        input:
          title: Input
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          title: Location
          type: array
        msg:
          title: Message
          type: string
        type:
          title: Error Type
          type: string
      required:
        - loc
        - msg
        - type
      title: ValidationError
      type: object
  securitySchemes:
    HTTPBearer:
      scheme: bearer
      type: http

````