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

List a chat's links

GET /v1/chats/:chatId/links

Returns a page of the links sent in the chat's messages: the same list as on the Links tab of the chat's side panel. The newest links come first.

Parameters

Parameter Type Required Default Description
ParameterchatId (path) Typenumber Requiredyes Default— DescriptionChat ID. Get it from GET /v1/chats/recent
Parameterlimit (query) Typenumber Requiredno Default50 DescriptionHow many links to return, from 1 to 200. An out-of-range value is clamped to the nearest bound, and the response then carries meta.requestedLimit and meta.appliedLimit
Parameteroffset (query) Typenumber Requiredno Default0 DescriptionHow many links to skip from the start of the list, a non-negative integer. For the next page, pass the number of links already received
ParametersearchQuery (query) Typestring Requiredno Default— DescriptionReturns only links whose address contains this text. A non-empty string of at most 255 characters

Other query parameters and repeated ones are rejected with 400 INVALID_PARAMS.

Examples

curl — personal key

Terminal
curl "https://vibecode.bitrix24.com/v1/chats/1001/links?limit=50" \
  -H "X-Api-Key: YOUR_API_KEY"

curl — OAuth application

Terminal
curl "https://vibecode.bitrix24.com/v1/chats/1001/links?limit=50" \
  -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/1001/links?limit=50', {
  headers: {
    'X-Api-Key': 'YOUR_API_KEY',
  },
})

const { data } = await res.json()
console.log('Links:', data.list.map((link) => link.url.source))

JavaScript — OAuth application

javascript
const res = await fetch('https://vibecode.bitrix24.com/v1/chats/1001/links?limit=50', {
  headers: {
    'X-Api-Key': 'YOUR_APP_KEY',
    'Authorization': 'Bearer USER_SESSION_TOKEN',
  },
})

const { data } = await res.json()
console.log('Links:', data.list.map((link) => link.url.source))

Response fields

Field Type Description
Fieldsuccess Typeboolean DescriptionAlways true on success
Fielddata.list Typearray DescriptionThe links on this page
Fielddata.list[].id Typenumber DescriptionLink ID. Needed to remove it from the list
Fielddata.list[].messageId Typenumber DescriptionID of the message that carries the link
Fielddata.list[].chatId Typenumber DescriptionChat ID
Fielddata.list[].authorId Typenumber DescriptionID of the message sender; the profile is in data.users
Fielddata.list[].dateCreate Typestring DescriptionWhen it was sent (ISO 8601)
Fielddata.list[].url.source Typestring DescriptionThe link address as written in the message
Fielddata.list[].url.richData Typeobject DescriptionLink preview data: id, type, name, description, previewUrl, link. For a link without a preview all fields are null
Fielddata.users Typearray DescriptionMessage senders. Fields are those of a member in the chat member list: id, name, firstName, lastName, active, type and others
Fielddata.tariffRestrictions.isHistoryLimitExceeded Typeboolean Descriptiontrue when the plan hides part of the older chat history, and its links are not returned
Fieldmeta.requestedLimit Typenumber DescriptionThe limit passed. Only when it is outside the 1–200 range
Fieldmeta.appliedLimit Typenumber DescriptionThe limit applied after clamping. Only together with meta.requestedLimit

Response example

The employee profile is trimmed to the main fields:

JSON
{
  "success": true,
  "data": {
    "users": [
      {
        "id": 6,
        "active": true,
        "name": "Anna Smith",
        "firstName": "Anna",
        "lastName": "Smith",
        "workPosition": "",
        "bot": false,
        "extranet": false,
        "status": "online",
        "type": "user"
      }
    ],
    "tariffRestrictions": {
      "isHistoryLimitExceeded": false
    },
    "list": [
      {
        "id": 12,
        "messageId": 34213,
        "chatId": 1001,
        "authorId": 6,
        "dateCreate": "2026-03-03T11:44:09+00:00",
        "url": {
          "source": "https://example.com/page",
          "richData": {
            "id": null,
            "type": null,
            "name": null,
            "description": null,
            "previewUrl": null,
            "link": null
          }
        }
      },
      {
        "id": 11,
        "messageId": 34211,
        "chatId": 1001,
        "authorId": 6,
        "dateCreate": "2026-03-03T11:43:35+00:00",
        "url": {
          "source": "https://example.com/notes",
          "richData": {
            "id": null,
            "type": null,
            "name": null,
            "description": null,
            "previewUrl": null,
            "link": null
          }
        }
      }
    ]
  }
}

With limit=500 the response also carries "meta": { "requestedLimit": 500, "appliedLimit": 200 }.

Error response example

400 — a parameter the method does not accept was passed:

JSON
{
  "success": false,
  "error": {
    "code": "INVALID_PARAMS",
    "message": "Query parameter `lastId` is not accepted by GET /v1/chats/:chatId/links. Accepted: limit, offset, searchQuery."
  }
}

Errors

HTTP Code Description
HTTP400 CodeINVALID_CHAT_ID DescriptionchatId is not a positive integer. Checked before any call to Bitrix24
HTTP400 CodeINVALID_PARAMS Descriptionlimit is not an integer, offset is not a non-negative integer, searchQuery is empty or longer than 255 characters, a parameter is repeated, or a parameter is unknown — the message names it and lists the accepted ones. Checked before any call to Bitrix24
HTTP422 CodeBITRIX_ERROR Descriptionerror.b24Code is ACCESS_ERROR — the employee has no access to the chat, or there is no such chat
HTTP404 CodeENTITY_NOT_FOUND DescriptionBitrix24 returned a generic "not found" error; the Bitrix24 code is in error.b24Code
HTTP403 CodeSCOPE_DENIED DescriptionThe API key does not have the im scope
HTTP401 CodeTOKEN_MISSING DescriptionThe API key has no Bitrix24 tokens configured

Full list of common API errors — Errors.

Known specifics

End of the list. A page with fewer links than limit is the last one.

Only the visible history is returned. If the employee can see the chat history only from a certain point on — for example, they were added later without access to older messages — links before that point are not returned.

See also