Sample - GitHub REST API
PUT/repos/{owner}/{repo}/issues/comments/{comment_id}/pin

Pin an issue comment

Pins a specific issue comment in a repository. Supply owner, repo, and comment_id to identify the repository and comment, and use an accepted media type when you need a particular markdown representation in the response. The response includes the pinned comment and its pinning context.

  • RetriesRetries up to 2×, 500ms backoff, 30s timeout.

3 parameters
ownerstringrequired
The account owner of the repository; the name is not case sensitive.
repostringrequired
The repository name without the `.git` extension; the name is not case sensitive.
comment_idintegerrequired
The unique integer identifier of the issue comment to pin.

6 status codes
200Returns the pinned issue comment, including its content, repository association, reactions, and pin context such as who pinned it and when.
idintegerrequired
Unique identifier of the issue comment
node_idstringrequired
urlstringrequired
URL for the issue comment
bodystringoptional
Contents of the issue comment
body_textstringoptional
body_htmlstringoptional
html_urlstringrequired
userobjectrequired
A GitHub user.
created_atstringrequired
updated_atstringrequired
issue_urlstringrequired
author_associationstringoptional
How the author is associated with the repository.
Allowed:COLLABORATORCONTRIBUTORFIRST_TIMERFIRST_TIME_CONTRIBUTORMANNEQUINMEMBERNONEOWNER
performed_via_github_appobjectoptional
GitHub apps are a new way to extend GitHub. They can be installed directly on organizations and user accounts and granted access to specific repositories. They come with granular permissions and built-in webhooks. GitHub apps are first class actors within GitHub.
reactionsobjectoptional
pinobjectoptional
Context around who pinned an issue comment and when it was pinned.
minimizedobjectoptional
Details about why an issue comment was minimized.
401Returned when authentication is required to pin the issue comment.
messagestringoptional
documentation_urlstringoptional
urlstringoptional
statusstringoptional
403Returned when the authenticated user is not permitted to pin the issue comment.
messagestringoptional
documentation_urlstringoptional
urlstringoptional
statusstringoptional
404Returned when the repository or issue comment does not exist.
messagestringoptional
documentation_urlstringoptional
urlstringoptional
statusstringoptional
410Returned when the requested resource is gone.
messagestringoptional
documentation_urlstringoptional
urlstringoptional
statusstringoptional
422Returned when validation fails or the endpoint has been spammed.
messagestringrequired
documentation_urlstringrequired
errorsarray<object>optional

Error handling

A 401 is returned when authentication is required, and a 403 is returned when the authenticated user cannot perform the operation. A 404 is returned when the repository or comment cannot be found, while a 410 indicates the resource is gone. A 422 is returned when validation fails or the endpoint has been spammed; comment_id must be an integer.