CommentsAPI
Defined in: src/api/comments.api.ts:82
Comments API client for working with Notion comments.
Extends
Section titled “Extends”BaseAPI<NotionComment,Comment>
Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new CommentsAPI(
client):CommentsAPI
Defined in: src/api/comments.api.ts:89
Parameters
Section titled “Parameters”client
Section titled “client”NotionClient
Returns
Section titled “Returns”CommentsAPI
Overrides
Section titled “Overrides”BaseAPI<NotionComment, Comment>.constructor
Methods
Section titled “Methods”create()
Section titled “create()”create(
options):Promise<Comment>
Defined in: src/api/comments.api.ts:119
Create a new comment on a page or block.
Parameters
Section titled “Parameters”options
Section titled “options”CreateCommentOptions
Options for creating the comment
Returns
Section titled “Returns”Promise<Comment>
The created comment wrapped in a Comment model
https://developers.notion.com/reference/create-a-comment
delete()
Section titled “delete()”delete(
commentId):Promise<Comment>
Defined in: src/api/comments.api.ts:157
Delete a comment. A connection can only delete comments it created.
Parameters
Section titled “Parameters”commentId
Section titled “commentId”string
The ID of the comment to delete
Returns
Section titled “Returns”Promise<Comment>
The deleted comment wrapped in a Comment model
https://developers.notion.com/reference/delete-a-comment
list()
Section titled “list()”list(
parentId,params?):Promise<PaginatedList<Comment>>
Defined in: src/api/comments.api.ts:102
Retrieve all comments from a page or block (paginated).
Parameters
Section titled “Parameters”parentId
Section titled “parentId”string
The ID of the parent page, block, or database
params?
Section titled “params?”Pagination parameters
Returns
Section titled “Returns”Promise<PaginatedList<Comment>>
Paginated list of comments
https://developers.notion.com/reference/retrieve-a-comment
update()
Section titled “update()”update(
commentId,options):Promise<Comment>
Defined in: src/api/comments.api.ts:140
Update an existing comment’s content.
Parameters
Section titled “Parameters”commentId
Section titled “commentId”string
The ID of the comment to update
options
Section titled “options”UpdateCommentOptions
The updated comment content (rich_text or markdown)
Returns
Section titled “Returns”Promise<Comment>
The updated comment wrapped in a Comment model