
## List workgroups

`GET /v1/workgroups`

Returns a list of workgroups in your Bitrix24 account with support for filtering, sorting and automatic pagination.

## Parameters

| Parameter | Type | Required | Default | Description |
|----------|-----|:-----:|-----------|---------|
| `filter` (query) | object | no | — | Filtering by fields from [GET /v1/workgroups/fields](./fields.md).<br>[Filtering syntax](/docs/filtering). Example: `?filter[archived]=N` |
| `select` (query) | array | no | — | List of fields in the response. Field names come from [GET /v1/workgroups/fields](./fields.md). |
| `sort` (query) | string | no | — | Sorting: `?sort=dateCreate` — ascending, `?sort=-dateCreate` — descending. The forms `?sort[dateCreate]=DESC` and `?order[dateCreate]=desc` are accepted too |
| `limit` (query) | number | no | `50` | Maximum records in the response. Up to 5000 allowed. |
| `offset` (query) | number | no | `0` | Offset from the start of the selection. |
| `include` (query) | string | no | — | Related data: `owner` — the group owner. See the "Related data" section below |
| `withTotal` (query) | string | no | — | The values `true` and `false` are recognized. For workgroups, the parameter does not affect the response: `meta.total` is returned even with `withTotal=false` |

For `limit > 50`, Vibecode automatically paginates the request on the server side. The maximum is 5000 records per call. If more records match the filter, `meta.hasMore` is `true`.

### Get projects only

A single collection stores both workgroups and projects. The `isProject` field distinguishes them: `true` — a project, `false` — an ordinary workgroup. To select projects, pass `filter[isProject]=Y`.

## Examples

### curl — personal key

```bash
curl "https://vibecode.bitrix24.com/v1/workgroups?limit=3" \
  -H "X-Api-Key: YOUR_API_KEY"
```

### curl — OAuth application

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

const { success, data, meta } = await res.json()
console.log(`Found ${meta.total} workgroups`)
```

### JavaScript — OAuth application

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

const { success, data, meta } = await res.json()
```

## Response fields

| Field | Type | Description |
|------|-----|---------|
| `success` | boolean | Always `true` on success |
| `data` | array | Array of workgroups (all fields — see [Workgroup fields](./fields.md)) |
| `meta.total` | number | Total number of records matching the filter |
| `meta.hasMore` | boolean | Whether there are more records beyond `limit` |
| `meta.includeSkipped` | boolean | `true` when the response holds more than 200 records and the relations from `include` were not loaded. Reduce `limit`. With 200 records or fewer the key is absent |

## Related data

To get the owner of each group together with the list, pass the `include` parameter in the GET request:

```
GET /v1/workgroups?limit=2&include=owner
```

Available `include` value:

| Name | By field | Key in `_included` | Result |
|-----|----------------|--------------------|-----------|
| `owner` | `ownerId` — the group owner | `owner` | Employee card |

The employee card is the same as in the [`GET /v1/users/:id`](/docs/entities/users/get) response. Loading this relation requires the `user` scope in addition to `sonet_group`. The result is in the `_included` field of each `data` element:

```json
{
  "success": true,
  "data": [
    {
      "id": 79,
      "name": "Marketing 2026",
      "ownerId": 1269,
      "isProject": true,
      "_included": {
        "owner": { "id": 1269, "name": "John", "lastName": "Smith", "email": "john.smith@example.com", "active": true }
      }
    }
  ],
  "meta": { "total": 29, "hasMore": true }
}
```

Only the main group and employee fields are shown. For the full list of employee fields, see [Employee fields](/docs/entities/users/fields).

## Response example

```json
{
  "success": true,
  "data": [
    {
      "id": 85,
      "siteId": "s1",
      "name": "Marketing 2026",
      "description": null,
      "dateCreate": "2026-03-20T06:45:10.000Z",
      "dateUpdate": "2026-03-20T06:45:10.000Z",
      "active": true,
      "visible": true,
      "opened": false,
      "archived": false,
      "subjectId": 1,
      "ownerId": 1271,
      "keywords": null,
      "membersCount": 2,
      "dateActivity": "2026-03-20T06:45:10.000Z",
      "subjectName": "Workgroups",
      "isProject": true,
      "isExtranet": false
    },
    {
      "id": 83,
      "siteId": "s1",
      "name": "New product development team",
      "description": null,
      "dateCreate": "2026-03-20T06:41:07.000Z",
      "dateUpdate": "2026-03-20T06:41:07.000Z",
      "active": true,
      "visible": true,
      "opened": false,
      "archived": false,
      "subjectId": 1,
      "ownerId": 1269,
      "keywords": null,
      "membersCount": 1,
      "dateActivity": "2026-03-20T06:41:07.000Z",
      "subjectName": "Workgroups",
      "isProject": true,
      "imageUrl": "https://cdn.bitrix24.com/example/disk/avatar.jpg",
      "isExtranet": false
    },
    {
      "id": 81,
      "siteId": "s1",
      "name": "Regional office launch",
      "description": null,
      "dateCreate": "2026-03-20T06:29:07.000Z",
      "dateUpdate": "2026-03-20T06:29:07.000Z",
      "active": true,
      "visible": true,
      "opened": false,
      "archived": false,
      "subjectId": 1,
      "ownerId": 1271,
      "keywords": null,
      "membersCount": 1,
      "dateActivity": "2026-03-20T06:29:07.000Z",
      "subjectName": "Workgroups",
      "isProject": true,
      "isExtranet": false
    }
  ],
  "meta": {
    "total": 33,
    "hasMore": true
  }
}
```

## Error response example

401 — no authorization key:

```json
{
  "success": false,
  "error": {
    "code": "MISSING_API_KEY",
    "message": "API key required. Pass via X-Api-Key header."
  }
}
```

## Errors

| HTTP | Code | Description |
|------|-----|---------|
| 400 | `INVALID_INCLUDE` | An unknown name was passed in `include`. The message lists the available ones: `Unknown include 'bad'. Available: owner` |
| 401 | `MISSING_API_KEY` | The `X-Api-Key` header is missing |
| 401 | `INVALID_API_KEY` | The key is not recognized — no such key exists on the platform |
| 403 | `SCOPE_DENIED` | The key is missing the `sonet_group` scope |
| 403 | `SCOPE_DENIED` | `include=owner` was passed, but the key lacks the `user` scope |
| 429 | `RATE_LIMITED` | Rate limit exceeded: 300 requests per minute per portal. All API keys of the portal share one limit. The exact limit is returned in the `x-ratelimit-limit` header. Retry after the delay in the `Retry-After` header |

For the full list of common API errors, see [Errors](/docs/errors).

## Known specifics

**Boolean fields in the filter accept `Y` / `N`.** In the response, the same fields come back as `true` / `false`, but when filtering use `filter[active]=Y` / `filter[archived]=N`. The values `true` / `false` in the filter will not produce matches and will not raise an error.

**A `%` prefix in the field name enables substring search.** `?filter[%name]=Marketing` will find all groups whose name contains "Marketing". Without the prefix the filter requires an exact match.

**`limit = 0` is not a page size** — the parameter is dropped, the default page size (50) applies, and the response carries a `LIMIT_ZERO_IGNORED` warning in `meta.warnings`. To read the whole collection, pass an explicit `limit` (up to 5000). For an empty selection, use a filter that is guaranteed to find nothing.

## See also

- [Workgroup fields](./fields.md)
- [Filtering syntax](/docs/filtering)
- [Entity API](/docs/entity-api)
- [Batch](/docs/batch)
- [Limits and optimization](/docs/optimization)
