# Feed comments

Deleting comments from the Bitrix24 Feed by their feed ID. This ID differs from the post comment ID and is taken from the response of the method that reads the user's comments.

**Scope:** `log` | **Base URL:** `https://vibecode.bitrix24.com/v1` | **Authorization:** `X-Api-Key`

## Which ID to use

The [GET /v1/posts/comments](/docs/posts/comments/read) method returns two identifiers for each comment. Each delete method accepts only its own.

| Response field | What it is | Delete method |
|---|---|---|
| `id` | Comment ID in the feed | [DELETE /v1/feed-comments/:id](/docs/feed-comments/delete) |
| `commentId` + `postId` | Post comment ID and post ID | [DELETE /v1/posts/:id/comments/:commentId](/docs/feed/comments/delete) |

Deleting by the feed ID removes the comment from the feed, but the post comment remains and the post's comment counter `numComments` does not decrease. To delete a post comment, use [DELETE /v1/posts/:id/comments/:commentId](/docs/feed/comments/delete).

## Quick start

Delete a feed comment with a known ID:

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

Response:

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

## Full example

Find a comment on post `315` in the feed and delete it. The read method does not filter by post, so the comment is selected by the `postId` field on the client side.

```bash
BASE='https://vibecode.bitrix24.com/v1'

# 1. User comments → feed ID of the first comment on post 315
FEED_ID=$(curl -s "$BASE/posts/comments?limit=100" \
  -H "X-Api-Key: YOUR_API_KEY" \
  | jq -r '[.data.comments[] | select(.postId == 315)][0].id')

# 2. Delete the comment from the feed
curl -s -X DELETE "$BASE/feed-comments/$FEED_ID" \
  -H "X-Api-Key: YOUR_API_KEY"

# 3. Check: the feed no longer has a comment with this ID
curl -s "$BASE/posts/comments?limit=100" \
  -H "X-Api-Key: YOUR_API_KEY" \
  | jq --argjson id "$FEED_ID" '[.data.comments[] | select(.id == $id)] | length'
```

Step 1 returns a response in which the comment has both identifiers — `id` for deleting from the feed and `commentId` for deleting the post comment:

```json
{
  "success": true,
  "data": {
    "comments": [
      {
        "id": 6195,
        "commentId": 53,
        "postId": 315,
        "date": "2026-10-20T12:50:19+00:00",
        "text": "Comment for the deletion check",
        "attach": []
      }
    ],
    "files": []
  }
}
```

Step 2 returns `{"success": true, "data": {"deleted": true}}`, step 3 prints `0`. Deleting the same ID again returns `404 ENTITY_NOT_FOUND`.

## Endpoint reference

| Method | Path | Bitrix24 method | Description |
|-------|------|---------------|----------|
| DELETE | [`/v1/feed-comments/:id`](/docs/feed-comments/delete) | log.comment.delete | Delete a feed comment |

## Error codes

### Feed comment errors

| HTTP | Code | When |
|------|-----|-------|
| 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 |

### System errors

| HTTP | Code | When |
|------|-----|-------|
| 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 |
| 502 | `BITRIX_UNAVAILABLE` | Bitrix24 is unavailable |
| 503 | `BITRIX_TIMEOUT` | Bitrix24 accepted the request but did not respond in time |

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

## See also

- [Feed](/docs/feed)
- [User comments](/docs/posts/comments)
- [Errors](/docs/errors)
