Skip to content

Delete repository discussion comment

DELETE /api/v5/repos/{owner}/{repo}/discuss/{number}/comment/{id}

This endpoint deletes a specified comment under a discussion in the specified repository. On success, no response body is returned.

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 path of the repository (the path of an enterprise, organization, or personal address)
repo path string Yes Repository path (path)
number path string Yes Discussion number
id path string Yes Comment ID
access_token query string Yes User authorization code

Response parameters

The 200 Success response of this endpoint has no response body content.

Error response

Callers need to know the shape of the response on failure in order to write error handling logic.

401 Unauthenticated

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

404 Resource does not exist

{
  "error": "not_found",
  "message": "Discussion or comment does not exist"
}

The error field names are subject to what the backend actually returns; the examples below are for reference only.

HTTP response status codes

Status code Description
200 Success (OK)
401 Authentication required (Requires authentication)
404 Resource not found (Not found)
429 Too many requests; rate limit triggered
500 Internal server error

Request example

Parameter description

  • <owner> — Replace with the namespace path of the repository (the path of an enterprise, organization, or personal address)
  • <repo> — Replace with the repository path (path)
  • <number> — Replace with the discussion number
  • <id> — Replace with the comment ID
  • <token> — Replace with your AtomGit user access token

cURL

curl -X DELETE 'https://api.atomgit.com/api/v5/repos/<owner>/<repo>/discuss/<number>/comment/<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>/discuss/<number>/comment/<id>?access_token=<token>",
  {
    method: "DELETE",
    headers: { "Accept": "application/json" },
  }
);

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

console.log(response.status);

Python

import requests

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

print(resp.status_code)

Response example

Status code: 200

Success response, with no response body content.

Error codes

Error code Description
401 Unauthenticated or invalid credentials (missing/invalid access credentials)
400 Parameter error or unparsable request
404 Request path does not exist
405 Method not supported
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