# Video Comments

Operations dealing with comments to a video. Comments are organized in threads: adding a comment in response to the video starts a thread, adding a reply to a comment adds it to its root comment thread.


## List comments on user's videos

`GET /api/v1/users/me/videos/comments`

**PeerTube >= 6.2**

Authentication (security requirement alternatives):

```json
[
  {
    "OAuth2": []
  }
]
```

- OAuth2: oauth2. Authenticating via OAuth requires the following steps:
- Have an activated account
- [Generate] an access token for that account at `/api/v1/users/token`.
- Make requests with the *Authorization: Bearer <token\>* header
- Profit, depending on the role assigned to the account

Note that the __access token is valid for 1 day__ and is given
along with a __refresh token valid for 2 weeks__.

[Generate]: https://docs.joinpeertube.org/api/rest-getting-started


Parameters:

- `search` (query, string, optional) - Plain text search, applied to various parts of the model depending on endpoint
  Type: string

- `searchAccount` (query, string, optional) - Filter comments by searching on the account
  Type: string

- `searchVideo` (query, string, optional) - Filter comments by searching on the video
  Type: string

- `videoId` (query, integer, optional) - Limit results on this specific video
  Type: integer

- `videoChannelId` (query, integer, optional) - Limit results on this specific video channel
  Type: integer

- `autoTagOneOf` (query, string | Array<string>, optional) - **PeerTube >= 6.2** filter on comments that contain one of these automatic tags
  Type: string | Array<string>
  
  oneOf:
    Type: string
  
    Type: Array<string>
    
    Items:
      Type: string

- `isHeldForReview` (query, boolean, optional) - only display comments that are held for review
  Type: boolean

- `includeCollaborations` (query, boolean, optional) - **PeerTube >= 8.0** Include objects from collaborated channels
  Type: boolean

Responses:

- 200: successful operation

Content type: application/json

Type: object

- `total` (optional)
  Type: integer
  
  Example:
  
  ```json
  1
  ```

