Skip to content

Delete a commit comment

DELETE /api/v5/repos/{owner}/{repo}/comments/{id}

This endpoint deletes a comment on a commit in the specified repository. You must provide the namespace address that owns the repository, the repository path, and the comment ID to locate the target comment. On success, it returns an empty object.

Access token support

  • AtomGit user access tokens

Anonymous access

This endpoint does not allow anonymous access.

Request parameters

Parameter Location Type Required Description
owner path string Yes Address path of the namespace that owns the repository (address path of the organization or user)
repo path string Yes Repository path (path)
id path string Yes Comment ID
access_token query string Yes User authorization code

Error response

The error response body field names are those returned by the backend; the examples below are for reference only.

401 Unauthenticated

{
  "error": "unauthorized",
  "message": "Missing or invalid access token"
}

404 Comment not found

{
  "error": "not_found",
  "message": "Comment not found"
}

HTTP response status codes

Status code Description
200 Success (OK)
401 Authentication required
403 Forbidden
404 Request path or comment not found

Request example

Parameter description

Replace <owner> with the address path of the namespace that owns the repository (address path of the enterprise, organization, or user); Replace <repo> with the repository path (path); Replace <id> with the ID of the comment to delete; Replace <token> with your AtomGit user access token.

cURL

curl -X DELETE 'https://api.atomgit.com/api/v5/repos/<owner>/<repo>/comments/<id>?access_token=<token>' \
  -H 'Accept: application/json'

JavaScript

// Native fetch (Node.js 18+ / browser)
const response = await fetch(
  "https://api.atomgit.com/api/v5/repos/<owner>/<repo>/comments/<id>?access_token=<token>",
  {
    method: "DELETE",
    headers: {
      "Accept": "application/json",
    },
  }
);

if (!response.ok) {
  throw new Error(`Request failed: ${response.status}`);
}

console.log("Deleted successfully");

Python

import requests

resp = requests.delete(
    "https://api.atomgit.com/api/v5/repos/<owner>/<repo>/comments/<id>",
    params={"access_token": "<token>"},
    headers={"Accept": "application/json"},
    timeout=10,
)
resp.raise_for_status()

print("Deleted successfully")

Response example

Status code: 200

{}

Error codes

Error code Description
401 Unauthenticated or invalid credentials (missing/invalid access credentials)
403 Forbidden (the current user is not allowed to perform this operation)
404 The requested path or comment does not exist
500 Internal system error

Markdown source: View on AtomGit·Content from the open-source project gitcode-dev/atomgit-api-doc