Skip to content

Get organization discussion list

GET /api/v5/orgs/{org}/discuss

This endpoint gets the discussion list for the specified organization. It supports paginated queries by page number and per-page count, sorting by creation time or comment count, and searching by title and description keywords. It returns discussion details along with the author, category, labels, and other content.

Access token support

  • AtomGit user access token (AtomGit user access tokens)

Anonymous access

This endpoint allows anonymous access

Request parameters

Parameter Location Type Required Description
org path string Yes Organization path
page query string No Current page number
per_page query string No Number of items per page, maximum 100, default 20
sort query string No Optional. Sort field created (creation time), comment_size (comment count); default creation time
direction query string No Optional. Ascending/descending (asc/desc); default descending
search query string No Search by title and description

Response parameters

The response body is a JSON array; each array element is a discussion object with the following structure.

discussion object (array element)

Field Type Always returned Nullable Description
discussion.id string Yes No —
discussion.number integer Yes No —
discussion.title string Yes No —
discussion.created_at string Yes No —
discussion.updated_at string Yes No —
discussion.author object Yes No Discussion author information
discussion.is_lock integer Yes No Whether locked
discussion.is_pin integer Yes No Whether pinned
discussion.is_category_pin integer Yes No Whether pinned within the type
discussion.is_closed integer Yes No Whether closed
discussion.is_answered integer Yes No Whether an answer is accepted
discussion.comment_total integer Yes No Comment count
discussion.category object Yes No Discussion category
discussion.namespace object Yes No Owning namespace
discussion.labels array No Yes Label

discussion.author object

Field Type Always returned Nullable Description
discussion.author.avatar_url string Yes No —
discussion.author.id string Yes No —
discussion.author.object_id string Yes No —
discussion.author.login string Yes No —
discussion.author.name string Yes No —

discussion.category object

Field Type Always returned Nullable Description
discussion.category.id string Yes No —
discussion.category.name string Yes No —
discussion.category.icon string Yes No —
discussion.category.description string Yes No —
discussion.category.type integer Yes No —

discussion.namespace object

Field Type Always returned Nullable Description
discussion.namespace.id integer Yes No —
discussion.namespace.kind string Yes No —
discussion.namespace.full_path string Yes No —

discussion.labels object

Field Type Always returned Nullable Description
discussion.labels.id string Yes No —
discussion.labels.name string Yes No —
discussion.labels.color string Yes No —
discussion.labels.created_at string Yes No —
discussion.labels.updated_at string Yes No —

Error response

400 Parameter error

{
  "error": "invalid_request",
  "message": "Parameter error"
}

401 Unauthenticated

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

Note: The error field names above are examples; the fields actually returned by the backend are subject to the actual response.

HTTP response status codes

Status code Description
200 Success (OK)
304 Not modified
401 Authentication required (Requires authentication)
403 Access forbidden (Forbidden)
404 Organization not found or path error (Not found)

Request example

Parameter description

This endpoint allows anonymous access, so no access token is carried in the example; if you need authentication, you can carry an AtomGit user access token.

Replace <org> with the organization path (the organization's address path).

cURL

curl -X GET 'https://api.atomgit.com/api/v5/orgs/<org>/discuss?page=1&per_page=20&sort=created&direction=desc' \
  -H 'Accept: application/json'

JavaScript

// Native fetch (Node.js 18+ / browser)
const response = await fetch("https://api.atomgit.com/api/v5/orgs/<org>/discuss?page=1&per_page=20", {
  headers: {
    "Accept": "application/json",
  },
});

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

const data = await response.json();
console.log(data);

Python

import requests

resp = requests.get(
    "https://api.atomgit.com/api/v5/orgs/<org>/discuss",
    params={"page": 1, "per_page": 20},
    headers={"Accept": "application/json"},
    timeout=10,
)
resp.raise_for_status()

print(resp.json())

Response example

Status code: 200

[
  {
    "id": "string",
    "number": 0,
    "title": "string",
    "created_at": "string",
    "updated_at": "string",
    "author": {
      "avatar_url": "string",
      "id": "string",
      "object_id": "string",
      "login": "string",
      "name": "string"
    },
    "is_lock": 0,
    "is_pin": 0,
    "is_category_pin": 0,
    "is_closed": 0,
    "is_answered": 0,
    "comment_total": 0,
    "category": {
      "id": "string",
      "name": "string",
      "icon": "string",
      "description": "string",
      "type": 0
    },
    "namespace": {
      "id": 0,
      "kind": "string",
      "full_path": "string"
    },
    "labels": [
      {
        "id": "string",
        "name": "string",
        "color": "string",
        "created_at": "string",
        "updated_at": "string"
      }
    ]
  }
]

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