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

# Add or update a comment

> Adds a new comment to a card. To update an existing comment, include its `id` in the body —
the `userId` must match the original comment's author.




## OpenAPI

````yaml /openapi.yaml post /api/board/{boardId}/{cardId}/comment
openapi: 3.0.3
info:
  title: Aptly API
  version: '1.0'
  description: >
    The Aptly API lets you read and write cards on any Aptly board from external
    systems.


    All requests require an API key passed as the `x-token` header.

    API keys are scoped to your company and work across all boards.
servers:
  - url: https://core-api.getaptly.com
    description: Production
security:
  - ApiKeyHeader: []
paths:
  /api/board/{boardId}/{cardId}/comment:
    post:
      tags:
        - Cards
      summary: Add or update a comment
      description: >
        Adds a new comment to a card. To update an existing comment, include its
        `id` in the body —

        the `userId` must match the original comment's author.
      operationId: postComment
      parameters:
        - name: boardId
          in: path
          required: true
          schema:
            type: string
        - name: cardId
          in: path
          required: true
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - userId
                - content
              properties:
                userId:
                  type: string
                  description: Aptly user ID of the comment author.
                content:
                  type: string
                  description: Comment text.
                id:
                  type: string
                  description: Existing comment ID — include to update rather than create.
      responses:
        '200':
          description: Comment created or updated.
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    $ref: '#/components/schemas/Comment'
        '401':
          description: Invalid or missing API key.
        '404':
          description: Card or comment not found.
      security:
        - ApiKeyHeader: []
        - DelegateToken: []
components:
  schemas:
    Comment:
      type: object
      properties:
        id:
          type: string
        userId:
          type: string
        content:
          type: string
        createdAt:
          type: string
          format: date-time
  securitySchemes:
    ApiKeyHeader:
      type: apiKey
      in: header
      name: x-token
    DelegateToken:
      type: apiKey
      in: header
      name: Authorization
      description: 'Delegate token issued by the platform. Format: `DelegateToken <token>`'

````