
## Delete comment

`DELETE /v1/tasks/:taskId/comments/:id`

Deletes a task comment. Available only on Bitrix24 accounts with the old task card: on the new card the method returns `410 GONE`. A deleted comment cannot be restored through the API.

## Parameters

| Parameter | Type | Required | Description |
|----------|-----|:-----:|---------|
| `taskId` (path) | number | yes | Task ID |
| `id` (path) | number | yes | Comment ID |

## Examples

### curl — personal key

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

### curl — OAuth app

```bash
curl -X DELETE "https://vibecode.bitrix24.com/v1/tasks/289/comments/36559" \
  -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/tasks/289/comments/36559', {
  method: 'DELETE',
  headers: {
    'X-Api-Key': 'YOUR_API_KEY',
  },
})

if (res.status === 204) {
  console.log('Comment deleted')
} else if (res.status === 410) {
  const { error } = await res.json()
  console.log('New card — delete unavailable:', error.message)
}
```

### JavaScript — OAuth app

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

## Response

On a successful delete on the old card, the HTTP status `204 No Content` is returned with an empty body — success is checked by the status. On the new card, instead of `204` a `410 GONE` with a JSON body is returned (see below).

## Response example

Old card:

```
HTTP/1.1 204 No Content
```

## Error response example

410 — new task card (method unavailable):

```json
{
  "success": false,
  "error": {
    "code": "GONE",
    "message": "Bitrix24 disabled update/delete for task comments in the new task card. To remove a comment, delete the source task or ask a portal admin to remove the message via the chat UI.",
    "hint": "Verified against apidocs.bitrix24.com on 2026-05-09 — the modern task-chat API accepts only new messages, no edit or delete."
  }
}
```

## Errors

| HTTP | Code | Description |
|------|-----|---------|
| 400 | `INVALID_PARAMS` | `taskId` or `id` are not positive integers |
| 410 | `GONE` | The task was created on the new card — deleting a comment is unavailable on the Bitrix24 side |
| 403 | `SCOPE_DENIED` | The API key does not have the `task` scope |
| 401 | `TOKEN_MISSING` | The API key has no configured tokens |

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

## Known specifics

**Alternative for the new card.** There is no way to delete a posted comment programmatically. If the content needs to be hidden — delete the whole task ([`DELETE /v1/tasks/:id`](/docs/entities/tasks/delete)), or ask the Bitrix24 account admin to remove the message via the chat UI.

## See also

- [List comments](./list.md) — find the comment before deleting
- [Get comment](./get.md) — check the text before deleting
- [Update comment](./update.md) — edit (same card contract)
- [Tasks](/docs/entities/tasks) — parent entity
