# List replies of a comment

`GET /api/v1/videos/{id}/comments/{commentId}/replies`

**PeerTube >= 8.3** List the direct replies of a comment, each of them nested up to `maxDepth` levels. Used to unfold the parts of a thread that `GET /api/v1/videos/{id}/comment-threads/{threadId}` truncated.


Authentication: no security requirement declared for this operation.

Parameters:

- `id` (path, id | UUIDv4 | shortUUID, required) - The object id, uuid or short uuid
  Type: id | UUIDv4 | shortUUID
  
  oneOf:
    Reference: [id](https://sourcey-peertube.pages.dev/api-rest-reference/models/id.md); Type: id
    
    minimum: 1
    
    Example:
    
    ```json
    42
    ```
  
    Reference: [UUIDv4](https://sourcey-peertube.pages.dev/api-rest-reference/models/uuidv4.md); Type: UUIDv4, uuid
    
    minLength: 36
    
    maxLength: 36
    
    pattern: "^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"
    
    Example:
    
    ```json
    "9c9de5e8-0a1e-484a-b099-e80766180a6d"
    ```
  
    Reference: [shortUUID](https://sourcey-peertube.pages.dev/api-rest-reference/models/shortuuid.md); Type: shortUUID
    
    translation of a uuid v4 with a bigger alphabet to have a shorter uuid
    
    Example:
    
    ```json
    "2y84q2MQUMWPbiEcxNXMgC"
    ```

- `commentId` (path, id, required) - The comment id
  Type: id
  
  Schema: [id](https://sourcey-peertube.pages.dev/api-rest-reference/models/id.md)
  
  minimum: 1
  
  Example:
  
  ```json
  42
  ```

- `start` (query, integer, optional) - Offset used to paginate results
  Type: integer
  
  minimum: 0

- `count` (query, integer, optional) - Number of items to return
  Type: integer
  
  default: 15
  
  minimum: 1
  
  maximum: 100

- `sort` (query, string, optional) - Sort the direct replies of the comment. Deeper levels of the tree are always sorted the same way.
Defaults to `createdAt` so the replies are appended to the thread tree in the order it was built

  Type: string
  
  default: "createdAt"
  
  enum: ["createdAt","-createdAt"]

- `maxDepth` (query, integer, optional) - Number of nesting levels to include below the requested comment.
Bounded by `repliesPerLevel` and `count`, see the note on `repliesPerLevel`

  Type: integer
  
  default: 5
  
  minimum: 1
  
  maximum: 10

- `repliesPerLevel` (query, integer, optional) - Number of direct replies to include for each comment of the tree. Does not apply to the first level of `GET /api/v1/videos/{id}/comments/{commentId}/replies`, which is paginated using `start` and `count`.
A tree can make the server walk through `count * (repliesPerLevel ^ maxDepth - 1) / (repliesPerLevel - 1)` comments, which grows exponentially. Combinations above 2000000 are rejected A deep tree has to be narrow and a wide tree has to be shallow.

  Type: integer
  
  default: 10
  
  minimum: 1
  
  maximum: 30

- `x-peertube-video-password` (header, string, optional) - Required on password protected video
  Type: string

Responses:

- 200: successful operation

Content type: application/json

Type: object

- `total` (optional)
  Type: integer
  
  Total number of direct replies of the comment
  
  Example:
  
  ```json
  13
  ```

- `data` (optional)
  Type: Array<VideoCommentThreadTree>
  
  Items:
    Reference: [VideoCommentThreadTree](https://sourcey-peertube.pages.dev/api-rest-reference/models/videocommentthreadtree.md); Type: VideoCommentThreadTree

## Examples

### cURL

```bash
curl -X GET 'https://peertube2.cpy.re/api/v1/videos/42/comments/42/replies?count=15&sort=createdAt&maxDepth=5&repliesPerLevel=10'
```

### JavaScript

```javascript
const response = await fetch('https://peertube2.cpy.re/api/v1/videos/42/comments/42/replies?count=15&sort=createdAt&maxDepth=5&repliesPerLevel=10', {
  method: 'GET',
});

const data = await response.text();
```

### Python

```python
import requests

response = requests.get('https://peertube2.cpy.re/api/v1/videos/42/comments/42/replies?count=15&sort=createdAt&maxDepth=5&repliesPerLevel=10')
print(response.text)
```
