
## Node count

`GET /v1/humanresources/nodes/count`

Returns the number of organizational structure nodes in the Bitrix24 account by type — the number of departments and the number of teams. No parameters are needed; the count covers the entire structure.

## Parameters

No parameters. No request body is sent.

## Examples

### curl — personal key

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

### curl — OAuth application

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

const { success, data } = await res.json()
console.log(`Departments: ${data.departments}, teams: ${data.teams}`)
```

### JavaScript — OAuth application

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

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

## Response fields

| Field | Type | Description |
|------|-----|---------|
| `success` | boolean | Always `true` on success |
| `data.departments` | number | Number of `DEPARTMENT` nodes (departments) |
| `data.teams` | number | Number of `TEAM` nodes (teams) |

## Response example

```json
{
  "success": true,
  "data": {
    "departments": 13,
    "teams": 0
  }
}
```

## Error response example

403 — the key does not have the `humanresources` scope:

```json
{
  "success": false,
  "error": {
    "code": "SCOPE_DENIED",
    "message": "This endpoint requires 'humanresources' scope"
  }
}
```

## Errors

| HTTP | Code | Description |
|------|-----|---------|
| 403 | `SCOPE_DENIED` | The key is missing the `humanresources` scope |
| 401 | `TOKEN_MISSING` | The API key has no Bitrix24 tokens configured |

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

## Known specifics

**Both node types come in a single call.** The response contains both `departments` and `teams` at once — a separate request per type is not needed. This distinguishes the count from listing nodes via `GET /v1/humanresources/nodes`, where the type is set by the `type` parameter and a single call returns nodes of only one type.

## See also

- [Child nodes](/docs/humanresources/node-operations/children)
- [Move node](/docs/humanresources/node-operations/move)
- [Organizational structure nodes](/docs/humanresources/nodes)
- [Node operations](/docs/humanresources/node-operations)
