Skip to content

Delete repository discussion

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

This endpoint deletes a discussion in the specified repository. It locates the target discussion by the namespace path the repository belongs to, the repository path, and the discussion number, and returns an empty response body on success.

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 integer Yes Discussion number (positive integer)
access_token query string Yes User authorization code

Response parameters

On successful deletion it returns 200 OK with an empty response body (no content).

Error response

A 200/success response alone is not enough: callers need to know what a failure looks like in order to write error handling.

401 Unauthenticated

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

403 Access forbidden

{
  "error": "forbidden",
  "message": "You do not have permission to delete this repository discussion"
}

404 Discussion does not exist

{
  "error": "not_found",
  "message": "Repository or discussion does not exist"
}

Note: The error field names above follow what the backend actually returns.

HTTP response status codes

Status code Description
200 Success (OK)
401 Authentication required (Requires authentication)
403 Access forbidden (Forbidden)
404 Not found (Not found)
405 Method not allowed
500 Internal server error

Request example

Parameter description

Replace <owner> with the namespace path of the repository (the path of an enterprise, organization, or personal address); replace <repo> with the repository path (path); replace <number> with the discussion number (a positive integer); replace <token> with your AtomGit user access token.

cURL

curl -X DELETE 'https://api.atomgit.com/api/v5/repos/<owner>/<repo>/discuss/<number>?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>?access_token=<YOUR-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>/discuss/<number>",
    params={"access_token": "<YOUR-TOKEN>"},
    headers={"Accept": "application/json"},
    timeout=10,
)
resp.raise_for_status()

print("Deleted successfully")

Response example

Status code: 200

On successful deletion the response body is empty (no content).

{}

Error codes

Error code Description
401 Unauthenticated or invalid credentials (missing/invalid access credentials)
403 Access forbidden (no permission)
404 Request path does not exist or the discussion 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