
## 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. Get a list of IDs — [`GET /v1/timeline-logs`](/docs/timeline-logs/logs/list) |

## When deletion works

| Creation key | Deletion key | Result |
|---------------|---------------|-----------|
| OAuth application `vibe_app_*` | the same application | `200`, `data.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 Bitrix24 webhook | any Vibecode key | `403 CROSS_APP_DELETE_FORBIDDEN` |

Personal keys (`vibe_api_*`) are not suitable for deletion because Vibecode rotates their OAuth tokens — 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` | object | Deletion result |
| `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": "Personal webhook keys cannot delete timeline messages. Only the OAuth app that created this message can delete it."
  }
}
```

## 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 the delete request was sent with a personal key |
| 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 |
| 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

**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 with the same OAuth application you plan to delete them 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` removes it from the timelines of the deal, contact, company, and so on simultaneously. To remove it from a single timeline only, use [`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)
- [List entries](/docs/timeline-logs/logs/list)
- [Which key to use](/docs/timeline-logs#which-key-to-use)
- [Limits and optimization](/docs/optimization)
