[{"data":1,"prerenderedAt":7},["ShallowReactive",2],{"docs-chats\u002Fmessages\u002Ffavorites":3,"docs-tabs-chats\u002Fmessages\u002Ffavorites":6},{"content":4,"lastmod":5},"## Get favorite messages\n\n`GET \u002Fv1\u002Fchats\u002F:dialogId\u002Ffavorites`\n\nReturns the current user’s favorite rows in one chat, page by page, together with the messages and their authors.\n\n## Parameters\n\n| Parameter | Type | Required | Description |\n|-----------|------|----------|-------------|\n| `dialogId` (path) | string | yes | `chat` followed by the actual chat ID returned when you [load the chat](\u002Fdocs\u002Fchats\u002Fmessages\u002Fload), including a one-to-one chat. The endpoint rejects a numeric user ID and `me`. |\n| `limit` (query) | integer | no | Rows per page: 1–50, default 50. For out-of-range values, `meta.requestedLimit` shows the requested limit and `meta.appliedLimit` shows the limit used. |\n| `lastId` (query) | integer | no | Exclusive cursor: `id` of the last row of the previous page |\n| `search` (query) | string | no | Search in message text |\n\nRequires the `im` scope. The credentials identify the current user. The API rejects parameters that specify the owner and any unknown parameters.\n\n## Examples\n\n### curl — personal key\n\n```bash\ncurl -X GET \"https:\u002F\u002Fvibecode.bitrix24.com\u002Fv1\u002Fchats\u002Fchat1945\u002Ffavorites\" \\\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\u002Fchat1945\u002Ffavorites\" \\\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\u002Fchat1945\u002Ffavorites', {\n  method: 'GET',\n  headers: {\n    'X-Api-Key': 'YOUR_API_KEY',\n  },\n})\nconst { data } = await res.json()\nconsole.log(data)\n```\n\n### JavaScript — OAuth application\n\n```javascript\nconst res = await fetch('https:\u002F\u002Fvibecode.bitrix24.com\u002Fv1\u002Fchats\u002Fchat1945\u002Ffavorites', {\n  method: 'GET',\n  headers: {\n    'X-Api-Key': 'YOUR_APP_KEY',\n    'Authorization': 'Bearer USER_SESSION_TOKEN',\n  },\n})\nconst { data } = await res.json()\nconsole.log(data)\n```\n\n## Response fields\n\n| Field | Type | Description |\n|-------|------|-------------|\n| `success` | boolean | `true` |\n| `data.list` | array | Favorite link rows |\n| `data.list[].id` | number | Favorite link id and pagination cursor |\n| `data.list[].messageId` | number | Message id |\n| `data.list[].chatId` | number | Real chat id |\n| `data.list[].authorId` | number | Favorite owner id |\n| `data.list[].dateCreate` | string | Date added to favorites |\n| `data.list[].message` | object | The message: `id`, `chatId`, `authorId`, `date`, `text`, `isSystem`, `params` and read flags |\n| `data.messages, data.additionalMessages` | array | Related messages. Not every response includes them |\n| `data.users, data.files` | array | Related users and files |\n| `data.usersShort, data.reactions, data.stickers` | array | Short user details, reactions and stickers of the messages in `data.list`. Not every response includes them: an empty page omits them |\n| `data.tariffRestrictions.isHistoryLimitExceeded` | boolean | `true` when the plan hides part of the older chat history and its messages are left out of the results |\n| `meta.requestedLimit` | number | The `limit` that was sent. Returned together with `appliedLimit`, only when the value was outside the range from 1 to 50 |\n| `meta.appliedLimit` | number | The applied `limit` value — only when it was clamped to a bound |\n\n## Response example\n\nOnly the main message and user fields are shown.\n\n```json\n{\n  \"success\": true,\n  \"data\": {\n    \"list\": [\n      {\n        \"id\": 15,\n        \"messageId\": 846,\n        \"chatId\": 1945,\n        \"authorId\": 7,\n        \"dateCreate\": \"2026-11-17T10:05:00+00:00\",\n        \"message\": {\n          \"id\": 846,\n          \"chatId\": 1945,\n          \"authorId\": 12,\n          \"date\": \"2026-11-16T09:30:00+00:00\",\n          \"text\": \"Release notes are ready\",\n          \"isSystem\": false,\n          \"params\": {\"favorite\": [\"7\"]},\n          \"unread\": false,\n          \"viewed\": true\n        }\n      },\n      {\n        \"id\": 14,\n        \"messageId\": 845,\n        \"chatId\": 1945,\n        \"authorId\": 7,\n        \"dateCreate\": \"2026-11-17T10:04:00+00:00\",\n        \"message\": {\n          \"id\": 845,\n          \"chatId\": 1945,\n          \"authorId\": 12,\n          \"date\": \"2026-11-16T09:28:00+00:00\",\n          \"text\": \"Project update\",\n          \"isSystem\": false,\n          \"params\": {\"favorite\": [\"7\"]},\n          \"unread\": false,\n          \"viewed\": true\n        }\n      }\n    ],\n    \"users\": [{\"id\": 12, \"active\": true, \"name\": \"Anna Smith\", \"type\": \"user\"}],\n    \"usersShort\": [],\n    \"files\": [],\n    \"reactions\": [],\n    \"stickers\": [],\n    \"tariffRestrictions\": {\"isHistoryLimitExceeded\": false}\n  }\n}\n```\n\n## Error response example\n\n400 — unexpected parameter:\n\n```json\n{\n  \"success\": false,\n  \"error\": {\n    \"code\": \"INVALID_PARAMS\",\n    \"message\": \"Query parameter `ownerId` is not accepted by GET \u002Fv1\u002Fchats\u002F:dialogId\u002Ffavorites. Accepted: lastId, limit, search.\"\n  }\n}\n```\n\n## Errors\n\n| HTTP | Code | Description |\n|------|------|-------------|\n| 400 | `INVALID_PARAMS` | Malformed ID, or an unexpected or repeated parameter or body field |\n| 422 | `BITRIX_ERROR` | `error.b24Code` is `ACCESS_ERROR` — the employee has no access to the chat, or there is no such chat |\n| 401 | `MISSING_API_KEY` | No API key was provided |\n| 401 | `TOKEN_MISSING` | No Bitrix24 credentials are configured |\n| 403 | `SCOPE_DENIED` | The key does not have im scope |\n| 403 | `BITRIX_ACCESS_DENIED` | The current user has no access |\n| 404 | `ENTITY_NOT_FOUND` | The record was not found |\n| 422 | `BITRIX_ERROR` | Bitrix24 refused the operation with another code, which is in `error.b24Code` |\n\n[Common API errors](\u002Fdocs\u002Ferrors).\n\n## Known specifics\n\nRows are ordered by favorite link id descending. Stop when a page contains fewer rows than the effective page size. Use 50 by default, the requested size for an in-range `limit`, or `meta.appliedLimit` when the API adjusts the limit. Do not load the list every time a message menu opens.\n\n## See also\n\n- [Chat configuration](\u002Fdocs\u002Fchats\u002Fdiscovery\u002Fconfiguration)\n- [Messages](\u002Fdocs\u002Fchats\u002Fmessages)\n","2026-11-20",{},1795415435683]