
## Update comment

`PATCH /v1/timelines/:id`

Changes the text of an existing timeline comment. Pass only the `comment` field — the other fields (`entityType`, `entityId`, `authorId`, `createdAt`) are fixed on creation and cannot be changed via the API.

## Frequently updated fields

| Field | Type | Description |
|------|-----|---------|
| `comment` | string | New comment text |

Full field list — [`GET /v1/timelines/fields`](/docs/entities/timelines/fields).

## Examples

### curl — personal key

```bash
curl -X PATCH "https://vibecode.bitrix24.com/v1/timelines/66303" \
  -H "X-Api-Key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "comment": "Follow-up: the client is ready to sign the contract next week"
  }'
```

### curl — OAuth application

```bash
curl -X PATCH "https://vibecode.bitrix24.com/v1/timelines/66303" \
  -H "X-Api-Key: YOUR_APP_KEY" \
  -H "Authorization: Bearer USER_SESSION_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "comment": "Follow-up: the client is ready to sign the contract next week"
  }'
```

### JavaScript — personal key

```javascript
const res = await fetch('https://vibecode.bitrix24.com/v1/timelines/66303', {
  method: 'PATCH',
  headers: {
    'X-Api-Key': 'YOUR_API_KEY',
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
    comment: 'Follow-up: the client is ready to sign the contract next week',
  }),
})

const { success, data } = await res.json()
```

### JavaScript — OAuth application

```javascript
const res = await fetch('https://vibecode.bitrix24.com/v1/timelines/66303', {
  method: 'PATCH',
  headers: {
    'X-Api-Key': 'YOUR_APP_KEY',
    'Authorization': 'Bearer USER_SESSION_TOKEN',
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
    comment: 'Follow-up: the client is ready to sign the contract next week',
  }),
})

const { success, data } = await res.json()
```

## Response fields

| Field | Type | Description |
|------|-----|---------|
| `data` | object | Updated comment object — all fields, see [Comment fields](/docs/entities/timelines/fields) |

## Response example

```json
{
  "success": true,
  "data": {
    "id": 66303,
    "entityId": 741,
    "entityType": "deal",
    "comment": "Follow-up: the client is ready to sign the contract next week",
    "authorId": 1,
    "createdAt": "2026-04-24T12:34:05.000Z"
  }
}
```

## Error response example

404 — comment not found:

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

## Errors

| HTTP | Code | Description |
|------|-----|---------|
| 404 | `ENTITY_NOT_FOUND` | A comment with the specified ID does not exist |
| 403 | `SCOPE_DENIED` | The API key lacks the `crm` scope |
| 401 | `TOKEN_MISSING` | The API key has no configured tokens |

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

## See also

- [Get comment](/docs/entities/timelines/get) — current value of the comment
- [Add comment](/docs/entities/timelines/create) — create a new one
- [Delete comment](/docs/entities/timelines/delete)
- [Batch](/docs/batch) — bulk comment updates
- [Limits and optimization](/docs/optimization) — rate limits
