For AI agents: markdown of this page — /docs-content-en/chats/messages/favorites.md documentation index — /llms.txt

Get favorite messages

GET /v1/chats/:dialogId/favorites

Returns the current user’s favorite rows in one chat, page by page, together with the messages and their authors.

Parameters

Parameter Type Required Description
ParameterdialogId (path) Typestring Requiredyes Descriptionchat followed by the actual chat ID returned when you load the chat, including a one-to-one chat. The endpoint rejects a numeric user ID and me.
Parameterlimit (query) Typeinteger Requiredno DescriptionRows per page: 1–50, default 50. For out-of-range values, meta.requestedLimit shows the requested limit and meta.appliedLimit shows the limit used.
ParameterlastId (query) Typeinteger Requiredno DescriptionExclusive cursor: id of the last row of the previous page
Parametersearch (query) Typestring Requiredno DescriptionSearch in message text

Requires the im scope. The credentials identify the current user. The API rejects parameters that specify the owner and any unknown parameters.

Examples

curl — personal key

Terminal
curl -X GET "https://vibecode.bitrix24.com/v1/chats/chat1945/favorites" \
  -H "X-Api-Key: YOUR_API_KEY"

curl — OAuth application

Terminal
curl -X GET "https://vibecode.bitrix24.com/v1/chats/chat1945/favorites" \
  -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/chats/chat1945/favorites', {
  method: 'GET',
  headers: {
    'X-Api-Key': 'YOUR_API_KEY',
  },
})
const { data } = await res.json()
console.log(data)

JavaScript — OAuth application

javascript
const res = await fetch('https://vibecode.bitrix24.com/v1/chats/chat1945/favorites', {
  method: 'GET',
  headers: {
    'X-Api-Key': 'YOUR_APP_KEY',
    'Authorization': 'Bearer USER_SESSION_TOKEN',
  },
})
const { data } = await res.json()
console.log(data)

Response fields

Field Type Description
Fieldsuccess Typeboolean Descriptiontrue
Fielddata.list Typearray DescriptionFavorite link rows
Fielddata.list[].id Typenumber DescriptionFavorite link id and pagination cursor
Fielddata.list[].messageId Typenumber DescriptionMessage id
Fielddata.list[].chatId Typenumber DescriptionReal chat id
Fielddata.list[].authorId Typenumber DescriptionFavorite owner id
Fielddata.list[].dateCreate Typestring DescriptionDate added to favorites
Fielddata.list[].message Typeobject DescriptionThe message: id, chatId, authorId, date, text, isSystem, params and read flags
Fielddata.messages, data.additionalMessages Typearray DescriptionRelated messages. Not every response includes them
Fielddata.users, data.files Typearray DescriptionRelated users and files
Fielddata.usersShort, data.reactions, data.stickers Typearray DescriptionShort user details, reactions and stickers of the messages in data.list. Not every response includes them: an empty page omits them
Fielddata.tariffRestrictions.isHistoryLimitExceeded Typeboolean Descriptiontrue when the plan hides part of the older chat history and its messages are left out of the results
Fieldmeta.requestedLimit Typenumber DescriptionThe limit that was sent. Returned together with appliedLimit, only when the value was outside the range from 1 to 50
Fieldmeta.appliedLimit Typenumber DescriptionThe applied limit value — only when it was clamped to a bound

Response example

Only the main message and user fields are shown.

JSON
{
  "success": true,
  "data": {
    "list": [
      {
        "id": 15,
        "messageId": 846,
        "chatId": 1945,
        "authorId": 7,
        "dateCreate": "2026-11-17T10:05:00+00:00",
        "message": {
          "id": 846,
          "chatId": 1945,
          "authorId": 12,
          "date": "2026-11-16T09:30:00+00:00",
          "text": "Release notes are ready",
          "isSystem": false,
          "params": {"favorite": ["7"]},
          "unread": false,
          "viewed": true
        }
      },
      {
        "id": 14,
        "messageId": 845,
        "chatId": 1945,
        "authorId": 7,
        "dateCreate": "2026-11-17T10:04:00+00:00",
        "message": {
          "id": 845,
          "chatId": 1945,
          "authorId": 12,
          "date": "2026-11-16T09:28:00+00:00",
          "text": "Project update",
          "isSystem": false,
          "params": {"favorite": ["7"]},
          "unread": false,
          "viewed": true
        }
      }
    ],
    "users": [{"id": 12, "active": true, "name": "Anna Smith", "type": "user"}],
    "usersShort": [],
    "files": [],
    "reactions": [],
    "stickers": [],
    "tariffRestrictions": {"isHistoryLimitExceeded": false}
  }
}

Error response example

400 — unexpected parameter:

JSON
{
  "success": false,
  "error": {
    "code": "INVALID_PARAMS",
    "message": "Query parameter `ownerId` is not accepted by GET /v1/chats/:dialogId/favorites. Accepted: lastId, limit, search."
  }
}

Errors

HTTP Code Description
HTTP400 CodeINVALID_PARAMS DescriptionMalformed ID, or an unexpected or repeated parameter or body field
HTTP422 CodeBITRIX_ERROR Descriptionerror.b24Code is ACCESS_ERROR — the employee has no access to the chat, or there is no such chat
HTTP401 CodeMISSING_API_KEY DescriptionNo API key was provided
HTTP401 CodeTOKEN_MISSING DescriptionNo Bitrix24 credentials are configured
HTTP403 CodeSCOPE_DENIED DescriptionThe key does not have im scope
HTTP403 CodeBITRIX_ACCESS_DENIED DescriptionThe current user has no access
HTTP404 CodeENTITY_NOT_FOUND DescriptionThe record was not found
HTTP422 CodeBITRIX_ERROR DescriptionBitrix24 refused the operation with another code, which is in error.b24Code

Common API errors.

Known specifics

Rows 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.

See also