
## List nodes

`GET /v1/humanresources/nodes`

Returns a list of a Bitrix24 account's org structure nodes of a single type — departments or teams — with pagination.

## Parameters

| Parameter | Type | Required | Description |
|----------|-----|:-----:|---------|
| `type` (query) | string | yes | Type of nodes to return: `DEPARTMENT` or `TEAM`. If omitted, the request returns `400 MISSING_REQUIRED_PARAMS` |
| `limit` (query) | number | no | Number of records per page |
| `offset` (query) | number | no | Offset from the start of the result set, for pagination |

If more records of the chosen type exist than fit in `limit`, `meta.hasMore` is `true`. To get the next page, repeat the request with an increased `offset` (`offset = offset + limit`) until `hasMore` becomes `false`. The response carries no total count — this list has no `meta.total` field, so rely on `meta.hasMore`.

## Examples

### curl — personal key

```bash
curl "https://vibecode.bitrix24.com/v1/humanresources/nodes?type=DEPARTMENT" \
  -H "X-Api-Key: YOUR_API_KEY"
```

### curl — OAuth application

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

const { success, data, meta } = await res.json()
console.log(`Departments on this page: ${data.length}, has more: ${meta.hasMore}`)
```

### JavaScript — OAuth application

```javascript
const res = await fetch('https://vibecode.bitrix24.com/v1/humanresources/nodes?type=DEPARTMENT', {
  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 nodes |
| `data[].id` | number | Node identifier |
| `data[].name` | string | Node name |
| `data[].type` | string | Node type: `DEPARTMENT` or `TEAM` |
| `data[].structureId` | number | Identifier of the structure the node belongs to |
| `data[].parentId` | number | Parent node identifier. For the root node it equals `0` |
| `data[].description` | string \| null | Node description. `null` if no description is set |
| `data[].accessCode` | string | Node access code, for example `D185` or `SN23`. The prefix is not determined by the node type, and the numeric part may differ from `id` — take the value from the response |
| `data[].userCount` | number | Number of employees in the node |
| `data[].colorName` | string \| null | Node color name. `null` if no color is set |
| `data[].xmlId` | string \| null | External identifier of the node. `null` if not set |
| `data[].createdAt` | string \| null | Creation date (ISO 8601). `null` for nodes created without a timestamp |
| `data[].updatedAt` | string \| null | Last update date (ISO 8601). `null` if there were no changes |
| `meta.hasMore` | boolean | Whether there are more records beyond `limit` |

## Response example

```json
{
  "success": true,
  "data": [
    {
      "id": 17,
      "name": "Head office",
      "type": "DEPARTMENT",
      "structureId": 1,
      "parentId": 0,
      "description": null,
      "accessCode": "D185",
      "userCount": 0,
      "colorName": null,
      "xmlId": null,
      "createdAt": null,
      "updatedAt": null
    },
    {
      "id": 23,
      "name": "Sales department",
      "type": "DEPARTMENT",
      "structureId": 1,
      "parentId": 17,
      "description": "Direct sales",
      "accessCode": "SN23",
      "userCount": 2,
      "colorName": null,
      "xmlId": null,
      "createdAt": null,
      "updatedAt": null
    }
  ],
  "meta": {
    "hasMore": false
  }
}
```

## Error response example

400 — required parameter `type` not provided:

```json
{
  "success": false,
  "error": {
    "code": "MISSING_REQUIRED_PARAMS",
    "message": "GET /v1/humanresources/nodes requires query parameters: type. Example: GET /v1/humanresources/nodes?type=..."
  }
}
```

## Errors

| HTTP | Code | Description |
|------|-----|---------|
| 400 | `MISSING_REQUIRED_PARAMS` | Required parameter `type` not provided |
| 400 | `UNSUPPORTED_FILTER` | A filter by a node field other than `type` was passed — listing is supported only by `type` |
| 400 | `INVALID_SORT_FIELD` | `sort` or `order` was passed — nodes are returned in a fixed order; sorting is not supported |
| 403 | `SCOPE_DENIED` | The key lacks the `humanresources` scope |
| 401 | `TOKEN_MISSING` | The API key has no Bitrix24 tokens configured |

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

## Known specifics

**Listing only by type.** The results cannot be narrowed by an arbitrary node field. A request with `filter[name]` or `filter[parentId]` returns `400 UNSUPPORTED_FILTER` before reaching Bitrix24, and the message names `type` as the only accepted key. The only way to limit the output is to specify `type` and page through with `limit` and `offset`. To find nodes by a substring of the name, optionally narrowed to a subtree with `parentId`, use [Search nodes](/docs/humanresources/nodes/search).

## See also

- [Get node](/docs/humanresources/nodes/get)
- [Search nodes](/docs/humanresources/nodes/search)
- [Create node](/docs/humanresources/nodes/create)
- [Org structure nodes](/docs/humanresources/nodes)
