# Employee

::: info
Каждый ответ приходит в общем конверте — `code`, `message`, `messages`, `status_code`, `time` — а полезная нагрузка лежит в `data`. Таблицы ниже описывают содержимое `data`.
:::

## POST /employee/create

This method allows adding employee into the account.

**Нужное разрешение:** `employee_create` · [как работают разрешения](https://docs.bito.uz/ru/api/permissions.md)

**Пример запроса**

::: code-group

```bash [curl]
curl -X POST 'https://api.bito.uz/integration-api/integration/api/v2/employee/create' \
  -H "api-key: $BITO_API_KEY" \
  -H 'Content-Type: application/json' \
  -d '{
  "full_name": "string",
  "phone_number": "string",
  "accesses": [
    {
      "organization_id": "67b486d242ed76693cd2cc59",
      "positions": [],
      "role_id": "string"
    }
  ]
}'
```

```js [JavaScript]
const res = await fetch('https://api.bito.uz/integration-api/integration/api/v2/employee/create', {
  method: 'POST',
  headers: { 'api-key': process.env.BITO_API_KEY, 'Content-Type': 'application/json' },
  body: JSON.stringify({
    "full_name": "string",
    "phone_number": "string",
    "accesses": [
      {
        "organization_id": "67b486d242ed76693cd2cc59",
        "positions": [],
        "role_id": "string"
      }
    ]
  }),
})
const { code, data } = await res.json()
```

```python [Python]
import os
import requests

res = requests.request(
    "POST",
    "https://api.bito.uz/integration-api/integration/api/v2/employee/create",
    headers={"api-key": os.environ["BITO_API_KEY"]},
    json={
        "full_name": "string",
        "phone_number": "string",
        "accesses": [
            {
                "organization_id": "67b486d242ed76693cd2cc59",
                "positions": [],
                "role_id": "string",
            },
        ],
    },
)
print(res.json())
```

```php [PHP]
<?php
$body = <<<'JSON'
{
  "full_name": "string",
  "phone_number": "string",
  "accesses": [
    {
      "organization_id": "67b486d242ed76693cd2cc59",
      "positions": [],
      "role_id": "string"
    }
  ]
}
JSON;

$ch = curl_init('https://api.bito.uz/integration-api/integration/api/v2/employee/create');
curl_setopt_array($ch, [
    CURLOPT_CUSTOMREQUEST => 'POST',
    CURLOPT_HTTPHEADER => ['api-key: ' . getenv('BITO_API_KEY'), 'Content-Type: application/json'],
    CURLOPT_POSTFIELDS => $body,
    CURLOPT_RETURNTRANSFER => true,
]);
$response = json_decode(curl_exec($ch), true);
```

:::

**Тело запроса**

| Поле | Тип | Обязательно | Описание |
|---|---|---|---|
| `full_name` | `string` | Да |  |
| `inn` | `string` | Нет |  |
| `phone_number` | `string` | Да |  |
| `jshir` | `string` | Нет |  |
| `address` | `string` | Нет |  |
| `passport_number` | `string` | Нет |  |
| `passport_issued_date` | `string` | Нет |  |
| `passport_issued_by` | `string` | Нет |  |
| `acceptance_date` | `string` | Нет |  |
| `work_rate` | `number` | Нет | По умолчанию: `0` |
| `testing_end_time` | `string` | Нет |  |
| `contract_end_time` | `string` | Нет | По умолчанию: `false` |
| `holidays` | `number` | Нет | По умолчанию: `0` |
| `comment` | `string` | Нет |  |
| `pincode` | `string` | Нет | Required unless `is_free` is true. |
| `password` | `string` | Нет | Required unless `is_free` is true. |
| `is_free` | `boolean` | Нет | По умолчанию: `false` |
| `accesses` | `object[]` | Да |  |
| `accesses[].organization_id` | `string` | Да |  |
| `accesses[].positions` | `object[]` | Нет |  |
| `accesses[].positions[].position_id` | `string` | Да |  |
| `accesses[].positions[].section_id` | `string` | Да |  |
| `accesses[].role_id` | `string` | Нет |  |
| `person_id` | `string` | Нет | person id of employee |
| `gender` | `string` | Нет | Допустимые значения: `male`, `female` |
| `image` | `string` | Нет | image path of employee that uploaded to the server |
| `last_name` | `string` | Нет |  |
| `middle_name` | `string` | Нет |  |
| `birth_date` | `string` | Нет | date of birth of employee |
| `legal_person_id` | `string` | Нет | id of legal person |
| `telegram_link` | `string` | Нет | link of telegram account |
| `email` | `string` | Нет | email of employee |
| `is_supplier` | `boolean` | Нет | is supplier or not. По умолчанию: `false` |
| `is_customer` | `boolean` | Нет | is customer or not. По умолчанию: `false` |
| `status` | `string` | Нет | status of employee. Допустимые значения: `active`, `inactive` |
| `short_name` | `string` | Нет | short name of employee |
| `code` | `string` | Нет | code of employee |
| `postal_code` | `string` | Нет | postal code of employee |
| `owner_id` | `string` | Нет | id of owner |
| `manager_id` | `string` | Нет | id of manager |
| `delivery_address` | `object` | Нет | delivery address of employee |
| `delivery_address.lat` | `number` | Нет | По умолчанию: `0` |
| `delivery_address.long` | `number` | Нет | По умолчанию: `0` |
| `delivery_address.human_address` | `object` | Нет |  |
| `delivery_address.human_address.address` | `string` | Нет |  |
| `delivery_address.human_address.city` | `string` | Нет |  |
| `delivery_address.human_address.state` | `string` | Нет |  |
| `delivery_address.human_address.zip` | `string` | Нет |  |
| `delivery_address.bearing` | `number` | Нет |  |
| `web_site` | `string` | Нет |  |

```json
{
  "full_name": "string",
  "inn": "string",
  "phone_number": "string",
  "jshir": "string",
  "address": "string",
  "passport_number": "string",
  "passport_issued_date": "string",
  "passport_issued_by": "string",
  "acceptance_date": "string",
  "work_rate": 0,
  "testing_end_time": "string",
  "contract_end_time": false,
  "holidays": 0,
  "comment": "string",
  "pincode": "string",
  "password": "string",
  "is_free": false,
  "accesses": [
    {
      "organization_id": "67b486d242ed76693cd2cc59",
      "positions": [],
      "role_id": "string"
    }
  ],
  "person_id": "string",
  "gender": "male",
  "image": "string",
  "last_name": "string",
  "middle_name": "string",
  "birth_date": "string",
  "legal_person_id": "string",
  "telegram_link": "string",
  "email": "string",
  "is_supplier": false,
  "is_customer": false,
  "status": "active",
  "short_name": "string",
  "code": "string",
  "postal_code": "string",
  "owner_id": "67b486d242ed76693cd2cc59",
  "manager_id": "67b486d242ed76693cd2cc59",
  "delivery_address": {
    "lat": 0,
    "long": 0,
    "human_address": {
      "address": "string",
      "city": "string",
      "state": "string",
      "zip": "string"
    },
    "bearing": 0
  },
  "web_site": "string"
}
```

**Ответ**

| Поле | Тип | Описание |
|---|---|---|
| `_id` | `string` | id of employee |
| `full_name` | `string` |  |
| `inn` | `string` |  |
| `phone_number` | `string` |  |
| `jshir` | `string` |  |
| `passport_number` | `string` |  |
| `passport_issued_date` | `string` |  |
| `passport_issued_by` | `string` |  |
| `acceptance_date` | `string` |  |
| `work_rate` | `number` | По умолчанию: `0` |
| `testing_end_time` | `string` |  |
| `contract_end_time` | `string` | По умолчанию: `false` |
| `holidays` | `number` | По умолчанию: `0` |
| `comment` | `string` |  |
| `is_free` | `boolean` | По умолчанию: `false` |
| `address` | `string` | address of employee |
| `gender` | `string` | Допустимые значения: `male`, `female` |
| `image` | `string` | image path of employee that uploaded to the server |
| `last_name` | `string` |  |
| `middle_name` | `string` |  |
| `birth_date` | `string` | date of birth of employee |
| `legal_person_id` | `string` | id of legal person |
| `telegram_link` | `string` | link of telegram account |
| `email` | `string` | email of employee |
| `is_supplier` | `boolean` | is supplier or not. По умолчанию: `false` |
| `status` | `string` | status of employee. Допустимые значения: `active`, `inactive` |
| `short_name` | `string` | short name of employee |
| `web-site` | `string` | web-site of employee |
| `code` | `string` | code of employee |
| `postal_code` | `string` | postal code of employee |
| `delivery_address` | `object` | delivery address of employee |
| `delivery_address.lat` | `number` | По умолчанию: `0` |
| `delivery_address.long` | `number` | По умолчанию: `0` |
| `delivery_address.human_address` | `object` |  |
| `delivery_address.human_address.address` | `string` |  |
| `delivery_address.human_address.city` | `string` |  |
| `delivery_address.human_address.state` | `string` |  |
| `delivery_address.human_address.zip` | `string` |  |
| `number` | `string` | number of employee |
| `balance_action` | `string` | action of balance |
| `is_boss` | `boolean` | is boss or not. По умолчанию: `false` |
| `employment_type` | `string` |  |
| `salary` | `object` |  |
| `salary.is_active` | `boolean` |  |
| `salary.employee_id` | `string` |  |
| `salary.organization_id` | `string` |  |
| `salary.type` | `string` | Допустимые значения: `fixed`, `task_by` |
| `salary.amount` | `number` | По умолчанию: `0` |
| `salary.currency_id` | `string` | id of currency |
| `salary.unit` | `string` | Допустимые значения: `hour`, `day` |
| `salary_currency_id` | `string` | id of currency |
| `boss_id` | `string` | id of boss |
| `balance` | `object` |  |
| `balance.organization_id` | `string` |  |
| `balance.payment_method_id` | `string` |  |
| `balance.currency_id` | `string` |  |
| `balance.amount` | `number` | По умолчанию: `0` |
| `balance_currency_id` | `string` | id of currency |
| `balance_list` | `object[]` |  |
| `balance_list[]._id` | `string` |  |
| `balance_list[].amount` | `number` | По умолчанию: `0` |
| `balance_list[].organization_id` | `string` |  |
| `balance_list[].payment_method_id` | `string` |  |
| `balance_list[].currency_id` | `string` |  |
| `positions` | `object[]` |  |
| `positions[].organization_id` | `string` |  |
| `positions[].section` | `object` |  |
| `positions[].section._id` | `string` |  |
| `positions[].section.is_deleted` | `boolean` |  |
| `positions[].section.completely_deleted` | `boolean` |  |
| `positions[].section.name` | `string` |  |
| `positions[].position` | `object` |  |
| `positions[].position._id` | `string` |  |
| `positions[].position.is_deleted` | `boolean` |  |
| `positions[].position.completely_deleted` | `boolean` |  |
| `positions[].position.name` | `string` |  |
| `positions[].role` | `object` |  |
| `positions[].role._id` | `string` |  |
| `positions[].role.is_deleted` | `boolean` |  |
| `positions[].role.completely_deleted` | `boolean` |  |
| `positions[].role.name` | `string` |  |
| `positions[].role.web` | `boolean` |  |
| `positions[].role.mobile` | `boolean` |  |
| `positions[].role_id` | `string` |  |
| `is_deleted` | `boolean` | По умолчанию: `false` |
| `completely_deleted` | `boolean` | По умолчанию: `false` |
| `created_at` | `string` | date of creation |
| `updated_at` | `string` | date of update |
| `person` | `object` |  |
| `person._id` | `string` | id of person |
| `person.name` | `string` | name of person |
| `person.full_name` | `string` | last name of person |

```json
{
  "code": 0,
  "message": "Success",
  "status_code": 200,
  "data": {
    "_id": "67b486d242ed76693cd2cc59",
    "full_name": "string",
    "inn": "string",
    "phone_number": "string",
    "jshir": "string",
    "passport_number": "string",
    "passport_issued_date": "string",
    "passport_issued_by": "string",
    "acceptance_date": "string",
    "work_rate": 0,
    "testing_end_time": "string",
    "contract_end_time": false,
    "holidays": 0,
    "comment": "string",
    "is_free": false,
    "address": "string",
    "gender": "male",
    "image": "string",
    "last_name": "string",
    "middle_name": "string",
    "birth_date": "string",
    "legal_person_id": "string",
    "telegram_link": "string",
    "email": "string",
    "is_supplier": false,
    "status": "active",
    "short_name": "string",
    "web-site": "string",
    "code": "string",
    "postal_code": "string",
    "delivery_address": {
      "lat": 0,
      "long": 0,
      "human_address": {
        "address": "string",
        "city": "string",
        "state": "string",
        "zip": "string"
      }
    },
    "number": "string",
    "balance_action": "string",
    "is_boss": false,
    "employment_type": "string",
    "salary": {
      "is_active": false,
      "employee_id": "string",
      "organization_id": "string",
      "type": "fixed",
      "amount": 0,
      "currency_id": "string",
      "unit": "hour"
    },
    "salary_currency_id": "string",
    "boss_id": "string",
    "balance": {
      "organization_id": "string",
      "payment_method_id": "string",
      "currency_id": "string",
      "amount": 0
    },
    "balance_currency_id": "string",
    "balance_list": [
      {
        "_id": "string",
        "amount": 0,
        "organization_id": "string",
        "payment_method_id": "string",
        "currency_id": "string"
      }
    ],
    "positions": [
      {
        "organization_id": "string",
        "section": {
          "_id": null,
          "is_deleted": null,
          "completely_deleted": null,
          "name": null
        },
        "position": {
          "_id": null,
          "is_deleted": null,
          "completely_deleted": null,
          "name": null
        },
        "role": {
          "_id": null,
          "is_deleted": null,
          "completely_deleted": null,
          "name": null,
          "web": null,
          "mobile": null
        },
        "role_id": "string"
      }
    ],
    "is_deleted": false,
    "completely_deleted": false,
    "created_at": "string",
    "updated_at": "string",
    "person": {
      "_id": "string",
      "name": "string",
      "full_name": "string"
    }
  },
  "time": "2025-05-01T12:00:00Z"
}
```

## PUT /employee/update

This method allows updating employee in the account.

**Нужное разрешение:** `employee_update` · [как работают разрешения](https://docs.bito.uz/ru/api/permissions.md)

**Пример запроса**

::: code-group

```bash [curl]
curl -X PUT 'https://api.bito.uz/integration-api/integration/api/v2/employee/update' \
  -H "api-key: $BITO_API_KEY" \
  -H 'Content-Type: application/json' \
  -d '{
  "_id": "67b486d242ed76693cd2cc59",
  "full_name": "string",
  "phone_number": "string",
  "accesses": [
    {
      "organization_id": "67b486d242ed76693cd2cc59",
      "positions": [],
      "role_id": "string"
    }
  ]
}'
```

```js [JavaScript]
const res = await fetch('https://api.bito.uz/integration-api/integration/api/v2/employee/update', {
  method: 'PUT',
  headers: { 'api-key': process.env.BITO_API_KEY, 'Content-Type': 'application/json' },
  body: JSON.stringify({
    "_id": "67b486d242ed76693cd2cc59",
    "full_name": "string",
    "phone_number": "string",
    "accesses": [
      {
        "organization_id": "67b486d242ed76693cd2cc59",
        "positions": [],
        "role_id": "string"
      }
    ]
  }),
})
const { code, data } = await res.json()
```

```python [Python]
import os
import requests

res = requests.request(
    "PUT",
    "https://api.bito.uz/integration-api/integration/api/v2/employee/update",
    headers={"api-key": os.environ["BITO_API_KEY"]},
    json={
        "_id": "67b486d242ed76693cd2cc59",
        "full_name": "string",
        "phone_number": "string",
        "accesses": [
            {
                "organization_id": "67b486d242ed76693cd2cc59",
                "positions": [],
                "role_id": "string",
            },
        ],
    },
)
print(res.json())
```

```php [PHP]
<?php
$body = <<<'JSON'
{
  "_id": "67b486d242ed76693cd2cc59",
  "full_name": "string",
  "phone_number": "string",
  "accesses": [
    {
      "organization_id": "67b486d242ed76693cd2cc59",
      "positions": [],
      "role_id": "string"
    }
  ]
}
JSON;

$ch = curl_init('https://api.bito.uz/integration-api/integration/api/v2/employee/update');
curl_setopt_array($ch, [
    CURLOPT_CUSTOMREQUEST => 'PUT',
    CURLOPT_HTTPHEADER => ['api-key: ' . getenv('BITO_API_KEY'), 'Content-Type: application/json'],
    CURLOPT_POSTFIELDS => $body,
    CURLOPT_RETURNTRANSFER => true,
]);
$response = json_decode(curl_exec($ch), true);
```

:::

**Тело запроса**

| Поле | Тип | Обязательно | Описание |
|---|---|---|---|
| `_id` | `string` | Да |  |
| `full_name` | `string` | Да |  |
| `inn` | `string` | Нет |  |
| `phone_number` | `string` | Да |  |
| `jshir` | `string` | Нет |  |
| `address` | `string` | Нет |  |
| `passport_number` | `string` | Нет |  |
| `passport_issued_date` | `string` | Нет |  |
| `passport_issued_by` | `string` | Нет |  |
| `acceptance_date` | `string` | Нет |  |
| `work_rate` | `number` | Нет | По умолчанию: `0` |
| `testing_end_time` | `string` | Нет |  |
| `contract_end_time` | `string` | Нет | По умолчанию: `false` |
| `holidays` | `number` | Нет | По умолчанию: `0` |
| `comment` | `string` | Нет |  |
| `is_free` | `boolean` | Нет | По умолчанию: `false` |
| `accesses` | `object[]` | Да |  |
| `accesses[].organization_id` | `string` | Да |  |
| `accesses[].positions` | `object[]` | Нет |  |
| `accesses[].positions[].position_id` | `string` | Да |  |
| `accesses[].positions[].section_id` | `string` | Да |  |
| `accesses[].role_id` | `string` | Нет |  |
| `person_id` | `string` | Нет | person id of employee |
| `gender` | `string` | Нет | Допустимые значения: `male`, `female` |
| `image` | `string` | Нет | image path of employee that uploaded to the server |
| `last_name` | `string` | Нет |  |
| `middle_name` | `string` | Нет |  |
| `birth_date` | `string` | Нет | date of birth of employee |
| `legal_person_id` | `string` | Нет | id of legal person |
| `telegram_link` | `string` | Нет | link of telegram account |
| `email` | `string` | Нет | email of employee |
| `status` | `string` | Нет | status of employee. Допустимые значения: `active`, `inactive` |
| `short_name` | `string` | Нет | short name of employee |
| `code` | `string` | Нет | code of employee |
| `postal_code` | `string` | Нет | postal code of employee |
| `owner_id` | `string` | Нет | id of owner |
| `manager_id` | `string` | Нет | id of manager |
| `delivery_address` | `object` | Нет | delivery address of employee |
| `delivery_address.lat` | `number` | Нет | По умолчанию: `0` |
| `delivery_address.long` | `number` | Нет | По умолчанию: `0` |
| `delivery_address.human_address` | `object` | Нет |  |
| `delivery_address.human_address.address` | `string` | Нет |  |
| `delivery_address.human_address.city` | `string` | Нет |  |
| `delivery_address.human_address.state` | `string` | Нет |  |
| `delivery_address.human_address.zip` | `string` | Нет |  |
| `delivery_address.bearing` | `number` | Нет |  |
| `web_site` | `string` | Нет |  |

```json
{
  "_id": "67b486d242ed76693cd2cc59",
  "full_name": "string",
  "inn": "string",
  "phone_number": "string",
  "jshir": "string",
  "address": "string",
  "passport_number": "string",
  "passport_issued_date": "string",
  "passport_issued_by": "string",
  "acceptance_date": "string",
  "work_rate": 0,
  "testing_end_time": "string",
  "contract_end_time": false,
  "holidays": 0,
  "comment": "string",
  "is_free": false,
  "accesses": [
    {
      "organization_id": "67b486d242ed76693cd2cc59",
      "positions": [],
      "role_id": "string"
    }
  ],
  "person_id": "string",
  "gender": "male",
  "image": "string",
  "last_name": "string",
  "middle_name": "string",
  "birth_date": "string",
  "legal_person_id": "string",
  "telegram_link": "string",
  "email": "string",
  "status": "active",
  "short_name": "string",
  "code": "string",
  "postal_code": "string",
  "owner_id": "67b486d242ed76693cd2cc59",
  "manager_id": "67b486d242ed76693cd2cc59",
  "delivery_address": {
    "lat": 0,
    "long": 0,
    "human_address": {
      "address": "string",
      "city": "string",
      "state": "string",
      "zip": "string"
    },
    "bearing": 0
  },
  "web_site": "string"
}
```

**Ответ**

Структура ответа совпадает с [POST /employee/create](#post-employee-create).

## DELETE /employee/delete/{id}

Delete a employee

**Нужное разрешение:** `employee_delete` · [как работают разрешения](https://docs.bito.uz/ru/api/permissions.md)

**Пример запроса**

::: code-group

```bash [curl]
curl -X DELETE 'https://api.bito.uz/integration-api/integration/api/v2/employee/delete/6712f0a9c4d1e87b3a0f9911' \
  -H "api-key: $BITO_API_KEY"
```

```js [JavaScript]
const res = await fetch('https://api.bito.uz/integration-api/integration/api/v2/employee/delete/6712f0a9c4d1e87b3a0f9911', {
  method: 'DELETE',
  headers: { 'api-key': process.env.BITO_API_KEY },
})
const { code, data } = await res.json()
```

```python [Python]
import os
import requests

res = requests.request(
    "DELETE",
    "https://api.bito.uz/integration-api/integration/api/v2/employee/delete/6712f0a9c4d1e87b3a0f9911",
    headers={"api-key": os.environ["BITO_API_KEY"]},
)
print(res.json())
```

```php [PHP]
<?php
$ch = curl_init('https://api.bito.uz/integration-api/integration/api/v2/employee/delete/6712f0a9c4d1e87b3a0f9911');
curl_setopt_array($ch, [
    CURLOPT_CUSTOMREQUEST => 'DELETE',
    CURLOPT_HTTPHEADER => ['api-key: ' . getenv('BITO_API_KEY')],
    CURLOPT_RETURNTRANSFER => true,
]);
$response = json_decode(curl_exec($ch), true);
```

:::

**Параметры пути**

| Параметр | Тип | Обязательно | Описание |
|---|---|---|---|
| `id` | `string` | Да |  |

**Тело запроса**

Тело запроса не требуется.

**Ответ**

```json
{
  "code": 0,
  "message": "Success",
  "status_code": 200,
  "data": "ok",
  "time": "2025-05-01T12:00:00Z"
}
```

## GET /employee/get-by-id/{id}

Get employee using its _id

**Нужное разрешение:** `employee` · [как работают разрешения](https://docs.bito.uz/ru/api/permissions.md)

**Пример запроса**

::: code-group

```bash [curl]
curl -X GET 'https://api.bito.uz/integration-api/integration/api/v2/employee/get-by-id/6712f0a9c4d1e87b3a0f9911' \
  -H "api-key: $BITO_API_KEY"
```

```js [JavaScript]
const res = await fetch('https://api.bito.uz/integration-api/integration/api/v2/employee/get-by-id/6712f0a9c4d1e87b3a0f9911', {
  method: 'GET',
  headers: { 'api-key': process.env.BITO_API_KEY },
})
const { code, data } = await res.json()
```

```python [Python]
import os
import requests

res = requests.request(
    "GET",
    "https://api.bito.uz/integration-api/integration/api/v2/employee/get-by-id/6712f0a9c4d1e87b3a0f9911",
    headers={"api-key": os.environ["BITO_API_KEY"]},
)
print(res.json())
```

```php [PHP]
<?php
$ch = curl_init('https://api.bito.uz/integration-api/integration/api/v2/employee/get-by-id/6712f0a9c4d1e87b3a0f9911');
curl_setopt_array($ch, [
    CURLOPT_CUSTOMREQUEST => 'GET',
    CURLOPT_HTTPHEADER => ['api-key: ' . getenv('BITO_API_KEY')],
    CURLOPT_RETURNTRANSFER => true,
]);
$response = json_decode(curl_exec($ch), true);
```

:::

**Параметры пути**

| Параметр | Тип | Обязательно | Описание |
|---|---|---|---|
| `id` | `string` | Да |  |

**Тело запроса**

Тело запроса не требуется.

**Ответ**

Структура ответа совпадает с [POST /employee/create](#post-employee-create).

## GET /employee/get-deleted

Get deleted employee ids

**Нужное разрешение:** `employee` · [как работают разрешения](https://docs.bito.uz/ru/api/permissions.md)

**Пример запроса**

::: code-group

```bash [curl]
curl -X GET 'https://api.bito.uz/integration-api/integration/api/v2/employee/get-deleted?deleted_at=DELETED_AT' \
  -H "api-key: $BITO_API_KEY"
```

```js [JavaScript]
const res = await fetch('https://api.bito.uz/integration-api/integration/api/v2/employee/get-deleted?deleted_at=DELETED_AT', {
  method: 'GET',
  headers: { 'api-key': process.env.BITO_API_KEY },
})
const { code, data } = await res.json()
```

```python [Python]
import os
import requests

res = requests.request(
    "GET",
    "https://api.bito.uz/integration-api/integration/api/v2/employee/get-deleted?deleted_at=DELETED_AT",
    headers={"api-key": os.environ["BITO_API_KEY"]},
)
print(res.json())
```

```php [PHP]
<?php
$ch = curl_init('https://api.bito.uz/integration-api/integration/api/v2/employee/get-deleted?deleted_at=DELETED_AT');
curl_setopt_array($ch, [
    CURLOPT_CUSTOMREQUEST => 'GET',
    CURLOPT_HTTPHEADER => ['api-key: ' . getenv('BITO_API_KEY')],
    CURLOPT_RETURNTRANSFER => true,
]);
$response = json_decode(curl_exec($ch), true);
```

:::

**Параметры запроса**

| Параметр | Тип | Обязательно | Описание |
|---|---|---|---|
| `deleted_at` | `string` | Да |  |

**Тело запроса**

Тело запроса не требуется.

**Ответ**

```json
{
  "code": 0,
  "message": "Success",
  "status_code": 200,
  "data": [
    "string"
  ],
  "time": "2025-05-01T12:00:00Z"
}
```

## POST /employee/get-paging

Get employees by paging

**Нужное разрешение:** `employee` · [как работают разрешения](https://docs.bito.uz/ru/api/permissions.md)

**Пример запроса**

::: code-group

```bash [curl]
curl -X POST 'https://api.bito.uz/integration-api/integration/api/v2/employee/get-paging' \
  -H "api-key: $BITO_API_KEY" \
  -H 'Content-Type: application/json' \
  -d '{
  "page": 1,
  "limit": 20
}'
```

```js [JavaScript]
const res = await fetch('https://api.bito.uz/integration-api/integration/api/v2/employee/get-paging', {
  method: 'POST',
  headers: { 'api-key': process.env.BITO_API_KEY, 'Content-Type': 'application/json' },
  body: JSON.stringify({
    "page": 1,
    "limit": 20
  }),
})
const { code, data } = await res.json()
```

```python [Python]
import os
import requests

res = requests.request(
    "POST",
    "https://api.bito.uz/integration-api/integration/api/v2/employee/get-paging",
    headers={"api-key": os.environ["BITO_API_KEY"]},
    json={
        "page": 1,
        "limit": 20,
    },
)
print(res.json())
```

```php [PHP]
<?php
$body = <<<'JSON'
{
  "page": 1,
  "limit": 20
}
JSON;

$ch = curl_init('https://api.bito.uz/integration-api/integration/api/v2/employee/get-paging');
curl_setopt_array($ch, [
    CURLOPT_CUSTOMREQUEST => 'POST',
    CURLOPT_HTTPHEADER => ['api-key: ' . getenv('BITO_API_KEY'), 'Content-Type: application/json'],
    CURLOPT_POSTFIELDS => $body,
    CURLOPT_RETURNTRANSFER => true,
]);
$response = json_decode(curl_exec($ch), true);
```

:::

**Тело запроса**

| Поле | Тип | Обязательно | Описание |
|---|---|---|---|
| `page` | `number` | Да | По умолчанию: `1` |
| `limit` | `number` | Да | По умолчанию: `20` |
| `organization_id` | `string` | Нет |  |
| `position_id` | `string` | Нет |  |
| `section_id` | `string` | Нет |  |
| `search` | `string` | Нет |  |
| `organization_ids` | `string[]` | Нет | Organization ObjectIds. |
| `access_field_name` | `string` | Нет |  |
| `balance_type` | `string` | Нет | Допустимые значения: `debt`, `credit`, `not_zero`, `zero` |
| `status` | `string` | Нет | Допустимые значения: `active`, `inactive`, `all` |

```json
{
  "page": 1,
  "limit": 20,
  "organization_id": "67b486d242ed76693cd2cc59",
  "position_id": "67b486d242ed76693cd2cc59",
  "section_id": "67b486d242ed76693cd2cc59",
  "search": "string",
  "organization_ids": [
    "64b7f4d9e2b3b6a0b7c5d7ff"
  ],
  "access_field_name": "string",
  "balance_type": "debt",
  "status": "active"
}
```

**Ответ**

`data.total` — общее количество записей, `data.data[]` — записи текущей страницы. Таблица ниже описывает одну запись.

| Поле | Тип | Описание |
|---|---|---|
| `_id` | `string` | id of employee |
| `full_name` | `string` | full name of employee |
| `number` | `string` | number of employee |
| `phone_number` | `string` | phone number of employee |
| `balance_list` | `object[]` |  |
| `balance_list[]._id` | `string` |  |
| `balance_list[].amount` | `number` | По умолчанию: `0` |
| `balance_list[].organization_id` | `string` |  |
| `balance_list[].payment_method_id` | `string` |  |
| `balance_list[].currency_id` | `string` |  |
| `person_id` | `string` | id of person |

```json
{
  "code": 0,
  "message": "Success",
  "status_code": 200,
  "data": {
    "total": 0,
    "data": [
      {
        "_id": "67b486d242ed76693cd2cc59",
        "full_name": "string",
        "number": "string",
        "phone_number": "string",
        "balance_list": [
          {
            "_id": "string",
            "amount": 0,
            "organization_id": "string",
            "payment_method_id": "string",
            "currency_id": "string"
          }
        ],
        "person_id": "string"
      }
    ]
  },
  "time": "2025-05-01T12:00:00Z"
}
```

## POST /employee/get-by-phone-number

Fetch a single employee by phone number. The number is normalised before lookup, so it may be sent with or without a leading +. Returns 400 when no employee carries that number.

**Нужное разрешение:** `employee` · [как работают разрешения](https://docs.bito.uz/ru/api/permissions.md)

**Пример запроса**

::: code-group

```bash [curl]
curl -X POST 'https://api.bito.uz/integration-api/integration/api/v2/employee/get-by-phone-number' \
  -H "api-key: $BITO_API_KEY" \
  -H 'Content-Type: application/json' \
  -d '{
  "phone_number": "998901234567"
}'
```

```js [JavaScript]
const res = await fetch('https://api.bito.uz/integration-api/integration/api/v2/employee/get-by-phone-number', {
  method: 'POST',
  headers: { 'api-key': process.env.BITO_API_KEY, 'Content-Type': 'application/json' },
  body: JSON.stringify({
    "phone_number": "998901234567"
  }),
})
const { code, data } = await res.json()
```

```python [Python]
import os
import requests

res = requests.request(
    "POST",
    "https://api.bito.uz/integration-api/integration/api/v2/employee/get-by-phone-number",
    headers={"api-key": os.environ["BITO_API_KEY"]},
    json={
        "phone_number": "998901234567",
    },
)
print(res.json())
```

```php [PHP]
<?php
$body = <<<'JSON'
{
  "phone_number": "998901234567"
}
JSON;

$ch = curl_init('https://api.bito.uz/integration-api/integration/api/v2/employee/get-by-phone-number');
curl_setopt_array($ch, [
    CURLOPT_CUSTOMREQUEST => 'POST',
    CURLOPT_HTTPHEADER => ['api-key: ' . getenv('BITO_API_KEY'), 'Content-Type: application/json'],
    CURLOPT_POSTFIELDS => $body,
    CURLOPT_RETURNTRANSFER => true,
]);
$response = json_decode(curl_exec($ch), true);
```

:::

**Тело запроса**

| Поле | Тип | Обязательно | Описание |
|---|---|---|---|
| `phone_number` | `string` | Да | Employee phone number in international format (required). |

```json
{
  "phone_number": "998901234567"
}
```

**Ответ**

Структура ответа совпадает с [POST /employee/create](#post-employee-create).

---

*Эта страница сгенерирована из спецификации OpenAPI.*
