Skip to content

feat(comment): add 'comment update' and 'comment delete'#44

Merged
4ier merged 1 commit into
mainfrom
feat/comment-update-delete
Apr 30, 2026
Merged

feat(comment): add 'comment update' and 'comment delete'#44
4ier merged 1 commit into
mainfrom
feat/comment-update-delete

Conversation

@4ier
Copy link
Copy Markdown
Owner

@4ier 4ier commented Apr 30, 2026

Closes #33. Wraps PATCH /v1/comments/:id and DELETE /v1/comments/:id (both added in Notion's 2025 API).

  • update reuses buildCommentRichText--mention-user works the same as comment add.
  • delete follows block delete pattern: variadic, per-id error isolation, summary count.

Smoke-tested end-to-end against a real workspace.

Wraps two endpoints added in Notion's 2025 API that the CLI didn't yet
expose:

- PATCH /v1/comments/:id  → 'notion comment update <id> --text ...'
- DELETE /v1/comments/:id → 'notion comment delete <id> [<id> ...]'

'update' reuses the existing buildCommentRichText helper so the
--mention-user flag works the same way as 'comment add'.

'delete' follows the 'block delete' pattern: variadic args, per-id
error isolation, and a summary line (N comment(s) deleted). When the
target id is the anchor of a discussion, Notion removes the whole
thread; deleting a reply removes just that one comment — this is
documented in the Long help.

Two new client methods (UpdateComment, DeleteComment) keep the API
plumbing in internal/client alongside AddComment.

Smoke-tested against a real workspace: create comment → update text →
verify new text via 'comment get' → delete → raw DELETE on the same id
returns object_not_found as expected (the synchronous GET path is
eventually consistent server-side, which is a Notion behavior, not a
CLI issue).

Closes #33
@4ier 4ier merged commit 5ec113f into main Apr 30, 2026
3 of 4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

comment update / comment delete: expose the two new 2025 API endpoints

1 participant