> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.pensar.dev/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.pensar.dev/_mcp/server.

# List comments

GET https://api.pensar.dev/issues/{issueId}/comments

The review thread on an issue, oldest first.

Requires the `issues:read` API key scope.

Reference: https://docs.pensar.dev/api/api-reference/issues/list-issue-comments

## Authentication

- `Authorization` header (bearer token, required) — A workspace API key, sent as `Authorization: Bearer`.
- `x-api-key` header (required) — A workspace API key, sent as `x-api-key`.

## Request

### Path parameters

- `issueId` (string, required) — Issue UUID or label, e.g. `VULN-000123`.

### Query parameters

- `page` (integer, optional) — Defaults to 1.
- `pageSize` (integer, optional) — Defaults to 50.

## Response

### 200

A page of comments.

- `comments` (list of Comment, required)
- `pagination` (CommentListPagination, required)

## Errors

### 400 Bad Request Error

The request is invalid. `error` names the field.

- `error` (string, required) — What went wrong, naming the offending value when useful.

### 401 Unauthorized Error

The API key is missing or invalid.

- `error` (string, required) — What went wrong, naming the offending value when useful.

### 403 Forbidden Error

The credential lacks the required scope or is not allowed this action.

- `error` (string, required) — What went wrong, naming the offending value when useful.

### 404 Not Found Error

The resource does not exist in this workspace.

- `error` (string, required) — What went wrong, naming the offending value when useful.

## Types

### Comment

- `id` (string, required)
- `issueId` (string, required)
- `body` (string, required) — Comment text as written; `@handle` mentions stay in place.
- `author` (CommentAuthor, required, nullable) — Null when the author's account no longer exists.
- `createdAt` (datetime, required)
- `editedAt` (datetime, required, nullable)
- `url` (string, required) — Console link to the comment.

### CommentListPagination

- `page` (integer, required)
- `pageSize` (integer, required)
- `totalRows` (integer, required)
- `totalPages` (integer, required)

### CommentAuthor

Null when the author's account no longer exists.

- `id` (string, required)
- `name` (string, required, nullable)
- `email` (string, required)
- `type` (enum, required)
  - Allowed values: `user`

## Examples

**Response**

```json
{
  "comments": [
    {
      "id": "string",
      "issueId": "string",
      "body": "string",
      "author": {
        "id": "string",
        "name": "string",
        "email": "string",
        "type": "user"
      },
      "createdAt": "2024-01-15T09:30:00Z",
      "editedAt": "2024-01-15T09:30:00Z",
      "url": "string"
    }
  ],
  "pagination": {
    "page": 1,
    "pageSize": 1,
    "totalRows": 1,
    "totalPages": 1
  }
}
```

**SDK Code**

```python
import requests

url = "https://api.pensar.dev/issues/issueId/comments"

headers = {"Authorization": "Bearer <token>"}

response = requests.get(url, headers=headers)

print(response.json())
```

```javascript
const url = 'https://api.pensar.dev/issues/issueId/comments';
const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go
package main

import (
	"fmt"
	"net/http"
	"io"
)

func main() {

	url := "https://api.pensar.dev/issues/issueId/comments"

	req, _ := http.NewRequest("GET", url, nil)

	req.Header.Add("Authorization", "Bearer <token>")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby
require 'uri'
require 'net/http'

url = URI("https://api.pensar.dev/issues/issueId/comments")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'

response = http.request(request)
puts response.read_body
```

```java
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.get("https://api.pensar.dev/issues/issueId/comments")
  .header("Authorization", "Bearer <token>")
  .asString();
```

```php
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('GET', 'https://api.pensar.dev/issues/issueId/comments', [
  'headers' => [
    'Authorization' => 'Bearer <token>',
  ],
]);

echo $response->getBody();
```

```csharp
using RestSharp;

var client = new RestClient("https://api.pensar.dev/issues/issueId/comments");
var request = new RestRequest(Method.GET);
request.AddHeader("Authorization", "Bearer <token>");
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let headers = ["Authorization": "Bearer <token>"]

let request = NSMutableURLRequest(url: NSURL(string: "https://api.pensar.dev/issues/issueId/comments")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "GET"
request.allHTTPHeaderFields = headers

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```