# Update comment

This will update an existing comment.

[info]
You can only update a comment created by the API.
[/info]

[endpoint]
base_url = "https://uptime.betterstack.com"
path = "/api/v2/incidents/{incident_id}/comments/{comment_id}"
method = "PATCH"

[[path_param]]
name = "incident_id"
description = "The ID of the incident"
required = true
type = "string"

[[path_param]]
name = "comment_id"
description = "The ID of the comment"
required = true
type = "string"

[[body_param]]
name = "content"
description = "The content of the comment. [Markdown](https://www.markdownguide.org/basic-syntax/) is supported for formatting."
required = true
type = "string"

[[header]]
name = "Authorization"
description = "Bearer `$TOKEN`"
required = true
type = "string"

[[header]]
name = "Content_Type"
description = "application/json"
required = false
type = "string"
[/endpoint]

[responses]
[[response]]
status = 200
description = '''The comment was successfully updated'''
body = '''{
  "data": {
    "id": "1",
    "type": "incident_comment",
    "attributes": {
      "id": 1,
      "content": "new content",
      "created_at": "2025-06-03T12:10:28.357Z",
      "updated_at": "2025-06-03T12:10:28.357Z"
    }
  }
}'''

[[response]]
status = 404
description = '''Comment or incident was not found'''
body = ''''''
[/responses]

#### Example cURL 

[code-tabs]
```shell
[label Simple text]
curl --request PATCH \
  --url https://uptime.betterstack.com/api/v2/incidents/1/comments/1 \
  --header "Authorization: Bearer $TOKEN" \
  --header 'Content-Type: application/json' \
  --data '{ "content": "Updated comment content" }'
```
```shell
[label Rich-formatted comment]
curl --request PATCH \
  --url https://uptime.betterstack.com/api/v2/incidents/1/comments/1 \
  --header "Authorization: Bearer $TOKEN" \
  --header 'Content-Type: application/json' \
  --data '{
    "content": "# 🚨 Incident Update\n\nHere is the current system status:\n\n| Component | Status       |\n|-----------|--------------|\n| API       | ✅ Operational |\n| Database  | 🔄 Restarting |\n| Cache     | ❌ Down       |\n\n_Updated automatically via API._"
  }'
```
[/code-tabs]