- `data` (optional)
  Type: Array<VideoCommentForOwnerOrAdmin>
  
  Items:
    Reference: [VideoCommentForOwnerOrAdmin](https://docs.joinpeertube.org/api-rest-reference/api/models/videocommentforowneroradmin.md); Type: VideoCommentForOwnerOrAdmin

## Examples

### cURL

```bash
curl -X GET 'https://peertube2.cpy.re/api/v1/users/me/videos/comments' \
  -H 'Authorization: Bearer YOUR_TOKEN'
```

### JavaScript

```javascript
const response = await fetch('https://peertube2.cpy.re/api/v1/users/me/videos/comments', {
  method: 'GET',
  headers: {
    'Authorization': 'Bearer YOUR_TOKEN',
  },
});

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

### Python

```python
import requests

response = requests.get(
    'https://peertube2.cpy.re/api/v1/users/me/videos/comments',
    headers={
        'Authorization': 'Bearer YOUR_TOKEN',
    },
)
print(response.text)
```


## List threads of a video

`GET /api/v1/videos/{id}/comment-threads`

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://docs.joinpeertube.org/api-rest-reference/api/models/id.md); Type: id
    
    minimum: 1
    
    Example:
    
    ```json
    42
    ```
  
    Reference: [UUIDv4](https://docs.joinpeertube.org/api-rest-reference/api/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://docs.joinpeertube.org/api-rest-reference/api/models/shortuuid.md); Type: shortUUID
    
    translation of a uuid v4 with a bigger alphabet to have a shorter uuid
    
    Example:
    
    ```json
    "2y84q2MQUMWPbiEcxNXMgC"
    ```

- `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 comments by criteria
  Type: string
  
  enum: ["-createdAt","-totalReplies"]

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

Responses:

- 200: successful operation

Content type: application/json

Type: CommentThreadResponse

Schema: [CommentThreadResponse](https://docs.joinpeertube.org/api-rest-reference/api/models/commentthreadresponse.md)

- `total` (optional)
  Type: integer
  
  Total threads (included deleted ones) on this video

- `totalNotDeletedComments` (optional)
  Type: integer
  
  Total not-deleted threads (included deleted ones) on this video

- `data` (optional)
  Type: Array<VideoComment>
  
  maxItems: 100
  
  Items:
    Reference: [VideoComment](https://docs.joinpeertube.org/api-rest-reference/api/models/videocomment.md); Type: VideoComment

## Examples

### cURL

```bash
curl -X GET 'https://peertube2.cpy.re/api/v1/videos/42/comment-threads?count=15'
```

### JavaScript

```javascript
const response = await fetch('https://peertube2.cpy.re/api/v1/videos/42/comment-threads?count=15', {
  method: 'GET',
});

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

### Python

```python
import requests

response = requests.get('https://peertube2.cpy.re/api/v1/videos/42/comment-threads?count=15')
print(response.text)
```


## Create a thread

`POST /api/v1/videos/{id}/comment-threads`

Authentication (security requirement alternatives):

```json
[
  {
    "OAuth2": []
  }
]
```

- OAuth2: oauth2. Authenticating via OAuth requires the following steps:
- Have an activated account
- [Generate] an access token for that account at `/api/v1/users/token`.
- Make requests with the *Authorization: Bearer <token\>* header
- Profit, depending on the role assigned to the account

Note that the __access token is valid for 1 day__ and is given
along with a __refresh token valid for 2 weeks__.

[Generate]: https://docs.joinpeertube.org/api/rest-getting-started


Parameters:

- `id` (path, id | UUIDv4 | shortUUID, required) - The object id, uuid or short uuid
  Type: id | UUIDv4 | shortUUID
  
  oneOf:
    Reference: [id](https://docs.joinpeertube.org/api-rest-reference/api/models/id.md); Type: id
    
    minimum: 1
    
    Example:
    
    ```json
    42
    ```
  
    Reference: [UUIDv4](https://docs.joinpeertube.org/api-rest-reference/api/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://docs.joinpeertube.org/api-rest-reference/api/models/shortuuid.md); Type: shortUUID
    
    translation of a uuid v4 with a bigger alphabet to have a shorter uuid
    
    Example:
    
    ```json
    "2y84q2MQUMWPbiEcxNXMgC"
    ```

Request body: application/json

Type: object

- `text` (required)
  Type: text, markdown
  
  maxLength: 10000
  
  allOf:
    Type: text, html
    
    Text of the comment
    
    minLength: 1
    
    Example:
    
    ```json
    "This video is wonderful!"
    ```

Responses:

- 200: successful operation

Content type: application/json

Type: CommentThreadPostResponse

Schema: [CommentThreadPostResponse](https://docs.joinpeertube.org/api-rest-reference/api/models/commentthreadpostresponse.md)

- `comment` (optional)
  Reference: [VideoComment](https://docs.joinpeertube.org/api-rest-reference/api/models/videocomment.md); Type: VideoComment

- 404: video does not exist

## Examples

### cURL

```bash
curl -X POST 'https://peertube2.cpy.re/api/v1/videos/42/comment-threads' \
  -H 'Authorization: Bearer YOUR_TOKEN' \
  -H 'Content-Type: application/json' \
  --data-raw '{}'
```

### JavaScript

```javascript
const response = await fetch('https://peertube2.cpy.re/api/v1/videos/42/comment-threads', {
  method: 'POST',
  headers: {
    'Authorization': 'Bearer YOUR_TOKEN',
    'Content-Type': 'application/json',
  },
  body: '{}',
});

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

### Python

```python
import requests

response = requests.post(
    'https://peertube2.cpy.re/api/v1/videos/42/comment-threads',
    data='{}'.encode('utf-8'),
    headers={
        'Authorization': 'Bearer YOUR_TOKEN',
        'Content-Type': 'application/json',
    },
)
print(response.text)
```


## Get a thread

`GET /api/v1/videos/{id}/comment-threads/{threadId}`

Since PeerTube 8.3 the returned tree is truncated: only the first replies of each comment are included, and only down to `maxDepth` nesting levels. Use `GET /api/v1/videos/{id}/comments/{commentId}/replies` to fetch the replies that are missing, comparing `children` and `totalChildren` of each node of the tree.


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://docs.joinpeertube.org/api-rest-reference/api/models/id.md); Type: id
    
    minimum: 1
    
    Example:
    
    ```json
    42
    ```
  
    Reference: [UUIDv4](https://docs.joinpeertube.org/api-rest-reference/api/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://docs.joinpeertube.org/api-rest-reference/api/models/shortuuid.md); Type: shortUUID
    
    translation of a uuid v4 with a bigger alphabet to have a shorter uuid
    
    Example:
    
    ```json
    "2y84q2MQUMWPbiEcxNXMgC"
    ```

- `threadId` (path, integer, required) - The thread id (root comment id)
  Type: integer

- `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: VideoCommentThreadTree

Schema: [VideoCommentThreadTree](https://docs.joinpeertube.org/api-rest-reference/api/models/videocommentthreadtree.md)

- `comment` (optional)
  Reference: [VideoComment](https://docs.joinpeertube.org/api-rest-reference/api/models/videocomment.md); Type: VideoComment

- `children` (optional)
  Type: Array<VideoCommentThreadTree>
  
  Direct replies of `comment`. The server truncates the tree in depth (see the `maxDepth` parameter) and in width, so this array may contain less elements than `totalChildren`. Missing replies can be fetched using `GET /api/v1/videos/{id}/comments/{commentId}/replies`
  
  
  Items:
    Reference: [VideoCommentThreadTree](https://docs.joinpeertube.org/api-rest-reference/api/models/videocommentthreadtree.md); Type: VideoCommentThreadTree

- `totalChildren` (optional)
  Type: integer
  
  Total number of direct replies of `comment` the current user can see
  
  minimum: 0

## Examples

### cURL

```bash
curl -X GET 'https://peertube2.cpy.re/api/v1/videos/42/comment-threads/0?maxDepth=5&repliesPerLevel=10'
```

### JavaScript

```javascript
const response = await fetch('https://peertube2.cpy.re/api/v1/videos/42/comment-threads/0?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/comment-threads/0?maxDepth=5&repliesPerLevel=10')
print(response.text)
```


## 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://docs.joinpeertube.org/api-rest-reference/api/models/id.md); Type: id
    
    minimum: 1
    
    Example:
    
    ```json
    42
    ```
  
    Reference: [UUIDv4](https://docs.joinpeertube.org/api-rest-reference/api/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://docs.joinpeertube.org/api-rest-reference/api/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://docs.joinpeertube.org/api-rest-reference/api/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://docs.joinpeertube.org/api-rest-reference/api/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)
```


## List instance comments

`GET /api/v1/videos/comments`

Authentication (security requirement alternatives):

```json
[
  {
    "OAuth2": [
      "admin",
      "moderator"
    ]
  }
]
```

- OAuth2: oauth2. Authenticating via OAuth requires the following steps:
- Have an activated account
- [Generate] an access token for that account at `/api/v1/users/token`.
- Make requests with the *Authorization: Bearer <token\>* header
- Profit, depending on the role assigned to the account

Note that the __access token is valid for 1 day__ and is given
along with a __refresh token valid for 2 weeks__.

[Generate]: https://docs.joinpeertube.org/api/rest-getting-started
; scopes: admin, moderator

Parameters:

- `search` (query, string, optional) - Plain text search, applied to various parts of the model depending on endpoint
  Type: string

- `searchAccount` (query, string, optional) - Filter comments by searching on the account
  Type: string

- `searchVideo` (query, string, optional) - Filter comments by searching on the video
  Type: string

- `videoId` (query, integer, optional) - Limit results on this specific video
  Type: integer

- `videoChannelId` (query, integer, optional) - Limit results on this specific video channel
  Type: integer

- `autoTagOneOf` (query, string | Array<string>, optional) - **PeerTube >= 6.2** filter on comments that contain one of these automatic tags
  Type: string | Array<string>
  
  oneOf:
    Type: string
  
    Type: Array<string>
    
    Items:
      Type: string

- `isLocal` (query, boolean, optional) - **PeerTube >= 4.0** Display only local or remote objects
  Type: boolean

- `onLocalVideo` (query, boolean, optional) - Display only objects of local or remote videos
  Type: boolean

- `includeMuted` (query, boolean, optional) - **PeerTube >= 8.2** Include comments from muted accounts
  Type: boolean

Responses:

- 200: successful operation

Content type: application/json

Type: object

- `total` (optional)
  Type: integer
  
  Example:
  
  ```json
  1
  ```

- `data` (optional)
  Type: Array<VideoCommentForOwnerOrAdmin>
  
  Items:
    Reference: [VideoCommentForOwnerOrAdmin](https://docs.joinpeertube.org/api-rest-reference/api/models/videocommentforowneroradmin.md); Type: VideoCommentForOwnerOrAdmin

## Examples

### cURL

```bash
curl -X GET 'https://peertube2.cpy.re/api/v1/videos/comments' \
  -H 'Authorization: Bearer YOUR_TOKEN'
```

### JavaScript

```javascript
const response = await fetch('https://peertube2.cpy.re/api/v1/videos/comments', {
  method: 'GET',
  headers: {
    'Authorization': 'Bearer YOUR_TOKEN',
  },
});

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

### Python

```python
import requests

response = requests.get(
    'https://peertube2.cpy.re/api/v1/videos/comments',
    headers={
        'Authorization': 'Bearer YOUR_TOKEN',
    },
)
print(response.text)
```


## Reply to a thread of a video

`POST /api/v1/videos/{id}/comments/{commentId}`

Authentication (security requirement alternatives):

```json
[
  {
    "OAuth2": []
  }
]
```

- OAuth2: oauth2. Authenticating via OAuth requires the following steps:
- Have an activated account
- [Generate] an access token for that account at `/api/v1/users/token`.
- Make requests with the *Authorization: Bearer <token\>* header
- Profit, depending on the role assigned to the account

Note that the __access token is valid for 1 day__ and is given
along with a __refresh token valid for 2 weeks__.

[Generate]: https://docs.joinpeertube.org/api/rest-getting-started


Parameters:

- `id` (path, id | UUIDv4 | shortUUID, required) - The object id, uuid or short uuid
  Type: id | UUIDv4 | shortUUID
  
  oneOf:
    Reference: [id](https://docs.joinpeertube.org/api-rest-reference/api/models/id.md); Type: id
    
    minimum: 1
    
    Example:
    
    ```json
    42
    ```
  
    Reference: [UUIDv4](https://docs.joinpeertube.org/api-rest-reference/api/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://docs.joinpeertube.org/api-rest-reference/api/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://docs.joinpeertube.org/api-rest-reference/api/models/id.md)
  
  minimum: 1
  
  Example:
  
  ```json
  42
  ```

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

Request body: application/json

Type: object

- `text` (required)
  Type: text, markdown
  
  maxLength: 10000
  
  allOf:
    Type: text, html
    
    Text of the comment
    
    minLength: 1
    
    Example:
    
    ```json
    "This video is wonderful!"
    ```

Responses:

- 200: successful operation

Content type: application/json

Type: CommentThreadPostResponse

Schema: [CommentThreadPostResponse](https://docs.joinpeertube.org/api-rest-reference/api/models/commentthreadpostresponse.md)

- `comment` (optional)
  Reference: [VideoComment](https://docs.joinpeertube.org/api-rest-reference/api/models/videocomment.md); Type: VideoComment

- 404: thread or video does not exist

## Examples

### cURL

```bash
curl -X POST 'https://peertube2.cpy.re/api/v1/videos/42/comments/42' \
  -H 'Authorization: Bearer YOUR_TOKEN' \
  -H 'Content-Type: application/json' \
  --data-raw '{}'
```

### JavaScript

```javascript
const response = await fetch('https://peertube2.cpy.re/api/v1/videos/42/comments/42', {
  method: 'POST',
  headers: {
    'Authorization': 'Bearer YOUR_TOKEN',
    'Content-Type': 'application/json',
  },
  body: '{}',
});

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

### Python

```python
import requests

response = requests.post(
    'https://peertube2.cpy.re/api/v1/videos/42/comments/42',
    data='{}'.encode('utf-8'),
    headers={
        'Authorization': 'Bearer YOUR_TOKEN',
        'Content-Type': 'application/json',
    },
)
print(response.text)
```


## Delete a comment or a reply

`DELETE /api/v1/videos/{id}/comments/{commentId}`

Authentication (security requirement alternatives):

```json
[
  {
    "OAuth2": []
  }
]
```

- OAuth2: oauth2. Authenticating via OAuth requires the following steps:
- Have an activated account
- [Generate] an access token for that account at `/api/v1/users/token`.
- Make requests with the *Authorization: Bearer <token\>* header
- Profit, depending on the role assigned to the account

Note that the __access token is valid for 1 day__ and is given
along with a __refresh token valid for 2 weeks__.

[Generate]: https://docs.joinpeertube.org/api/rest-getting-started


Parameters:

- `id` (path, id | UUIDv4 | shortUUID, required) - The object id, uuid or short uuid
  Type: id | UUIDv4 | shortUUID
  
  oneOf:
    Reference: [id](https://docs.joinpeertube.org/api-rest-reference/api/models/id.md); Type: id
    
    minimum: 1
    
    Example:
    
    ```json
    42
    ```
  
    Reference: [UUIDv4](https://docs.joinpeertube.org/api-rest-reference/api/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://docs.joinpeertube.org/api-rest-reference/api/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://docs.joinpeertube.org/api-rest-reference/api/models/id.md)
  
  minimum: 1
  
  Example:
  
  ```json
  42
  ```

Responses:

- 204: successful operation

- 403: cannot remove comment of another user

- 404: comment or video does not exist

- 409: comment is already deleted

## Examples

### cURL

```bash
curl -X DELETE 'https://peertube2.cpy.re/api/v1/videos/42/comments/42' \
  -H 'Authorization: Bearer YOUR_TOKEN'
```

### JavaScript

```javascript
const response = await fetch('https://peertube2.cpy.re/api/v1/videos/42/comments/42', {
  method: 'DELETE',
  headers: {
    'Authorization': 'Bearer YOUR_TOKEN',
  },
});

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

### Python

```python
import requests

response = requests.delete(
    'https://peertube2.cpy.re/api/v1/videos/42/comments/42',
    headers={
        'Authorization': 'Bearer YOUR_TOKEN',
    },
)
print(response.text)
```


## Approve a comment

`POST /api/v1/videos/{id}/comments/{commentId}/approve`

**PeerTube >= 6.2** Approve a comment that requires a review

Authentication (security requirement alternatives):

```json
[
  {
    "OAuth2": []
  }
]
```

- OAuth2: oauth2. Authenticating via OAuth requires the following steps:
- Have an activated account
- [Generate] an access token for that account at `/api/v1/users/token`.
- Make requests with the *Authorization: Bearer <token\>* header
- Profit, depending on the role assigned to the account

Note that the __access token is valid for 1 day__ and is given
along with a __refresh token valid for 2 weeks__.

[Generate]: https://docs.joinpeertube.org/api/rest-getting-started


Parameters:

- `id` (path, id | UUIDv4 | shortUUID, required) - The object id, uuid or short uuid
  Type: id | UUIDv4 | shortUUID
  
  oneOf:
    Reference: [id](https://docs.joinpeertube.org/api-rest-reference/api/models/id.md); Type: id
    
    minimum: 1
    
    Example:
    
    ```json
    42
    ```
  
    Reference: [UUIDv4](https://docs.joinpeertube.org/api-rest-reference/api/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://docs.joinpeertube.org/api-rest-reference/api/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://docs.joinpeertube.org/api-rest-reference/api/models/id.md)
  
  minimum: 1
  
  Example:
  
  ```json
  42
  ```

Responses:

- 204: successful operation

## Examples

### cURL

```bash
curl -X POST 'https://peertube2.cpy.re/api/v1/videos/42/comments/42/approve' \
  -H 'Authorization: Bearer YOUR_TOKEN'
```

### JavaScript

```javascript
const response = await fetch('https://peertube2.cpy.re/api/v1/videos/42/comments/42/approve', {
  method: 'POST',
  headers: {
    'Authorization': 'Bearer YOUR_TOKEN',
  },
});

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

### Python

```python
import requests

response = requests.post(
    'https://peertube2.cpy.re/api/v1/videos/42/comments/42/approve',
    headers={
        'Authorization': 'Bearer YOUR_TOKEN',
    },
)
print(response.text)
```
