Notion: Update a comment
Notion comments.updateAComment: arguments, response, policy and SDK examples.
← Comments operations · Get started
Operation notion.update_a_comment
Provider route: PATCH /v1/comments/{comment_id}. Alter supplies the connection’s credentials and routing.
Call through Alter
Section titled “Call through Alter”Install @alter-ai/sdk @alter-ai/notion with npm, or alter-sdk-notion with pip. Supply your connected customer’s grant ID and the arguments described below.
import { App } from "@alter-ai/sdk";import { NotionIntegration } from "@alter-ai/notion";
async function execute(input: Parameters<NotionIntegration["comments"]["updateAComment"]>[0]) { const app = new App({ apiKey: process.env.ALTER_API_KEY! }); try { const provider = new NotionIntegration(app, { grantId: process.env.PROVIDER_GRANT_ID! }); const call = await provider.comments.updateAComment(input); const result = await call.wait(); return result.bodyJson(); } finally { await app.close(); }}import osfrom alter_sdk import Appfrom alter_sdk_notion import NotionIntegration
async def execute(arguments): async with App(api_key=os.environ["ALTER_API_KEY"]) as app: provider = NotionIntegration(app, {"grant_id": os.environ["PROVIDER_GRANT_ID"]}) call = await provider.comments.update_a_comment(arguments) result = await call.wait() return result.body_json()| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | Additional keys: not allowed |
path | object | Required within parent | Additional keys: not allowed |
path.comment_id | string | Required within parent | The ID of the comment to update. |
body | JSON | Required within parent | |
body (allOf 1) | object | All variants apply | |
body (allOf 1).markdown_version | string | Optional | The Markdown syntax to use. `v2` is [Notion-flavored Markdown](/guides/data-apis/notion-flavored-markdown) and is recommended. `v1` is enhanced markdown. It’s deprecated. It’s the default on current Notion-Versions. The next Notion-Version rejects `v1` with a `400` `validation_error`. One of: v1, v2 |
body (allOf 2) | JSON | All variants apply | |
body (allOf 2) (oneOf 1) | object | Alternative | |
body (allOf 2) (oneOf 1).rich_text | array | Required within parent | An array of rich text objects that represent the updated content of the comment. Maximum items: 100 |
body (allOf 2) (oneOf 1).rich_text[] | Model | Each item | Expand Create a database — request body — body title item |
body (allOf 2) (oneOf 2) | object | Alternative | |
body (allOf 2) (oneOf 2).markdown | string | Required within parent | The updated content of the comment as a Markdown string. Comment Markdown supports inline formatting only (bold, italic, strikethrough, code, links), inline equations ($expression$), and mentions. Block-level Markdown such as fenced code blocks, headings, lists, tables, and blockquotes does not render as structured blocks in comments. |
Referenced models: Create a database — request body — body title item
Response
Section titled “Response”Response media type: application/json. The table describes the pinned successful response. Referenced models link to their complete fields.
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | JSON | Root | |
$ (anyOf 1) | Model | Alternative | Expand Create a comment — response body — object comment — partial Comment Object Response |
$ (anyOf 2) | Model | Alternative | Expand Create a comment — response body — object comment — comment Object Response |
Referenced models: Create a comment — response body — object comment — comment Object Response, Create a comment — response body — object comment — partial Comment Object Response
Schemas
Section titled “Schemas”27 more schemas are linked from the tables above, on the schema pages.
Create a comment — response body — object comment — comment Object Response
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | Additional keys: allowed |
attachments | array | Optional | Any file attachments associated with the comment. Maximum items: 100 |
attachments[] | object | Each item | Additional keys: allowed |
attachments[].category | string | Required within parent | One of: `audio`, `image`, `pdf`, `productivity`, `video` Known values: audio, image, pdf, productivity, video |
attachments[].file | Model | Required within parent | Expand Get agent — response body — icon value File file |
created_by | Model | Required within parent | Expand Update page — response body — object page created by The user who created the comment. |
created_time | string | Required within parent | The time when the comment was created. Format: date-time |
discussion_id | string | Required within parent | The ID of the discussion thread this comment belongs to. Format: uuid |
display_name | object | Required within parent | The display name of the comment. Additional keys: allowed |
display_name.resolved_name | JSON | Required within parent | |
display_name.resolved_name (anyOf 1) | string | Alternative | |
display_name.resolved_name (anyOf 2) | null | Alternative | |
display_name.type | string | Required within parent | One of: `custom`, `user`, `integration` Known values: custom, user, integration |
has_pending_attachments | boolean | Required within parent | Whether any file attachments on this comment are still uploading. Pending files are not listed in `attachments` yet. A `comment.updated` webhook is sent when each upload finishes. |
id | string | Required within parent | The ID of the comment. Format: uuid |
last_edited_time | string | Required within parent | The time when the comment was last edited. Format: date-time |
object | string | Required within parent | The comment object type name. Must equal: comment |
original_content_deleted | boolean | Required within parent | Whether this comment's original content was deleted. |
parent | Model | Required within parent | Expand Create a comment — response body — object comment parent The parent of the comment. |
property_id | string | Optional | The ID of the database property the comment is on, for comments on a page property. Matches the property's `id` in the page object. Omitted for other comments. |
rich_text | array | Required within parent | The rich text content of the comment. Maximum items: 100 |
rich_text[] | Model | Each item | Expand Retrieve a page property item — response body — value Title title |
Referenced models: Create a comment — response body — object comment parent, Get agent — response body — icon value File file, Update page — response body — object page created by, Retrieve a page property item — response body — value Title title
Create a comment — response body — object comment — partial Comment Object Response
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | Additional keys: allowed |
id | string | Required within parent | The ID of the comment. Format: uuid |
object | string | Required within parent | The comment object type name. Must equal: comment |
Create a database — request body — body title item
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | JSON | Root | |
$ (allOf 1) | Model | All variants apply | Expand Create a database — request body — body title item annotations |
$ (allOf 2) | JSON | All variants apply | |
$ (allOf 2) (oneOf 1) | Model | Alternative | Expand Create a database — request body — body title item value Text |
$ (allOf 2) (oneOf 2) | Model | Alternative | Expand Create a database — request body — body title item value Mention |
$ (allOf 2) (oneOf 3) | Model | Alternative | Expand Create a database — request body — body title item value Equation |
Referenced models: Create a database — request body — body title item value Equation, Create a database — request body — body title item value Mention, Create a database — request body — body title item annotations, Create a database — request body — body title item value Text
Create a comment — response body — object comment parent
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | JSON | Root | |
$ (anyOf 1) | Model | Alternative | Expand Create a comment — response body — object comment parent Page Id |
$ (anyOf 2) | Model | Alternative | Expand Create a comment — response body — object comment parent Block Id |
Referenced models: Create a comment — response body — object comment parent Block Id, Create a comment — response body — object comment parent Page Id
Get agent — response body — icon value File file
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | Additional keys: allowed |
expiry_time | string | Required within parent | The time when the URL will expire. Format: date-time |
url | string | Required within parent | The URL of the file. |
Update page — response body — object page created by
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | Additional keys: allowed |
id | string | Required within parent | Format: uuid |
object | string | Required within parent | Always `user` Must equal: user |
Retrieve a page property item — response body — value Title title
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | JSON | Root | |
$ (allOf 1) | Model | All variants apply | Expand Retrieve a page property item — response body — value Title title annotations, href, plain text |
$ (allOf 2) | JSON | All variants apply | |
$ (allOf 2) (anyOf 1) | Model | Alternative | Expand Retrieve a page property item — response body — value Title title value Text |
$ (allOf 2) (anyOf 2) | Model | Alternative | Expand Retrieve a page property item — response body — value Title title value Mention |
$ (allOf 2) (anyOf 3) | Model | Alternative | Expand Retrieve a page property item — response body — value Title title value Equation |
Referenced models: Retrieve a page property item — response body — value Title title value Equation, Retrieve a page property item — response body — value Title title value Mention, Retrieve a page property item — response body — value Title title annotations, href, plain text, Retrieve a page property item — response body — value Title title value Text
Create a database — request body — body title item value Equation
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | |
equation | object | Required within parent | Notion supports inline LaTeX equations as rich text objects with a type value of `equation`. |
equation.expression | string | Required within parent | A KaTeX compatible string. |
type | string | Optional | Always `equation` Must equal: equation |
Create a database — request body — body title item annotations
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | |
annotations | Model | Optional | Expand Create a database — request body — body title item annotations annotations All rich text objects contain an annotations object that sets the styling for the rich text. |
Referenced models: Create a database — request body — body title item annotations annotations
Create a database — request body — body title item value Text
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | |
text | object | Required within parent | If a rich text object's type value is `text`, then the corresponding text field contains an object including the text content and any inline link. Additional keys: not allowed |
text.content | string | Required within parent | The actual text content of the text. Maximum length: 2000 |
text.link | JSON | Optional | An object with information about any inline link in this text, if included. |
text.link (oneOf 1) | object | Alternative | |
text.link (oneOf 1).url | string | Required within parent | The URL of the link. |
text.link (oneOf 2) | null | Alternative | |
type | string | Optional | Always `text` Must equal: text |
Policy, approvals and errors
Section titled “Policy, approvals and errors”SDK function policy ID: notion.update_a_comment. Catalog operation: update_a_comment. Rules can name either ID; function rules distinguish managed calls and conservatively cover raw calls sharing the route. Existing grant permissions and policy rules apply. wait() returns an immediate result or waits for a required approval; it never approves the request itself. Persist the approval ID to resume after a restart.
Provider errors retain their response; JSON decoding raises ProviderAPIError for provider failures. ManagedOperationError identifies contract/input/retention errors. See error handling and provider-specific behavior. Sensitive input may be refused before approval storage. A decoding error never resubmits a write.
Pinned headers: {"Notion-Version": "2026-03-11"}