Update an Issue comment¶
PATCH /api/v5/repos/{owner}/{repo}/issues/comments/{id}
This endpoint updates the content of a comment on an issue in the specified repository. You can submit a new comment body to replace the existing comment. On success, it returns an empty object.
Access token support¶
- AtomGit user access token (AtomGit user access tokens)
Anonymous access¶
This endpoint does not allow anonymous access.
Request parameters¶
| Parameter | Location | Type | Required | Description |
|---|---|---|---|---|
owner |
path | string | Yes | Namespace address that owns the repository (path of an enterprise, organization, or personal address) |
repo |
path | string | Yes | Repository path (path) |
id |
path | string | Yes | Comment ID |
access_token |
query | string | Yes | User access token |
Request Body:
The request body is submitted in JSON format and contains the updated comment content.
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"properties": {
"body": {
"description": "Comment content",
"type": "string"
}
},
"required": ["body"]
}
Response parameters¶
On success, the endpoint returns an empty object with no response body fields.
Error responses¶
On failure, a unified error response structure is returned. The main fields are as follows (field names are subject to the actual backend response):
400 Invalid parameters
{
"error_code": 400,
"error_code_name": "BAD_REQUEST",
"error_message": "Invalid request parameters",
"trace_id": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
}
401 Unauthenticated
{
"error_code": 401,
"error_code_name": "UNAUTHORIZED",
"error_message": "Token missing, invalid, or expired",
"trace_id": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
}
HTTP response status codes¶
| Status code | Description |
|---|---|
200 |
Success (OK) |
400 |
Bad request |
401 |
Requires authentication |
403 |
Forbidden |
404 |
Request path not found (Not found) |
405 |
Request method not allowed (Method not allowed) |
429 |
Rate limited |
500 |
Internal server error |
Request example¶
Parameter notes¶
Replace
<owner>with the namespace address that owns the repository (path of an enterprise, organization, or personal address); replace<repo>with the repository path (path); replace<id>with the ID of the comment to update; replace<token>with your AtomGit user access token.
cURL¶
curl -X PATCH 'https://api.atomgit.com/api/v5/repos/<owner>/<repo>/issues/comments/<id>?access_token=<token>' \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-d '{"body": "Updated comment content"}'
JavaScript¶
// Native fetch (Node.js 18+ / browser)
const response = await fetch("https://api.atomgit.com/api/v5/repos/<owner>/<repo>/issues/comments/<id>?access_token=<token>", {
method: "PATCH",
headers: {
"Content-Type": "application/json",
"Accept": "application/json",
},
body: JSON.stringify({ body: "Updated comment content" }),
});
if (!response.ok) {
throw new Error(`Request failed: ${response.status}`);
}
const data = await response.json();
console.log(data);
Python¶
import requests
resp = requests.patch(
"https://api.atomgit.com/api/v5/repos/<owner>/<repo>/issues/comments/<id>",
params={"access_token": "<token>"},
json={"body": "Updated comment content"},
headers={"Accept": "application/json"},
timeout=10,
)
resp.raise_for_status()
print(resp.json())
Response example¶
Status code: 200
Error codes¶
| Error code | Description |
|---|---|
401 |
Unauthenticated or invalid credentials (missing/invalid access credentials) |
400 |
Invalid parameters or unparsable request |
403 |
No permission to perform this operation |
404 |
Request path not found |
405 |
Request method not allowed |
429 |
Too many requests; rate limit triggered |
500 |
Internal server error |
Markdown source: View on AtomGit·Content from the open-source project gitcode-dev/atomgit-api-doc