## Delete a feed comment

`DELETE /v1/feed-comments/:id`

Deletes a comment from the Feed by its ID in the Feed. A deleted comment cannot be restored via the API.

## Parameters

| Parameter | Type | Required | Description |
|----------|-----|:-----:|----------|
| `id` (path) | number | yes | Comment ID in the feed — the `data.comments[].id` field. List: [GET /v1/posts/comments](/docs/posts/comments/read). The `commentId` field from the same response cannot be used here |

## Examples

### curl — personal key

```bash
curl -X DELETE https://vibecode.bitrix24.com/v1/feed-comments/6195 \
  -H "X-Api-Key: YOUR_API_KEY"
```

### curl — OAuth application

```bash
curl -X DELETE https://vibecode.bitrix24.com/v1/feed-comments/6195 \
  -H "X-Api-Key: YOUR_APP_KEY" \
  -H "Authorization: Bearer USER_SESSION_TOKEN"
```

### JavaScript — personal key

```javascript
const res = await fetch('https://vibecode.bitrix24.com/v1/feed-comments/6195', {
  method: 'DELETE',
  headers: { 'X-Api-Key': 'YOUR_API_KEY' },
})
const result = await res.json()
```

### JavaScript — OAuth application

```javascript
const res = await fetch('https://vibecode.bitrix24.com/v1/feed-comments/6195', {
  method: 'DELETE',
  headers: {
    'X-Api-Key': 'YOUR_APP_KEY',
    'Authorization': 'Bearer USER_SESSION_TOKEN',
  },
})
const result = await res.json()
```

## Response fields

| Field | Type | Description |
|------|-----|----------|
| `success` | boolean | `true` on successful deletion |
| `data.deleted` | boolean | Always `true`: the comment is deleted from the feed |

## Response example

```json
{
  "success": true,
  "data": {
    "deleted": true
  }
}
```

## Error response example

404 — the feed has no comment with this ID, or it has already been deleted:

```json
{
  "success": false,
  "error": {
    "code": "ENTITY_NOT_FOUND",
    "message": "Feed comment not found"
  }
}
```

## Errors

| HTTP | Code | Description |
|------|-----|----------|
| 400 | `INVALID_PARAMS` | `id` in the path is not a positive integer |
| 404 | `ENTITY_NOT_FOUND` | The feed has no comment with this `id`, including after a repeated deletion |
| 403 | `BITRIX_ACCESS_DENIED` | The key's user has no permission to delete this comment |
| 422 | `BITRIX_ERROR` | Bitrix24 did not confirm the deletion or rejected the request |
| 401 | `MISSING_API_KEY` | The `X-Api-Key` header is missing |
| 401 | `INVALID_API_KEY` | The key is not found or has been revoked |
| 401 | `TOKEN_MISSING` | The key has no portal tokens. An OAuth application key requires the `Authorization: Bearer` header |
| 403 | `SCOPE_DENIED` | The key does not have the `log` scope |
| 403 | `WRITE_BLOCKED_READONLY_KEY` | The key works in read-only mode |
| 429 | `RATE_LIMITED` | The request rate to Bitrix24 was exceeded. Retry after the time in the `Retry-After` header |
| 502 | `BITRIX_UNAVAILABLE` | Bitrix24 is unavailable |
| 503 | `BITRIX_TIMEOUT` | Bitrix24 accepted the request but did not respond in time. Before retrying, check whether the comment is still in [GET /v1/posts/comments](/docs/posts/comments/read) |

Full list of common API errors — [Errors](/docs/errors).

## Known specifics

- **The post comment remains.** Deletion removes the comment from the feed, but the post comment with the same text is not deleted, and the post's `numComments` counter in the [post list](/docs/feed/posts/list) does not decrease. To delete the post comment, call [DELETE /v1/posts/:id/comments/:commentId](/docs/feed/comments/delete) with the `postId` and `commentId` fields from the [GET /v1/posts/comments](/docs/posts/comments/read) response.

## See also

- [Feed comments](/docs/feed-comments)
- [Read user comments](/docs/posts/comments/read)
- [Delete a comment](/docs/feed/comments/delete)
- [Feed](/docs/feed)
- [Errors](/docs/errors)
