Skip to main content
GET
/
comments
/
:id
Get Comment by ID
curl --request GET \
  --url https://api.example.com/comments/:id
{
  "id": "<string>",
  "body": "<string>",
  "filePath": "<string>",
  "lineNumber": 123,
  "pullRequestId": "<string>",
  "userId": 123,
  "parentCommentId": "<string>",
  "resolved": true,
  "createdAt": "<string>",
  "updatedAt": "<string>",
  "user": {
    "id": 123,
    "username": "<string>",
    "name": "<string>",
    "avatarUrl": "<string>"
  },
  "replies": [
    {}
  ]
}
Retrieve a specific comment by its ID, including any threaded replies.

Authentication

This endpoint does not require authentication.

Path Parameters

id
string
required
The ID of the comment

Response

id
string
The unique identifier for the comment
body
string
The content of the comment
filePath
string
The file path where the comment was made
lineNumber
number
The line number in the file
pullRequestId
string
The ID of the pull request
userId
number
The ID of the user who created the comment
parentCommentId
string
The ID of the parent comment if this is a reply
resolved
boolean
Whether this comment thread has been resolved
createdAt
string
ISO 8601 timestamp of when the comment was created
updatedAt
string
ISO 8601 timestamp of when the comment was last updated
user
object
The user who created the comment
id
number
User ID
username
string
Username
name
string
Display name
avatarUrl
string
URL to the user’s avatar image
replies
array
Array of reply comments in the thread (same structure as parent comment)

Example

curl https://api.diffy.com/comments/1

Response

{
  "id": "1",
  "body": "This function could be optimized by caching the result",
  "filePath": "src/utils/processor.ts",
  "lineNumber": 42,
  "pullRequestId": "123456789",
  "userId": 5,
  "parentCommentId": null,
  "resolved": false,
  "createdAt": "2026-03-01T10:30:00Z",
  "updatedAt": "2026-03-01T10:30:00Z",
  "user": {
    "id": 5,
    "username": "reviewer",
    "name": "Jane Reviewer",
    "avatarUrl": "https://avatars.githubusercontent.com/u/123"
  },
  "replies": [
    {
      "id": "2",
      "body": "Good catch! I'll add memoization here.",
      "filePath": "src/utils/processor.ts",
      "lineNumber": 42,
      "pullRequestId": "123456789",
      "userId": 8,
      "parentCommentId": "1",
      "resolved": false,
      "createdAt": "2026-03-01T11:15:00Z",
      "updatedAt": "2026-03-01T11:15:00Z"
    }
  ]
}

Build docs developers (and LLMs) love