Skip to content

Reply to organization discussion comment

POST /api/v5/orgs/{org}/discuss/{number}/comment/{id}/reply

This endpoint replies to a discussion comment under the specified organization. It accepts reply content in Markdown format and returns details of the created reply (such as reply content, author information, creation time, like count, and reply total).

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
org path string Yes Organization path (path)
number path integer Yes Discussion number
id path string Yes Comment ID
access_token query string Yes User authorization code

Request Body:

The request body is a JSON object; the required field md_content is the comment content (Markdown format is supported).

{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "md_content": {
      "description": "Comment content (markdown)",
      "type": "string"
    }
  },
  "required": ["md_content"]
}

Response parameters

Field Type Always returned Nullable Description
id string Yes No Comment/reply ID
created_at string Yes No Creation time
updated_at string Yes No Update time
author object Yes No Author information
discuss_id string Yes No Owning discussion ID
content string Yes No Comment content (plain text)
md_content string Yes No Comment content (markdown)
parent_id string Yes No Parent comment/reply ID
type integer Yes No Type
is_hide integer Yes No Whether hidden
reply_total integer Yes No Reply total
like_total integer Yes No Like total
is_like boolean Yes No Whether the current logged-in user has liked
is_deleted integer Yes No Whether deleted
is_remark integer Yes No Whether flagged

author object

Field Type Always returned Nullable Description
author.avatar_url string Yes No Avatar URL
author.id string Yes No User ID
author.object_id string Yes No Object ID
author.login string Yes No Login name
author.name string Yes No Nickname

Error response

400 Parameter error

{
  "error": "invalid_request",
  "message": "Parameter md_content cannot be empty",
  "field": "md_content"
}

401 Unauthenticated

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

HTTP response status codes

Status code Description
200 Success (OK)
400 Parameter error (Bad request)
401 Authentication required (Requires authentication)
404 Resource not found (Not found)
429 Too many requests
500 Internal server error

Request example

Parameter description

Replace <org> with the organization path (path); Replace <number> with the discussion number; Replace <id> with the comment ID to reply to; Replace <token> with your AtomGit user access token.

cURL

curl -X POST 'https://api.atomgit.com/api/v5/orgs/<org>/discuss/<number>/comment/<id>/reply?access_token=<token>' \
  -H 'Content-Type: application/json' \
  -d '{"md_content": "Thanks for sharing, this is very helpful!"}'

JavaScript

// Native fetch (Node.js 18+ / browser)
const response = await fetch(
  "https://api.atomgit.com/api/v5/orgs/<org>/discuss/<number>/comment/<id>/reply?access_token=<token>",
  {
    method: "POST",
    headers: {
      "Content-Type": "application/json",
      "Accept": "application/json",
    },
    body: JSON.stringify({ md_content: "Thanks for sharing, this is very helpful!" }),
  }
);

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

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

Python

import requests

resp = requests.post(
    "https://api.atomgit.com/api/v5/orgs/<org>/discuss/<number>/comment/<id>/reply",
    params={"access_token": "<token>"},
    json={"md_content": "Thanks for sharing, this is very helpful!"},
    headers={"Accept": "application/json"},
    timeout=10,
)
resp.raise_for_status()

print(resp.json())

Response example

Status code: 200

{
  "id": "112233",
  "created_at": "2026-10-14T12:00:00Z",
  "updated_at": "2026-10-14T12:00:00Z",
  "author": {
    "avatar_url": "https://api.atomgit.com/avatar.png",
    "id": "1001",
    "object_id": "2001",
    "login": "octocat",
    "name": "Octocat"
  },
  "discuss_id": "5566",
  "content": "Thanks for sharing, this is very helpful!",
  "md_content": "Thanks for sharing, this is very helpful!",
  "parent_id": "3344",
  "type": 0,
  "is_hide": 0,
  "reply_total": 0,
  "like_total": 0,
  "is_like": true,
  "is_deleted": 0,
  "is_remark": 0
}

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