# Create comment

This will create a new comment.

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

[[path_param]]
name = "incident_id"
description = "The ID of the incident"
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 = 201
description = '''The comment was successfully created'''
body = '''{
  "data": {
    "id": "123",
    "type": "incident_comment",
    "attributes": {
      "id": 123,
      "content": "posted from API",
      "created_at": "2025-06-03T12:10:28.357Z",
      "updated_at": "2025-06-03T12:10:28.357Z"
    }
  }
}'''

[[response]]
status = 403
description = '''Authentication failed'''
body = ''''''
[/responses]

#### Example cURL 

[code-tabs]
```shell
[label Simple text]
curl --request POST \
  --url https://uptime.betterstack.com/api/v2/incidents/1/comments \
  --header "Authorization: Bearer $TOKEN" \
  --header 'Content-Type: application/json' \
  --data '{"content": "Posted from API"}'
```
```shell
[label Rich-formatted comment]
curl --request POST \
  --url https://uptime.betterstack.com/api/v2/incidents/1/comments \
  --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]