## Active members

`GET /v1/chats/:dialogId/users/active`

Returns the chat members as user cards, in one page and in the chosen order. To list the most active members first, pass `sort=lastSendMessageId&order=desc`. The [member list in the v2 mode](/docs/chats/members/list) pages through all members.

## Parameters

| Parameter | Type | Required | Default | Description |
|----------|-----|:-----:|-----------|---------|
| `dialogId` (path) | string | yes | — | Dialog identifier: `chatXXX` for a group chat, a user ID for the personal dialog with that user, or the alias `me` for the personal dialog with yourself |
| `limit` (query) | number | no | 50 | How many members to return, from 1 to 200. An out-of-range value is clamped and echoed in `meta.requestedLimit` and `meta.appliedLimit` |
| `sort` (query) | string | no | — | The sort key: `id` — the membership record, `lastSendMessageId` — the member's last message, `userId` — the user ID. Without `sort` the order is up to Bitrix24 |
| `order` (query) | string | no | `desc` | The direction of `sort`: `desc` or `asc`, case-insensitive. Only together with `sort` |

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

## Examples

### curl — personal key

```bash
curl "https://vibecode.bitrix24.com/v1/chats/chat42/users/active?sort=lastSendMessageId&order=desc&limit=10" \
  -H "X-Api-Key: YOUR_API_KEY"
```

### curl — OAuth application

```bash
curl "https://vibecode.bitrix24.com/v1/chats/chat42/users/active?sort=lastSendMessageId&order=desc&limit=10" \
  -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/chat42/users/active?sort=lastSendMessageId&order=desc&limit=10', {
  headers: { 'X-Api-Key': 'YOUR_API_KEY' },
})

const { data } = await res.json()
console.log('Active:', data.map((u) => u.name))
```

### JavaScript — OAuth application

```javascript
const res = await fetch('https://vibecode.bitrix24.com/v1/chats/chat42/users/active?sort=lastSendMessageId&order=desc&limit=10', {
  headers: {
    'X-Api-Key': 'YOUR_APP_KEY',
    'Authorization': 'Bearer USER_SESSION_TOKEN',
  },
})

const { data } = await res.json()
console.log('Active:', data.map((u) => u.name))
```

## Response fields

| Field | Type | Description |
|------|-----|---------|
| `success` | boolean | Always `true` on success |
| `data` | array | Member cards — the same fields as in the [member list](/docs/chats/members/list) |
| `data[].id` | number | User ID |
| `data[].active` | boolean | Whether the account is active |
| `data[].name` | string | Full name |
| `data[].firstName` | string | First name |
| `data[].lastName` | string | Last name |
| `data[].workPosition` | string\|null | Job title |
| `data[].status` | string | Status (`online`, `away`, `dnd`) |
| `data[].lastActivityDate` | string | Last activity date (ISO 8601) |
| `data[].bot` | boolean | Whether the user is a bot |
| `data[].type` | string | User type (`user`, `bot`, `extranet`) |
| `meta.requestedLimit` | number | The `limit` passed, when it was outside the range from 1 to 200 |
| `meta.appliedLimit` | number | The `limit` applied |

## Response example

```json
{
  "success": true,
  "data": [
    {
      "id": 7,
      "active": true,
      "name": "Anna Grey",
      "firstName": "Anna",
      "lastName": "Grey",
      "workPosition": "Analyst",
      "color": "#83c3f7",
      "avatar": "",
      "gender": "F",
      "birthday": "",
      "extranet": false,
      "network": false,
      "bot": false,
      "connector": false,
      "status": "away",
      "idle": false,
      "lastActivityDate": "2026-09-20T10:00:00+00:00",
      "absent": false,
      "departments": [1],
      "type": "user"
    }
  ]
}
```

## Error response example

400 — `order` without `sort`:

```json
{
  "success": false,
  "error": {
    "code": "INVALID_PARAMS",
    "message": "`order` sets the direction of `sort` and is accepted only together with it."
  }
}
```

## Errors

| HTTP | Code | Description |
|------|-----|---------|
| 400 | `INVALID_PARAMS` | A parameter other than `limit`, `sort`, `order`, a repeated parameter, a non-numeric `limit`, a `sort` or `order` outside its list, `order` without `sort`. Checked before any call to Bitrix24 |
| 403 | `SCOPE_DENIED` | The API key does not have the `im` scope |
| 401 | `TOKEN_MISSING` | The API key has no Bitrix24 tokens configured |
| 404 | `ENTITY_NOT_FOUND` | Bitrix24 returned "not found"; the portal code is in `error.b24Code` |
| 422 | `BITRIX_ERROR` | Bitrix24 returned an error; the portal code is in `error.b24Code`. A missing chat lands here with the code `CHAT_NOT_FOUND` |
| 502 | `ME_ALIAS_RESOLUTION_FAILED` | The user could not be resolved for the `me` alias |

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

## Known specifics

**Reading may make you a member.** If the chat allows auto-join, Bitrix24 may add the caller as a member. A `READONLY` key may use this read operation under the narrow exception; it does not mark messages read. The user's Bitrix24 access and the `im` scope still apply.

## See also

- [List members](/docs/chats/members/list)
- [Chat members as entities](/docs/chats/members/member-entities)
- [Chat members](/docs/chats/members)
