Update the resolved state of a review comment¶
PUT /api/v5/repos/{owner}/{repo}/pulls/{number}/comments/{discussion_id}
This endpoint updates the resolved state of a review comment (comment/discussion) in a specified pull request. Use the resolved field in the request body to set whether the review comment is resolved.
Access token support¶
- AtomGit user access tokens
Anonymous access¶
This endpoint allows anonymous access.
Request parameters¶
| Parameter | Location | Type | Required | Description |
|---|---|---|---|---|
owner |
path | string | Yes | Address of the namespace the repository belongs to (the address path of the enterprise, organization, or individual) |
repo |
path | string | Yes | Repository path (path) |
number |
path | integer | Yes | The PR number, i.e. the sequence number of the PR in this repository; corresponds to iid |
discussion_id |
path | string | Yes | Discussion ID (a string id) |
Request Body:
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"properties": {
"resolved": {
"description": "Whether it is resolved",
"type": "boolean"
}
},
"required": ["resolved"]
}
Response parameters¶
The response body of this endpoint is empty (200 OK, with no response body content).
Error responses¶
This endpoint has no business failure response. If the request body format is invalid or the access credentials are invalid, the corresponding HTTP status code is returned (such as 400 / 401). The error field names are subject to what the backend actually returns.
HTTP response status codes¶
| Status code | Description |
|---|---|
200 |
Success (OK) |
304 |
Not modified |
401 |
Requires authentication |
403 |
Forbidden |
Request example¶
Parameter description¶
In the example, replace <owner> with the address of the namespace the repository belongs to (the address path of the enterprise, organization, or individual); replace <repo> with the repository path; replace <number> with the PR number (iid); replace <discussion_id> with the discussion ID. This endpoint allows anonymous access, so you can omit the access token (you can also pass an AtomGit user access token).
cURL¶
curl -X PUT 'https://api.atomgit.com/api/v5/repos/<owner>/<repo>/pulls/<number>/comments/<discussion_id>' \
-H 'Content-Type: application/json' \
-d '{"resolved": true}'
JavaScript¶
// Native fetch (Node.js 18+ / browser)
const response = await fetch("https://api.atomgit.com/api/v5/repos/<owner>/<repo>/pulls/<number>/comments/<discussion_id>", {
method: "PUT",
headers: {
"Content-Type": "application/json",
},
body: JSON.stringify({ resolved: true }),
});
if (!response.ok) {
throw new Error(`Request failed: ${response.status}`);
}
Python¶
import requests
resp = requests.put(
"https://api.atomgit.com/api/v5/repos/<owner>/<repo>/pulls/<number>/comments/<discussion_id>",
json={"resolved": True},
timeout=10,
)
resp.raise_for_status()
Response example¶
Status code: 200
Error codes¶
| Error code | Description |
|---|---|
401 |
Unauthenticated or invalid credentials (missing or invalid access credentials) |
400 |
Parameter error, or the request cannot be parsed |
404 |
Request path does not exist |
405 |
Request method not supported |
429 |
Too many requests; rate limit triggered |
500 |
Internal system error |
Markdown source: View on AtomGit·Content from the open-source project gitcode-dev/atomgit-api-doc