Skip to content

GET /items/{itemId}/comments

List comments

Path parameters

NameTypeRequiredDescription
itemIdstring (uuid) required

Query parameters

NameTypeRequiredDescription
cursorstring optional
sizeinteger
  • default: 50
  • minimum: 1
  • maximum: 200
optional

Responses

  • 200 The comments, oldest first - a conversation reads top down. CommentPage
  • 4XX An error per RFC 9457 Problem
Example bash
curl -X GET "$HUBTASK_URL/items/{itemId}/comments" \  -H "Authorization: Bearer $HUBTASK_TOKEN"

POST /items/{itemId}/comments

Add comment

Path parameters

NameTypeRequiredDescription
itemIdstring (uuid) required

Headers

NameTypeRequiredDescription
Idempotency-Keystring (uuid) optionalA UUID; identical requests return the same result for 24 h.

Request body application/json

NameTypeRequiredDescription
bodystring
  • maxLength: 20000
required
parent_comment_idstring (uuid), or null optional

Responses

Example bash
curl -X POST "$HUBTASK_URL/items/{itemId}/comments" \  -H "Authorization: Bearer $HUBTASK_TOKEN" \  -H "Idempotency-Key: $(uuidgen)" \  -H "Content-Type: application/json" \  -d '{  "body": "string",  "parent_comment_id": "018f6e2a-2b7c-7c1e-9b1a-3d5e6f7a8b9c"}'

PATCH /items/{itemId}/comments/{commentId}

Edit comment

Rewrites a comment's text. Only its author or an administrator may; anybody else is refused exactly as any other missing permission is. The displaced text is not preserved - an edit is last writer wins over the body - and a deleted comment cannot be edited back into existence.

Path parameters

NameTypeRequiredDescription
itemIdstring (uuid) required
commentIdstring (uuid) required

Headers

NameTypeRequiredDescription
If-Matchstring optionalThe ETag of the state last read (optimistic locking).

Request body application/merge-patch+json

NameTypeRequiredDescription
bodystring
  • maxLength: 20000
required

Responses

Example bash
curl -X PATCH "$HUBTASK_URL/items/{itemId}/comments/{commentId}" \  -H "Authorization: Bearer $HUBTASK_TOKEN" \  -H 'If-Match: "<the ETag you read>"' \  -H "Content-Type: application/merge-patch+json" \  -d '{  "body": "string"}'

DELETE /items/{itemId}/comments/{commentId}

Delete comment

Removes a comment's text and marks it deleted, keeping the thread readable: the comment still answers with its identifier, author and timestamps, so a reply does not dangle. Only the author or an administrator may. Idempotent - deleting a deleted comment succeeds and announces nothing.

Path parameters

NameTypeRequiredDescription
itemIdstring (uuid) required
commentIdstring (uuid) required

Headers

NameTypeRequiredDescription
If-Matchstring optionalThe ETag of the state last read (optimistic locking).

Responses

  • 204 Deleted
  • 4XX An error per RFC 9457 Problem
Example bash
curl -X DELETE "$HUBTASK_URL/items/{itemId}/comments/{commentId}" \  -H "Authorization: Bearer $HUBTASK_TOKEN" \  -H 'If-Match: "<the ETag you read>"'