## List unread anchors

`GET /v1/chats/anchors`

> **This method is rolling out in the `im 26.1600.0` update.** It is not yet available on every Bitrix24 account. If the method is not available, the API returns `422 METHOD_NOT_YET_AVAILABLE` with `error.release`.

Retrieves your unread mention and reaction marks across all chats. Use them to display counters and navigate to marked messages.

There are no parameters or request body. Any query parameter is rejected with `400 INVALID_PARAMS`. The `im` scope is required, and read-only keys are supported.

## Examples

### curl — personal key

```bash
curl "https://vibecode.bitrix24.com/v1/chats/anchors" \
  -H "X-Api-Key: YOUR_API_KEY"
```

### curl — OAuth application

```bash
curl "https://vibecode.bitrix24.com/v1/chats/anchors" \
  -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/anchors', {
  headers: { 'X-Api-Key': 'YOUR_API_KEY' },
})

const { success, data, error } = await res.json()
console.log(success ? data.anchors : error)
```

### JavaScript — OAuth application

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

const { success, data, error } = await res.json()
console.log(success ? data.anchors : error)
```

## Response fields

| Field | Type | Description |
|------|-----|---------|
| `success` | boolean | Always `true` on success |
| `data.anchors` | array | All your anchors. An empty array when there are no marks |
| `data.anchors[].chatId` | number | ID of the chat containing the marked message. For a group chat, pass `chatN`, where `N` is this value, to [get a chat](/docs/chats/discovery/get) |
| `data.anchors[].messageId` | number | ID of the marked message. To navigate: [messages around a message](/docs/chats/messages/context) |
| `data.anchors[].fromUserId` | number | ID of the user who mentioned you or reacted. Details: [user list](/docs/entities/users/list) |
| `data.anchors[].type` | string | Mark type: `mention` for a mention, `reaction` for a reaction |
| `data.anchors[].subType` | string or null | Reaction code, such as `like`. `null` for a mention |
| `data.anchors[].parentChatId` | number | Parent chat ID, or `0` if there is no parent. For a group parent chat, pass `chatN`, where `N` is the nonzero `parentChatId`, to [get a chat](/docs/chats/discovery/get) |
| `data.anchors[].parentMessageId` | number | Parent message ID, or `0` if there is no parent message. To navigate: [messages around a message](/docs/chats/messages/context) |
| `data.anchors[].recentSections` | string[] | Recent dialog sections that contain the chat |

## Response example

```json
{
  "success": true,
  "data": {
    "anchors": [
      {
        "chatId": 1945,
        "messageId": 846,
        "fromUserId": 7,
        "type": "reaction",
        "subType": "like",
        "parentChatId": 0,
        "parentMessageId": 0,
        "recentSections": ["chat"]
      },
      {
        "chatId": 2001,
        "messageId": 845,
        "fromUserId": 9,
        "type": "mention",
        "subType": null,
        "parentChatId": 2000,
        "parentMessageId": 840,
        "recentSections": ["chat", "copilot"]
      }
    ]
  }
}
```

## Error response example

400 — a query parameter was passed:

```json
{
  "success": false,
  "error": {
    "code": "INVALID_PARAMS",
    "message": "Query parameter `limit` is not accepted by GET /v1/chats/anchors. It takes no query parameters."
  }
}
```

## Errors

| HTTP | Code | Description |
|------|-----|---------|
| 400 | `INVALID_PARAMS` | A query parameter was passed. Checked before any call to Bitrix24 |
| 422 | `METHOD_NOT_YET_AVAILABLE` | The method is not yet available on the portal. The minimum module version is in `error.release` |
| 422 | `BITRIX_ERROR` | Bitrix24 returned an error. The portal code is in `error.b24Code` when recognized |
| 404 | `ENTITY_NOT_FOUND` | Bitrix24 returned "not found". The portal code is in `error.b24Code` |
| 403 | `SCOPE_DENIED` | The API key does not have the `im` scope |
| 401 | `TOKEN_MISSING` | The API key has no Bitrix24 tokens configured |

The full list of common API errors — [Errors](/docs/errors).

## Known specifics

**The complete set in one call.** There is no pagination, filtering or record limit. Anchors are ordered by `messageId`, highest first.

**Message access is checked when reading the message.** The list may retain anchors for messages you cannot access. A mark does not guarantee that navigation can open the message.

**Reading does not change state.** The call does not remove anchors, mark messages read or join chats. Remove marks [by message](/docs/chats/messages/anchors-messages) or [for the entire chat](/docs/chats/messages/anchors).

## See also

- [Remove message anchors](/docs/chats/messages/anchors-messages)
- [Remove chat anchors](/docs/chats/messages/anchors)
- [Messages around a message](/docs/chats/messages/context)
- [Dialog counters](/docs/chats/discovery/counters)
