---
sidebar_position: 2
description: Update department and other functions to work with Bitrix24 in the Open Integration Package, a free open-source integration library for 1C:Enterprise 8, OneScript and CLI
keywords: [1C, 1С, 1С:Enterprise, 1С:Enterprise 8.3, API, Integration, Services, Exchange, OneScript, CLI, Bitrix24]
---

import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';

# Update department
 Update an existing department



`Function UpdateDepartment(Val URL, Val DepartmentID, Val Name = "", Val ParentID = "", Val HeadID = "", Val Token = "") Export`

  | Parameter | CLI option | Type | Required | Description |
  |-|-|-|-|-|
  | URL | --url | String | &#x2714; | URL of webhook or a Bitrix24 domain, when token used |
  | DepartmentID | --depid | String, Number | &#x2714; | Department ID |
  | Name | --title | String | &#x2716; | Department name |
  | ParentID | --parentid | String, Number | &#x2716; | ID of parent department |
  | HeadID | --headid | String, Number | &#x2716; | ID of department manager |
  | Token | --token | String | &#x2716; | Access token, when app auth method used |

  
  Returns:  Map Of KeyAndValue - serialized JSON of answer from Bitrix24 API

:::tip
Method at API documentation: [department.update](https://dev.1c-bitrix.ru/rest_help/departments/department_update.php)
:::
<br/>


```bsl title="1C:Enterprise/OneScript code example"
    URL = "https://b24-ar17wx.bitrix24.by/rest/1/h0m...";

    DepartmentID = "3088";
    ParentID     = 7;

    Result = OPI_Bitrix24.UpdateDepartment(URL, DepartmentID, , ParentID);

    URL   = "b24-ar17wx.bitrix24.by";
    Token = "6ad03969006e9f06006b12e400000001000...";

    DepartmentID = "3090";
    Name         = "New department";
    ParentID     = 1;
    HeadID       = 10;

    Result = OPI_Bitrix24.UpdateDepartment(URL
        , DepartmentID
        , Name
        , ParentID
        , HeadID
        , Token);
```
 

 <Tabs>
  
    <TabItem value="bash" label="Bash" default>
        ```bash
            oint bitrix24 UpdateDepartment \
             --url "b24-ar17wx.bitrix24.by" \
             --depid 3094 \
             --title "New department" \
             --parentid 1 \
             --headid 10 \
             --token "***"
        ```
    </TabItem>
  
    <TabItem value="bat" label="CMD/Bat" default>
        ```batch
            oint bitrix24 UpdateDepartment ^
             --url "b24-ar17wx.bitrix24.by" ^
             --depid 3094 ^
             --title "New department" ^
             --parentid 1 ^
             --headid 10 ^
             --token "***"
        ```
    </TabItem>
</Tabs>


```json title="Result"
{
 "result": true,
 "time": {
  "start": 1765396859,
  "finish": 1765396859.47225,
  "duration": 0.472248077392578,
  "processing": 0,
  "date_start": "2025-12-10T20:00:59+00:00",
  "date_finish": "2025-12-10T20:00:59+00:00",
  "operating_reset_at": 1765397459,
  "operating": 0.186682939529419
 }
}
```
