
## Delete an entry

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

Deletes a log entry from the timeline. Bitrix24 allows an entry to be deleted only by the same application that created it — otherwise it returns `403 CROSS_APP_DELETE_FORBIDDEN`.

## Parameters

| Parameter | Type | Required | Description |
|----------|-----|:-----:|---------|
| `id` (path) | number | yes | Log entry ID |

## When deletion works

| Creation key | Deletion key | Result |
|---------------|---------------|-----------|
| OAuth application `vibe_app_*` | the same application | ✅ `200 + {deleted: true}` |
| Personal key `vibe_api_*` | any key (including the same one) | ❌ `403 CROSS_APP_DELETE_FORBIDDEN` |
| Any key | a different OAuth application | ❌ `403 CROSS_APP_DELETE_FORBIDDEN` |
| Direct B24 webhook | any Vibecode key | ❌ `403 CROSS_APP_DELETE_FORBIDDEN` |

Personal keys (`vibe_api_*`) are not suitable for deletion because Vibecode rotates OAuth tokens under the hood — to Bitrix24 each call looks like a separate application. If you plan to delete created entries via the API, use an OAuth application with `Authorization: Bearer ...`.

## Examples

### curl — personal key

```bash
curl -X DELETE "https://vibecode.bitrix24.com/v1/timeline-logs/5012" \
  -H "X-Api-Key: YOUR_API_KEY"
```

### curl — OAuth application

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

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

### JavaScript — OAuth application

```javascript
const res = await fetch('https://vibecode.bitrix24.com/v1/timeline-logs/5012', {
  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 | `true` on successful deletion |
| `data.deleted` | boolean | Always `true` on success — confirmation of the operation |

## Response example

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

## Error response example

403 — the entry was created by a different application:

```json
{
  "success": false,
  "error": {
    "code": "CROSS_APP_DELETE_FORBIDDEN",
    "message": "This timeline message can only be deleted via the API key it was created with."
  }
}
```

## Errors

| HTTP | Code | Description |
|------|-----|---------|
| 400 | `INVALID_PARAMS` | `id` is not a positive integer |
| 403 | `CROSS_APP_DELETE_FORBIDDEN` | The entry was created by a different application (or by a personal key — it always looks like different applications to B24) |
| 404 | `ENTITY_NOT_FOUND` | The log entry with the given `id` does not exist |
| 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

**If an entry cannot be deleted via the API, it cannot be deleted at all.** Bitrix24 does not provide a UI delete button for log entries in the entity card (unlike user timeline comments and activities). If the ability to delete is critical for your scenario, create entries through the same OAuth key you plan to delete with.

**Deleted from all bound timelines at once.** If the entry was bound to several entities via [`POST /:id/bind`](/docs/timeline-logs/bindings/bind) — `DELETE` will remove it from the timelines of the deal, contact, company, and so on simultaneously. Targeted removal from a single timeline is done via [`POST /:id/unbind`](/docs/timeline-logs/bindings/unbind) (but not for the last binding — see its documentation).

**Deletion is irreversible.** A deleted log entry cannot be restored via the API — create a new one if needed. A note attached to this entry is deleted together with it.

## See also

- [Create an entry](/docs/timeline-logs/logs/create) — to recreate after deletion
- [List entries](/docs/timeline-logs/logs/list) — find an `id` before deleting
- [Which key to use](/docs/timeline-logs#which-key-to-use) — choosing between a personal and an OAuth key
- [Limits and optimization](/docs/optimization) — rate limits
