API reference · Hubtask API 0.1.0
comments
GET /items/{itemId}/comments
List comments
Path parameters
Query parameters
Responses
200The comments, oldest first - a conversation reads top down. CommentPage4XXAn error per RFC 9457 Problem
curl -X GET "$HUBTASK_URL/items/{itemId}/comments" \ -H "Authorization: Bearer $HUBTASK_TOKEN" POST /items/{itemId}/comments
Add comment
Path parameters
Headers
Request body application/json
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
Headers
Request body application/merge-patch+json
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
Headers
Responses
204Deleted4XXAn error per RFC 9457 Problem
curl -X DELETE "$HUBTASK_URL/items/{itemId}/comments/{commentId}" \ -H "Authorization: Bearer $HUBTASK_TOKEN" \ -H 'If-Match: "<the ETag you read>"'