
## 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 | — | Timeline item ID. Log entries: [`GET /v1/timeline-logs`](/docs/timeline-logs/logs/list), activities when `itemType` is `2`: [`GET /v1/activities`](/docs/entities/activities/list) |
| `entityTypeId` (query) | number | yes | — | Type of the parent CRM entity. See [Entity types](/docs/timeline-logs#parent-entity-types) |
| `entityId` (query) | number | yes | — | ID of the parent record. For where to get the ID for each type, see [Entity types](/docs/timeline-logs#parent-entity-types) |
| `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 |
| 403 | `WRITE_BLOCKED_READONLY_KEY` | The key is read-only — see [access rights](/docs/access-rights) |
| 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 endpoint deletes the entire log entry and takes no parameters at all. This one deletes only the item's note and requires `entityTypeId` + `entityId`.

**The response does not tell whether the note existed.** Deleting an already-deleted note again, or deleting by a nonexistent `id`, also returns `200` and `{ "deleted": true }`. To check whether a note exists, read it via [`GET /v1/timeline-logs/:id/note`](/docs/timeline-logs/notes/get): it returns `404` when there is none.

**Any key with the `crm` scope in read-write mode can delete a note, regardless of who created it.** `DELETE /v1/timeline-logs/:id` works differently: only the OAuth key that created the log entry can delete it.

## See also

- [Get note](/docs/timeline-logs/notes/get)
- [Save note](/docs/timeline-logs/notes/save)
- [Delete log entry](/docs/timeline-logs/logs/delete)
