TypeScript SDK
import { Client } from "@notionhq/client"
const notion = new Client({ auth: process.env.NOTION_API_KEY })
const response = await notion.comments.update({
comment_id: "c02fc1d3-db8b-45c5-a222-27595b15aea7",
rich_text: [{ text: { content: "Updated comment text" } }]
})curl --request PATCH \
--url https://api.notion.com/v1/comments/{comment_id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'Notion-Version: <notion-version>' \
--data '
{
"rich_text": [
{
"text": {
"content": "<string>",
"link": {
"url": "https://www.notion.com"
}
},
"annotations": {
"bold": true,
"italic": true,
"strikethrough": true,
"underline": true,
"code": true
},
"type": "text"
}
]
}
'import requests
url = "https://api.notion.com/v1/comments/{comment_id}"
payload = { "rich_text": [
{
"text": {
"content": "<string>",
"link": { "url": "https://www.notion.com" }
},
"annotations": {
"bold": True,
"italic": True,
"strikethrough": True,
"underline": True,
"code": True
},
"type": "text"
}
] }
headers = {
"Notion-Version": "<notion-version>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.notion.com/v1/comments/{comment_id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'rich_text' => [
[
'text' => [
'content' => '<string>',
'link' => [
'url' => 'https://www.notion.com'
]
],
'annotations' => [
'bold' => true,
'italic' => true,
'strikethrough' => true,
'underline' => true,
'code' => true
],
'type' => 'text'
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json",
"Notion-Version: <notion-version>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.notion.com/v1/comments/{comment_id}"
payload := strings.NewReader("{\n \"rich_text\": [\n {\n \"text\": {\n \"content\": \"<string>\",\n \"link\": {\n \"url\": \"https://www.notion.com\"\n }\n },\n \"annotations\": {\n \"bold\": true,\n \"italic\": true,\n \"strikethrough\": true,\n \"underline\": true,\n \"code\": true\n },\n \"type\": \"text\"\n }\n ]\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("Notion-Version", "<notion-version>")
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.patch("https://api.notion.com/v1/comments/{comment_id}")
.header("Notion-Version", "<notion-version>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"rich_text\": [\n {\n \"text\": {\n \"content\": \"<string>\",\n \"link\": {\n \"url\": \"https://www.notion.com\"\n }\n },\n \"annotations\": {\n \"bold\": true,\n \"italic\": true,\n \"strikethrough\": true,\n \"underline\": true,\n \"code\": true\n },\n \"type\": \"text\"\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.notion.com/v1/comments/{comment_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Notion-Version"] = '<notion-version>'
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"rich_text\": [\n {\n \"text\": {\n \"content\": \"<string>\",\n \"link\": {\n \"url\": \"https://www.notion.com\"\n }\n },\n \"annotations\": {\n \"bold\": true,\n \"italic\": true,\n \"strikethrough\": true,\n \"underline\": true,\n \"code\": true\n },\n \"type\": \"text\"\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"object": "comment",
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}{
"object": "error",
"message": "<string>",
"code": "invalid_json",
"status": 400,
"additional_data": {}
}{
"object": "error",
"message": "<string>",
"code": "unauthorized",
"status": 401,
"additional_data": {}
}{
"object": "error",
"message": "<string>",
"code": "restricted_resource",
"status": 403,
"additional_data": {}
}{
"object": "error",
"message": "<string>",
"code": "object_not_found",
"status": 404,
"additional_data": {}
}{
"object": "error",
"message": "<string>",
"code": "row_limit_exceeded",
"status": 406,
"additional_data": {}
}{
"object": "error",
"message": "<string>",
"code": "conflict_error",
"status": 409,
"additional_data": {}
}{
"object": "error",
"message": "<string>",
"code": "rate_limited",
"status": 429,
"additional_data": {}
}{
"object": "error",
"message": "<string>",
"code": "internal_server_error",
"status": 500,
"additional_data": {}
}{
"object": "error",
"message": "<string>",
"code": "service_unavailable",
"status": 503,
"additional_data": {}
}{
"object": "error",
"message": "<string>",
"code": "gateway_timeout",
"status": 504,
"additional_data": {}
}{
"object": "error",
"message": "<string>",
"code": "service_overload",
"status": 529,
"additional_data": {}
}Comments
Update comment
Updates a comment by its comment_id.
PATCH
/
v1
/
comments
/
{comment_id}
TypeScript SDK
import { Client } from "@notionhq/client"
const notion = new Client({ auth: process.env.NOTION_API_KEY })
const response = await notion.comments.update({
comment_id: "c02fc1d3-db8b-45c5-a222-27595b15aea7",
rich_text: [{ text: { content: "Updated comment text" } }]
})curl --request PATCH \
--url https://api.notion.com/v1/comments/{comment_id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'Notion-Version: <notion-version>' \
--data '
{
"rich_text": [
{
"text": {
"content": "<string>",
"link": {
"url": "https://www.notion.com"
}
},
"annotations": {
"bold": true,
"italic": true,
"strikethrough": true,
"underline": true,
"code": true
},
"type": "text"
}
]
}
'import requests
url = "https://api.notion.com/v1/comments/{comment_id}"
payload = { "rich_text": [
{
"text": {
"content": "<string>",
"link": { "url": "https://www.notion.com" }
},
"annotations": {
"bold": True,
"italic": True,
"strikethrough": True,
"underline": True,
"code": True
},
"type": "text"
}
] }
headers = {
"Notion-Version": "<notion-version>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.notion.com/v1/comments/{comment_id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'rich_text' => [
[
'text' => [
'content' => '<string>',
'link' => [
'url' => 'https://www.notion.com'
]
],
'annotations' => [
'bold' => true,
'italic' => true,
'strikethrough' => true,
'underline' => true,
'code' => true
],
'type' => 'text'
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json",
"Notion-Version: <notion-version>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.notion.com/v1/comments/{comment_id}"
payload := strings.NewReader("{\n \"rich_text\": [\n {\n \"text\": {\n \"content\": \"<string>\",\n \"link\": {\n \"url\": \"https://www.notion.com\"\n }\n },\n \"annotations\": {\n \"bold\": true,\n \"italic\": true,\n \"strikethrough\": true,\n \"underline\": true,\n \"code\": true\n },\n \"type\": \"text\"\n }\n ]\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("Notion-Version", "<notion-version>")
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.patch("https://api.notion.com/v1/comments/{comment_id}")
.header("Notion-Version", "<notion-version>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"rich_text\": [\n {\n \"text\": {\n \"content\": \"<string>\",\n \"link\": {\n \"url\": \"https://www.notion.com\"\n }\n },\n \"annotations\": {\n \"bold\": true,\n \"italic\": true,\n \"strikethrough\": true,\n \"underline\": true,\n \"code\": true\n },\n \"type\": \"text\"\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.notion.com/v1/comments/{comment_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Notion-Version"] = '<notion-version>'
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"rich_text\": [\n {\n \"text\": {\n \"content\": \"<string>\",\n \"link\": {\n \"url\": \"https://www.notion.com\"\n }\n },\n \"annotations\": {\n \"bold\": true,\n \"italic\": true,\n \"strikethrough\": true,\n \"underline\": true,\n \"code\": true\n },\n \"type\": \"text\"\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"object": "comment",
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}{
"object": "error",
"message": "<string>",
"code": "invalid_json",
"status": 400,
"additional_data": {}
}{
"object": "error",
"message": "<string>",
"code": "unauthorized",
"status": 401,
"additional_data": {}
}{
"object": "error",
"message": "<string>",
"code": "restricted_resource",
"status": 403,
"additional_data": {}
}{
"object": "error",
"message": "<string>",
"code": "object_not_found",
"status": 404,
"additional_data": {}
}{
"object": "error",
"message": "<string>",
"code": "row_limit_exceeded",
"status": 406,
"additional_data": {}
}{
"object": "error",
"message": "<string>",
"code": "conflict_error",
"status": 409,
"additional_data": {}
}{
"object": "error",
"message": "<string>",
"code": "rate_limited",
"status": 429,
"additional_data": {}
}{
"object": "error",
"message": "<string>",
"code": "internal_server_error",
"status": 500,
"additional_data": {}
}{
"object": "error",
"message": "<string>",
"code": "service_unavailable",
"status": 503,
"additional_data": {}
}{
"object": "error",
"message": "<string>",
"code": "gateway_timeout",
"status": 504,
"additional_data": {}
}{
"object": "error",
"message": "<string>",
"code": "service_overload",
"status": 529,
"additional_data": {}
}Returns a comment object for the updated comment.
A connection can only update comments that it created. Attempting to update a comment created by another user or connection will return a 404 error.
Comment body format
The comment body can be provided in one of two formats:rich_text: An array of rich text objects that represent the updated content of the comment.markdown: A Markdown string. Supports inline formatting (bold, italic, strikethrough, inline code, links), inline equations, and mentions.
rich_text or markdown must be provided. Providing both or neither will return a validation error.
Errors
Each Public API endpoint can return several possible error codes. See the Error codes section of the Status codes documentation for more information.Reminder: Turn on connection comment capabilitiesConnection capabilities for reading and inserting comments are off by default.This endpoint requires a connection to have insert comment capabilities. Attempting to call this endpoint without insert comment capabilities will return an HTTP response with a 403 status code.For more information on connection capabilities, see the capabilities guide. To update your connection settings, visit the Developer portal.
Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Headers
The API version to use for this request. The latest version is 2026-03-11.
Available options:
2026-03-11 Path Parameters
The ID of the comment to update.
Body
application/json
- Option 1
- Option 2
An array of rich text objects that represent the updated content of the comment.
Maximum array length:
100- Text
- Mention
- Equation
Show child attributes
Show child attributes
⌘I