# humanresources.employee.subordinates

URL: https://chugunov.pro/api-bitrix24/departments/employee/humanresources-employee-subordinates/
Проверено на Битрикс24 REST API, обновлено 11.09.2026 (ревизия источника fb39d6c).
Источник: официальная документация Битрикс24 (bitrix-tools/b24-rest-docs, лицензия MIT, © Bitrix). Справочник независимый, официальной документацией не является.

Получить подчиненных сотрудника
Scope: `humanresources`
Кто может выполнять метод: авторизованный пользователь, привязанный к отделу в структуре компании

## Описание

Метод относится к REST 3.0. Особенности вызова и формат ответа новой версии API описаны в [обзоре REST 3.0](https://chugunov.pro/api-bitrix24/rest-v3/).

Метод `humanresources.employee.subordinates` возвращает количество подчиненных пользователя по отделам.

## Параметры

- `id` `integer` — обязательный. Идентификатор пользователя, для которого нужно получить подчиненных.
  Идентификатор можно получить методом [user.get](https://chugunov.pro/api-bitrix24/user/user-get/)

## Ответ

HTTP-статус: 200

```json
{
    "result": {
        "userId": 7,
        "departments": [
            {
                "nodeId": 15,
                "name": "Отдел продаж",
                "role": "HEAD",
                "subordinatesCount": 12
            },
            {
                "nodeId": 22,
                "name": "Отдел развития",
                "role": "HEAD",
                "subordinatesCount": 5
            },
            {
                "nodeId": 31,
                "name": "Отдел поддержки",
                "role": "HEAD",
                "subordinatesCount": 3
            }
        ]
    },
    "time": {
        "start": 1780407500,
        "finish": 1780407500.128491,
        "duration": 0.12849116325378418,
        "processing": 0.09751296043395996,
        "date_start": "2026-06-02T16:38:20+03:00",
        "date_finish": "2026-06-02T16:38:20+03:00",
        "operating_reset_at": 1780408100,
        "operating": 0
    }
}
```

### Возвращаемые данные

- `result` `object`. Объект с данными ответа
- `userId` `integer`. Идентификатор пользователя из запроса
- `departments[]` `array`. Массив отделов с количеством подчиненных пользователя
- `departments[].nodeId` `integer`. Идентификатор отдела
- `departments[].name` `string`. Название отдела
- `departments[].role` `string`. Роль пользователя в отделе
- `departments[].subordinatesCount` `integer`. Количество подчиненных пользователя в отделе
- `time` `time`. Информация о времени выполнения запроса

## Ошибки

HTTP-статус: 400

```json
{
    "error": {
        "code": "BITRIX_REST_V3_EXCEPTION_VALIDATION_REQUESTVALIDATIONEXCEPTION",
        "message": "Ошибка при валидации объекта запроса",
        "validation": [
            {
                "message": "Parameter \"id\" is required and must be a positive integer.",
                "field": "id"
            }
        ]
    }
}
```

- `Поле` — **Описание ошибки**. **Как исправить**
- `id` — Обязательное поле `id` не указано. Передайте идентификатор пользователя
- `id` — Parameter `"id"` is required and must be a positive integer. Передайте положительный идентификатор пользователя

## Примеры запроса

### cURL (Webhook)

```bash
curl -X POST \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-d '{"id":7}' \
https://**put_your_bitrix24_address**/rest/api/**put_your_user_id_here**/**put_your_webhook_here**/humanresources.employee.subordinates
```

### cURL (OAuth)

```bash
curl -X POST \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-d '{"id":7,"auth":"**put_access_token_here**"}' \
https://**put_your_bitrix24_address**/rest/api/humanresources.employee.subordinates
```

### JS (TS)

```ts
// This snippet is an ES module: top-level await requires type="module" or a bundler.
// $b24 is an already-initialized SDK instance (see the SDK "Get started" guide).
import { Text } from '@bitrix24/b24jssdk'
import type { B24Frame } from '@bitrix24/b24jssdk'

declare const $b24: B24Frame

// Shape of the payload returned in result (match the "response handling" section of the page)
type SubordinatesResult = {
  userId: number
  departments: Array<{
    nodeId: number
    name: string
    role: string
    subordinatesCount: number
  }>
}

try {
  const response = await $b24.actions.v3.call.make<SubordinatesResult>({
    method: 'humanresources.employee.subordinates',
    params: {
      id: 7,
    },
    requestId: Text.getUuidRfc4122()
  })

  // The payload is available only on a successful response
  if (!response.isSuccess) {
    console.error(response.getErrorMessages().join('; '))
  } else {
    const result = response.getData()!.result
    console.info(result.userId, result.departments)
  }
} catch (error) {
  // Thrown on transport or SDK failures (AjaxError, SdkError, etc.)
  console.error(error)
}
```

### JS (UMD)

```html
<!-- Load the SDK (UMD build); it is exposed as the global B24Js -->
<script src="https://unpkg.com/@bitrix24/b24jssdk@1/dist/umd/index.min.js"></script>
<script>
  async function getEmployeeSubordinates() {
    try {
      // Initialize the SDK inside a Bitrix24 frame
      const $b24 = await B24Js.initializeB24Frame()

      const response = await $b24.actions.v3.call.make({
        method: 'humanresources.employee.subordinates',
        params: {
          id: 7,
        },
        requestId: B24Js.Text.getUuidRfc4122()
      })

      // The payload is available only on a successful response
      if (!response.isSuccess) {
        console.error(response.getErrorMessages().join('; '))
        return
      }

      const result = response.getData().result
      console.info(result.userId, result.departments)
    } catch (error) {
      // Thrown on transport or SDK failures (AjaxError, SdkError, etc.)
      console.error(error)
    }
  }

  document.addEventListener('DOMContentLoaded', getEmployeeSubordinates)
</script>
```

### Python

```python
from b24pysdk.errors import BitrixAPIError, BitrixSDKException

try:
    bitrix_response = client.humanresources.employee.subordinates(
        bitrix_id=7,
    ).response
    result = bitrix_response.result
    print(result)
except BitrixAPIError as error:
    print(
        "Ошибка Bitrix API",
        f"error: {error.error}",
        f"error_description: {error.error_description}",
        sep="\n",
    )
except BitrixSDKException as error:
    print(f"Ошибка Bitrix SDK: {error.message}")
except Exception as error:
    print(f"Непредвиденная ошибка: {error}")
```

### PHP

```php
try {
    $response = $b24Service
        ->core
        ->call(
            'humanresources.employee.subordinates',
            [
                'id' => 7,
            ]
        );

    $result = $response
        ->getResponseData()
        ->getResult();

    echo 'Success: ' . print_r($result, true);

} catch (Throwable $e) {
    error_log($e->getMessage());
    echo 'Error: ' . $e->getMessage();
}
```

### BX24.js

```js
BX24.callMethod(
    'humanresources.employee.subordinates',
    {
        id: 7
    },
    function(result){
        console.info(result.data());
        console.log(result);
    }
);
```

### PHP CRest

```php
require_once('crest.php');

$result = CRest::call(
    'humanresources.employee.subordinates',
    [
        'id' => 7,
    ]
);

echo '<PRE>';
print_r($result);
echo '</PRE>';
```

### Go

```go
// client и ctx уже созданы — см. раздел «SDK для Go»
res, err := client.Core().Call(ctx, "humanresources.employee.subordinates", b24.Params{
	"id": 7,
})
if err != nil {
	return fmt.Errorf("humanresources.employee.subordinates: %w", err)
}

var item struct {
	UserID b24.ID `json:"userId"`
}
if err := json.Unmarshal(res.Result, &item); err != nil {
	return fmt.Errorf("разбор ответа: %w", err)
}
fmt.Println(item.UserID)
```

Оригинал в официальной документации: https://apidocs.bitrix24.ru/api-reference/departments/employee/humanresources-employee-subordinates.html
