---
title: "Add or update a comment"
method: POST
path: "/api/board/{boardId}/{cardId}/comment"
tags: ["Cards"]
---

# Add or update a comment

`POST /api/board/{boardId}/{cardId}/comment`

## Request

- Base URL: `https://core-api.getaptly.com`
- URL: `https://core-api.getaptly.com/api/board/{boardId}/{cardId}/comment`
- Auth: one of:
  - API key in header `x-token`
  - API key in header `Authorization`
- TypeScript: <https://skmtc.dev/getaptly/apis/aptly-api/docs/api/board/:boardId/:cardId/comment/post.ts> (a function with typed inputs; its response is checked against the schema)

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.

## Path parameters

- `boardId` string, required
- `cardId` string, required

## Request body

- object
  - `userId` string, required: Aptly user ID of the comment author.
  - `content` string, required: Comment text.
  - `id` string: Existing comment ID — include to update rather than create.

## Response `200`

Comment created or updated.

- object
  - `data` Comment
    - `id` string
    - `userId` string
    - `content` string
    - `createdAt` string, date-time

## Other responses

- `401`: Invalid or missing API key.
- `404`: Card or comment not found.

---

[API](https://skmtc.dev/getaptly/apis/aptly-api.md) - [All operations](https://skmtc.dev/getaptly/apis/aptly-api/llms.txt) - [OpenAPI document](https://skmtc.dev/getaptly/apis/aptly-api/revisions/75c367e0b8e5?raw)
