
## Delete note

`DELETE /v1/timeline-logs/:id/note`

Deletes the note attached to a timeline item. Parameters are passed in the **query string**, not in the request body.

## Parameters

| Parameter | Type | Required | Default | Description |
|----------|-----|:-----:|-----------|---------|
| `id` (path) | number | yes | — | ID of the log entry (or another timeline item) |
| `entityTypeId` (query) | number | yes | — | Type of the parent CRM entity |
| `entityId` (query) | number | yes | — | ID of the parent record |
| `itemType` (query) | number | no | `1` | `1` — history entry, `2` — activity |

## Examples

### curl — personal key

```bash
curl -X DELETE "https://vibecode.bitrix24.com/v1/timeline-logs/5012/note?entityTypeId=2&entityId=100" \
  -H "X-Api-Key: YOUR_API_KEY"
```

### curl — OAuth application

```bash
curl -X DELETE "https://vibecode.bitrix24.com/v1/timeline-logs/5012/note?entityTypeId=2&entityId=100" \
  -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/timeline-logs/5012/note?entityTypeId=2&entityId=100',
  {
    method: 'DELETE',
    headers: { 'X-Api-Key': 'YOUR_API_KEY' },
  },
)

const { success, data } = await res.json()
if (success) console.log('Note deleted')
```

### JavaScript — OAuth application

```javascript
const res = await fetch(
  'https://vibecode.bitrix24.com/v1/timeline-logs/5012/note?entityTypeId=2&entityId=100',
  {
    method: 'DELETE',
    headers: {
      'X-Api-Key': 'YOUR_APP_KEY',
      'Authorization': 'Bearer USER_SESSION_TOKEN',
    },
  },
)

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

## Response fields

| Field | Type | Description |
|------|-----|---------|
| `success` | boolean | Always `true` on success |
| `data.deleted` | boolean | Always `true` — operation confirmation |

## Response example

HTTP 200:

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

## Error response example

400 — parameters passed in the body instead of the query:

```json
{
  "success": false,
  "error": {
    "code": "INVALID_PARAMS",
    "message": "Required query: entityTypeId, entityId (positive ints). Optional: itemType (default 1)"
  }
}
```

## Errors

| HTTP | Code | Description |
|------|-----|---------|
| 400 | `INVALID_PARAMS` | Parameters are missing, passed incorrectly, or a body was sent instead of the query |
| 422 | `BITRIX_ERROR` | Bitrix24 rejected the request |
| 403 | `SCOPE_DENIED` | The API key does not have the `crm` scope |
| 401 | `TOKEN_MISSING` | The API key has no configured tokens |

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

## Known specifics

**Do not confuse with `DELETE /v1/timeline-logs/:id`.** That deletes the entire log entry and takes no parameters at all. Here — only the item's note is deleted, and `entityTypeId` + `entityId` are required.

**Idempotency is not guaranteed.** Deleting an already-deleted note again may return an error. If you need the call to be idempotent — first check via [`GET /v1/timeline-logs/:id/note`](/docs/timeline-logs/notes/get): `404 NOTE_NOT_FOUND` means "already gone, nothing to delete".

**Does not validate the existence of the `:id` log entry.** For a nonexistent `id`, `delete` also returns `200 + {deleted: true}` without an error — a silent no-op. This is also worth checking via `GET` first.

**Deleting a note is available to any key.** Unlike `DELETE /v1/timeline-logs/:id` (where only the same OAuth key that created the log entry works), deleting a note works from any key — regardless of who created it.

## See also

- [Get note](/docs/timeline-logs/notes/get) — check existence before deleting
- [Save note](/docs/timeline-logs/notes/save) — create again after deletion
- [Delete log entry](/docs/timeline-logs/logs/delete) — delete the entire parent item (the note is deleted along with it)
