[{"data":1,"prerenderedAt":7},["ShallowReactive",2],{"docs-chats\u002Fmessages\u002Fpins":3,"docs-tabs-chats\u002Fmessages\u002Fpins":6},{"content":4,"lastmod":5},"## List pinned messages\n\n`GET \u002Fv1\u002Fchats\u002F:dialogId\u002Fpins`\n\nReturns a paginated list of messages pinned in a group chat or a personal dialog.\n\n## Parameters\n\n| Parameter | Type | Required | Default | Description |\n|----------|-----|:-----:|-----------|---------|\n| `dialogId` (path) | string | yes | — | Dialog ID: numeric user ID for personal messages, `chatXXX` for group chats — the `dialogId` field of a [recent dialogs](\u002Fdocs\u002Fchats\u002Fdiscovery\u002Frecent) row; a user ID comes from the [user list](\u002Fdocs\u002Fentities\u002Fusers\u002Flist). The special `me` alias is the current user's personal dialog — see the [Chats overview](\u002Fdocs\u002Fchats) |\n| `lastId` (query) | number | no | — | Cursor: the `id` of the last pin of the previous page — a pin ID, not a message ID. The boundary itself is not included |\n| `order` (query) | string | no | `desc` | `desc` — latest pins first, `asc` — earliest first |\n| `limit` (query) | number | no | 50 | Pins per page, from 1 to 200: a value outside the range is clamped and echoed in `meta.requestedLimit` and `meta.appliedLimit` |\n\nAny other parameter or a repeated parameter is rejected with `400 INVALID_PARAMS`.\n\n## Examples\n\n### curl — personal key\n\n```bash\ncurl -X GET \"https:\u002F\u002Fvibecode.bitrix24.com\u002Fv1\u002Fchats\u002Fchat42\u002Fpins\" \\\n  -H \"X-Api-Key: YOUR_API_KEY\"\n```\n\n### curl — OAuth application\n\n```bash\ncurl -X GET \"https:\u002F\u002Fvibecode.bitrix24.com\u002Fv1\u002Fchats\u002Fchat42\u002Fpins\" \\\n  -H \"X-Api-Key: YOUR_APP_KEY\" \\\n  -H \"Authorization: Bearer USER_SESSION_TOKEN\"\n```\n\n### JavaScript — personal key\n\n```javascript\nconst res = await fetch('https:\u002F\u002Fvibecode.bitrix24.com\u002Fv1\u002Fchats\u002Fchat42\u002Fpins', {\n  method: 'GET',\n  headers: {\n    'X-Api-Key': 'YOUR_API_KEY',\n  },\n})\n\nconst { data } = await res.json()\nconst byId = new Map((data.additionalMessages ?? []).map((m) => [m.id, m]))\nconsole.log('Pinned:', data.pins.map((p) => byId.get(p.messageId)?.text))\n```\n\n### JavaScript — OAuth application\n\n```javascript\nconst res = await fetch('https:\u002F\u002Fvibecode.bitrix24.com\u002Fv1\u002Fchats\u002Fchat42\u002Fpins', {\n  method: 'GET',\n  headers: {\n    'X-Api-Key': 'YOUR_APP_KEY',\n    'Authorization': 'Bearer USER_SESSION_TOKEN',\n  },\n})\n\nconst { data } = await res.json()\nconst byId = new Map((data.additionalMessages ?? []).map((m) => [m.id, m]))\nconsole.log('Pinned:', data.pins.map((p) => byId.get(p.messageId)?.text))\n```\n\n## Response fields\n\n| Field | Type | Description |\n|------|-----|---------|\n| `success` | boolean | Always `true` on success |\n| `data.pins` | array | Pins on the page |\n| `data.pins[].id` | number | Pin ID — the `lastId` cursor for the next page |\n| `data.pins[].messageId` | number | ID of the pinned message |\n| `data.pins[].chatId` | number | Chat ID |\n| `data.pins[].authorId` | number | ID of the user who pinned the message |\n| `data.pins[].dateCreate` | string | When the message was pinned (ISO 8601) |\n| `data.additionalMessages` | array | The pinned messages: `id`, `chatId`, `authorId`, `date`, `text`, `params` and other v2 message fields |\n| `data.users` | array | Users referenced by the pins and messages |\n| `data.files` | array | Files of the pinned messages |\n| `data.reactions` | array | Reactions to the pinned messages |\n| `data.tariffRestrictions` | object | Plan restrictions on history: `isHistoryLimitExceeded` |\n| `meta.requestedLimit` | number | The `limit` you passed, when it fell outside the 1 to 200 range |\n| `meta.appliedLimit` | number | The `limit` value applied — only when it was clamped to a bound |\n\nAlso returned are `stickers`, `forwardSource` and `copilot` — v2 feed collections shared by responses that carry messages.\n\n## Response example\n\nThe main user fields are shown.\n\n```json\n{\n  \"success\": true,\n  \"data\": {\n    \"users\": [\n      {\n        \"id\": 5,\n        \"active\": true,\n        \"name\": \"Anna Smith\",\n        \"firstName\": \"Anna\",\n        \"lastName\": \"Smith\",\n        \"avatar\": \"\",\n        \"bot\": false,\n        \"type\": \"user\"\n      }\n    ],\n    \"additionalMessages\": [\n      {\n        \"id\": 1001,\n        \"chatId\": 42,\n        \"authorId\": 5,\n        \"date\": \"2026-10-06T09:18:11+00:00\",\n        \"text\": \"Please review the home page mockup\",\n        \"isSystem\": false,\n        \"uuid\": null,\n        \"forward\": null,\n        \"params\": { \"isPinned\": \"Y\" },\n        \"viewedByOthers\": false,\n        \"block\": null,\n        \"unread\": false,\n        \"viewed\": true,\n        \"viewedCount\": 0\n      }\n    ],\n    \"tariffRestrictions\": { \"isHistoryLimitExceeded\": false },\n    \"forwardSource\": null,\n    \"files\": [],\n    \"copilot\": null,\n    \"stickers\": [],\n    \"reactions\": [],\n    \"pins\": [\n      {\n        \"id\": 1,\n        \"messageId\": 1001,\n        \"chatId\": 42,\n        \"authorId\": 5,\n        \"dateCreate\": \"2026-10-06T09:18:20+00:00\"\n      }\n    ]\n  }\n}\n```\n\n## Error response example\n\n422 — there is no such chat:\n\n```json\n{\n  \"success\": false,\n  \"error\": {\n    \"code\": \"BITRIX_ERROR\",\n    \"message\": \"CHAT_NOT_FOUND\",\n    \"hint\": \"dialogId must be a userId (number as string) for DMs or \\\"chat{N}\\\" for group chats. Examples: \\\"1\\\" for user 1, \\\"chat123\\\" for group chat 123. Create a group chat first via POST \u002Fv1\u002Fbots\u002F:botId\u002Fchats if needed.\",\n    \"b24Code\": \"CHAT_NOT_FOUND\"\n  }\n}\n```\n\n## Errors\n\n| HTTP | Code | Description |\n|------|-----|---------|\n| 400 | `INVALID_PARAMS` | A parameter other than `lastId`, `order`, `limit`, a repeated parameter or an invalid value. Checked before any call to Bitrix24 |\n| 404 | `ENTITY_NOT_FOUND` | Bitrix24 reported \"not found\"; the portal code is in `error.b24Code` |\n| 422 | `BITRIX_ERROR` | Bitrix24 returned an error; the code is in `error.b24Code`, for example `CHAT_NOT_FOUND` — there is no such chat |\n| 403 | `SCOPE_DENIED` | The API key does not have the `im` scope |\n| 403 | `WRITE_BLOCKED_READONLY_KEY` | Read-only mode: the existing chat was not confirmed within the bounded window of recent dialogs, or a creating or ambiguous alias was passed. The method that would create a chat is not sent to the Bitrix24 account |\n| 403 | `WRITE_BLOCKED_READONLY_KEY` | In `READONLY` mode, this read is not available to an application key, a management key or a key whose owner type is unconfirmed |\n| 401 | `TOKEN_MISSING` | The API key has no Bitrix24 tokens configured |\n| 502 | `ME_ALIAS_RESOLUTION_FAILED` | The `me` alias could not be resolved: Bitrix24 returned no ID of the current user |\n\nFull list of common API errors — [Errors](\u002Fdocs\u002Ferrors).\n\n## Known specifics\n\n**The pins list may make you a member.** When the chat allows auto-join, reading the list may add the current user as a member, as [loading a chat](\u002Fdocs\u002Fchats\u002Fmessages\u002Fload) does. This read is available to an ordinary employee's personal key in `READONLY` mode. It does not mark messages as read.\n\n**There is no next-page flag.** The response has no `hasNextPage`. A page shorter than `limit` is the last one.\n\n**A response without pins is shorter.** For a chat without pins, only `pins`, `users` and `tariffRestrictions` are returned. The other collections appear with the first pin, so read them with a fallback value.\n\n## See also\n\n- [Pin a message](\u002Fdocs\u002Fchats\u002Fmessages\u002Fpins-create)\n- [Unpin a message](\u002Fdocs\u002Fchats\u002Fmessages\u002Fpins-delete)\n- [Number of pinned messages](\u002Fdocs\u002Fchats\u002Fmessages\u002Fpins-count)\n- [Load a chat](\u002Fdocs\u002Fchats\u002Fmessages\u002Fload)\n- [Messages](\u002Fdocs\u002Fchats\u002Fmessages)\n","2026-10-06",{},1794739548320]