
## Unpin an entry

`POST /v1/timeline-logs/:id/unpin`

Removes the pin from a log entry. The entry stays in the timeline but is no longer highlighted at the top of the card — it appears in the general chronology.

## Parameters

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

## Request body fields

| Field | Type | Required | Description |
|------|-----|:-----:|---------|
| **`entityTypeId`** | number | yes | Parent CRM entity type |
| **`entityId`** | number | yes | Parent record ID |

## Examples

### curl — personal key

```bash
curl -X POST https://vibecode.bitrix24.com/v1/timeline-logs/5012/unpin \
  -H "X-Api-Key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "entityTypeId": 2, "entityId": 100 }'
```

### curl — OAuth application

```bash
curl -X POST https://vibecode.bitrix24.com/v1/timeline-logs/5012/unpin \
  -H "X-Api-Key: YOUR_APP_KEY" \
  -H "Authorization: Bearer USER_SESSION_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{ "entityTypeId": 2, "entityId": 100 }'
```

### JavaScript — personal key

```javascript
const res = await fetch('https://vibecode.bitrix24.com/v1/timeline-logs/5012/unpin', {
  method: 'POST',
  headers: {
    'X-Api-Key': 'YOUR_API_KEY',
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({ entityTypeId: 2, entityId: 100 }),
})

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

### JavaScript — OAuth application

```javascript
const res = await fetch('https://vibecode.bitrix24.com/v1/timeline-logs/5012/unpin', {
  method: 'POST',
  headers: {
    'X-Api-Key': 'YOUR_APP_KEY',
    'Authorization': 'Bearer USER_SESSION_TOKEN',
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({ entityTypeId: 2, entityId: 100 }),
})

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

## Response fields

| Field | Type | Description |
|------|-----|---------|
| `success` | boolean | Always `true` on success |
| `data.pinned` | boolean | Always `false` — confirmation that the entry is no longer pinned |

## Response example

```json
{
  "success": true,
  "data": { "pinned": false }
}
```

## Error response example

400 — required fields missing:

```json
{
  "success": false,
  "error": {
    "code": "INVALID_PARAMS",
    "message": "Required body: entityTypeId, entityId (positive ints)"
  }
}
```

## Errors

| HTTP | Code | Description |
|------|-----|---------|
| 400 | `INVALID_PARAMS` | `entityTypeId` / `entityId` missing or invalid, or `id` is not a positive integer |
| 404 | `ENTITY_NOT_FOUND` | Timeline item with the given `id` does not exist |
| 403 | `SCOPE_DENIED` | API key does not have the `crm` scope |
| 401 | `TOKEN_MISSING` | API key has no configured tokens |

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

## Known specifics

**Idempotent.** Unpinning an entry that is not pinned returns `200 + {pinned: false}`, with no error.

**Does not delete the entry.** This only removes the highlight; the log entry itself stays in the timeline. To remove it from the history — [`DELETE /v1/timeline-logs/:id`](/docs/timeline-logs/logs/delete).

## See also

- [Pin an entry](/docs/timeline-logs/pins/pin) — the reverse operation
- [Delete an entry](/docs/timeline-logs/logs/delete) — remove from the timeline entirely
