Skip to content

Update a commit comment

PATCH
/repos/{owner}/{repo}/comments/{comment_id}

Updates the contents of a specified commit comment.

This endpoint supports the following custom media types. For more information, see “Media types.”

  • application/vnd.github-commitcomment.raw+json: Returns the raw markdown body. Response will include body. This is the default if you do not pass any specific media type.
  • application/vnd.github-commitcomment.text+json: Returns a text only representation of the markdown body. Response will include body_text.
  • application/vnd.github-commitcomment.html+json: Returns HTML rendered from the body’s markdown. Response will include body_html.
  • application/vnd.github-commitcomment.full+json: Returns raw, text, and HTML representations. Response will include body, body_text, and body_html.

API method documentation

owner
required
string

The account owner of the repository. The name is not case sensitive.

repo
required
string

The name of the repository without the .git extension. The name is not case sensitive.

comment_id
required
integer format: int64

The unique identifier of the comment.

Media type application/json
object
body
required

The contents of the comment

string
Examples
Example default
{
"body": "Nice change"
}

Response

Media type application/json
Commit Comment

Commit Comment

object
html_url
required
string format: uri
url
required
string format: uri
id
required
integer
node_id
required
string
body
required
string
path
required
string
nullable
position
required
integer
nullable
line
required
integer
nullable
commit_id
required
string
user
required
Simple User

A GitHub user.

object
name
string
nullable
email
string
nullable
login
required
string
id
required
integer format: int64
node_id
required
string
avatar_url
required
string format: uri
gravatar_id
required
string
nullable
url
required
string format: uri
html_url
required
string format: uri
followers_url
required
string format: uri
following_url
required
string
gists_url
required
string
starred_url
required
string
subscriptions_url
required
string format: uri
organizations_url
required
string format: uri
repos_url
required
string format: uri
events_url
required
string
received_events_url
required
string format: uri
type
required
string
site_admin
required
boolean
starred_at
string
user_view_type
string
created_at
required
string format: date-time
updated_at
required
string format: date-time
author_association
required
author_association

How the author is associated with the repository.

string
Allowed values: COLLABORATOR CONTRIBUTOR FIRST_TIMER FIRST_TIME_CONTRIBUTOR MANNEQUIN MEMBER NONE OWNER
reactions
Reaction Rollup
object
url
required
string format: uri
total_count
required
integer
+1
required
integer
-1
required
integer
laugh
required
integer
confused
required
integer
heart
required
integer
hooray
required
integer
eyes
required
integer
rocket
required
integer
Examples
Example default
{
"html_url": "https://github.com/octocat/Hello-World/commit/6dcb09b5b57875f334f61aebed695e2e4193db5e#commitcomment-1",
"url": "https://api.github.com/repos/octocat/Hello-World/comments/1",
"id": 1,
"node_id": "MDEzOkNvbW1pdENvbW1lbnQx",
"body": "Nice change",
"path": "file1.txt",
"position": 4,
"line": 14,
"commit_id": "6dcb09b5b57875f334f61aebed695e2e4193db5e",
"author_association": "COLLABORATOR",
"user": {
"login": "octocat",
"id": 1,
"node_id": "MDQ6VXNlcjE=",
"avatar_url": "https://github.com/images/error/octocat_happy.gif",
"gravatar_id": "",
"url": "https://api.github.com/users/octocat",
"html_url": "https://github.com/octocat",
"followers_url": "https://api.github.com/users/octocat/followers",
"following_url": "https://api.github.com/users/octocat/following{/other_user}",
"gists_url": "https://api.github.com/users/octocat/gists{/gist_id}",
"starred_url": "https://api.github.com/users/octocat/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/octocat/subscriptions",
"organizations_url": "https://api.github.com/users/octocat/orgs",
"repos_url": "https://api.github.com/users/octocat/repos",
"events_url": "https://api.github.com/users/octocat/events{/privacy}",
"received_events_url": "https://api.github.com/users/octocat/received_events",
"type": "User",
"site_admin": false
},
"created_at": "2011-04-14T16:00:49Z",
"updated_at": "2011-04-14T16:00:49Z"
}

Resource not found

Media type application/json
Basic Error

Basic Error

object
message
string
documentation_url
string
url
string
status
string
Example generated
{
"message": "example",
"documentation_url": "example",
"url": "example",
"status": "example"
}