لوكلاء AI: ملف markdown لهذه الصفحة — /docs-content-en/timeline-logs/pins.md فهرس التوثيق — /llms.txt
مقالات التوثيق متاحة حاليًا باللغة الإنجليزية فقط.
Pins
Pinning a log entry to the top of a CRM entity's timeline. Pinned entries are always visible when a deal, lead, contact, or company card is opened — regardless of how many events appeared later.
Bitrix24 API: crm.timeline.item.pin/unpin
Scope: crm
Pin an entry
POST /v1/timeline-logs/:id/pin
Pins a log entry to the top of the parent CRM entity's timeline. Pinned entries are always visible when the card is opened — the manager does not need to scroll through the history to see an important event.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
Parameterid (path) |
Typenumber | Requiredyes | DescriptionLog entry ID (or another timeline item) |
Request body fields
| Field | Type | Required | Description |
|---|---|---|---|
FieldentityTypeId |
Typenumber | Requiredyes | DescriptionParent CRM entity type |
FieldentityId |
Typenumber | Requiredyes | DescriptionParent record ID |
Examples
curl — personal key
curl -X POST https://vibecode.bitrix24.com/v1/timeline-logs/5012/pin \
-H "X-Api-Key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{ "entityTypeId": 2, "entityId": 100 }'
curl — OAuth application
curl -X POST https://vibecode.bitrix24.com/v1/timeline-logs/5012/pin \
-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
const res = await fetch('https://vibecode.bitrix24.com/v1/timeline-logs/5012/pin', {
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
const res = await fetch('https://vibecode.bitrix24.com/v1/timeline-logs/5012/pin', {
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 |
|---|---|---|
Fieldsuccess |
Typeboolean | DescriptionAlways true on success |
Fielddata.pinned |
Typeboolean | DescriptionAlways true — confirmation that the entry is pinned |
Response example
{
"success": true,
"data": { "pinned": true }
}
Error response example
400 — required fields missing:
{
"success": false,
"error": {
"code": "INVALID_PARAMS",
"message": "Required body: entityTypeId, entityId (positive ints)"
}
}
Errors
| HTTP | Code | Description |
|---|---|---|
| HTTP400 | CodeINVALID_PARAMS |
DescriptionentityTypeId / entityId missing or invalid, or id is not a positive integer |
| HTTP404 | CodeENTITY_NOT_FOUND |
DescriptionTimeline item with the given id does not exist |
| HTTP403 | CodeSCOPE_DENIED |
DescriptionAPI key does not have the crm scope |
| HTTP401 | CodeTOKEN_MISSING |
DescriptionAPI key has no configured tokens |
Full list of common API errors — Errors.
Known specifics
Pinning works not only for log entries. The endpoint accepts the id of any timeline item — including user comments from /v1/timelines and activities (/v1/activities). If you know the id of a comment, it can be pinned through this endpoint too.
Repeated pin is idempotent. Pinning an already-pinned entry also returns 200 + {pinned: true}. Unpinning an entry is a separate call POST /unpin.
Pinning is independent of bindings. If an entry is bound to several entities via bind, pin pins it only in the specified entityTypeId+entityId pair. To pin it in all related cards, make separate pin calls for each.