Delete a comment¶
DELETE /api/v5/repos/{owner}/{repo}/pulls/comments/{id}
This endpoint deletes a comment on a specified pull request in a specified repository. It locates the target comment by repository address, repository path, and comment ID, and returns an empty object after the comment is deleted successfully.
Access token support¶
- AtomGit user access tokens
Anonymous access allowed¶
This endpoint does not allow anonymous access.
Request parameters¶
| Parameter | Location | Type | Required | Description |
|---|---|---|---|---|
owner |
path | string | Yes | The namespace address the repository belongs to (the address path of an organization or individual) |
repo |
path | string | Yes | Repository path (path) |
id |
path | integer | Yes | Comment ID |
access_token |
query | string | Yes | User authorization code |
Response parameters¶
On success, the response body is an empty object {} with no business fields.
Error responses¶
The endpoint may return the following error status codes (the error field names are subject to what the backend actually returns):
401 Unauthenticated
404 Not found
HTTP response status codes¶
| Status code | Description |
|---|---|
200 |
Success (OK) |
401 |
Requires authentication |
404 |
Comment not found |
Request example¶
Parameter description¶
The example is consistent with the rest of this document, so it can be copied as-is and the call succeeds.
Replace
<owner>with the namespace address the repository belongs to (the address path of an organization or individual); replace<repo>with the repository path (path); replace<id>with the comment ID; replace<token>with your AtomGit user access token.
cURL¶
curl -X DELETE 'https://api.atomgit.com/api/v5/repos/<owner>/<repo>/pulls/comments/<id>?access_token=<token>'
JavaScript¶
// Native fetch (Node.js 18+ / browser)
const response = await fetch(
"https://api.atomgit.com/api/v5/repos/<owner>/<repo>/pulls/comments/<id>?access_token=<token>",
{ method: "DELETE" }
);
if (!response.ok) {
throw new Error(`Request failed: ${response.status}`);
}
const data = await response.json();
console.log(data);
Python¶
import requests
resp = requests.delete(
"https://api.atomgit.com/api/v5/repos/<owner>/<repo>/pulls/comments/<id>",
params={"access_token": "<token>"},
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) |
404 |
The comment does not exist or has been deleted |
500 |
Internal server error |
Markdown source: View on AtomGit·Content from the open-source project gitcode-dev/atomgit-api-doc