﻿---
sidebar_position: 5
---

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

# Change user status
 Activates or deactivates (fire) the selected user



`Function ChangeUserStatus(Val URL, Val UserID, Val Fire = True, Val Token = "") Export`

  | Parameter | CLI option | Type | Required | Description |
  |-|-|-|-|-|
  | URL | --url | String | &#x2714; | URL of webhook or a Bitrix24 domain, when token used |
  | UserID | --userid | String, Number | &#x2714; | User ID |
  | Fire | --fire | Boolean | &#x2716; | True > Deactivation, False > Activation |
  | Token | --token | String | &#x2716; | Access token, when app auth method used |

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

<br/>




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

    Result = OPI_Bitrix24.ChangeUserStatus(URL, UserID, True);

    URL    = "b24-ar17wx.bitrix24.by";
    Token  = "b4c59767006e9f06006b12e400000001000...";
    UserID = "1466";

    Result = OPI_Bitrix24.ChangeUserStatus(URL, UserID, True, Token);
```
 

 <Tabs>
  
    <TabItem value="bash" label="Bash" default>
        ```bash
            oint bitrix24 ChangeUserStatus \
             --url "b24-ar17wx.bitrix24.by" \
             --userid 1430 \
             --fire true \
             --token "***"
        ```
    </TabItem>
  
    <TabItem value="bat" label="CMD/Bat" default>
        ```batch
            oint bitrix24 ChangeUserStatus ^
             --url "b24-ar17wx.bitrix24.by" ^
             --userid 1430 ^
             --fire true ^
             --token "***"
        ```
    </TabItem>
</Tabs>


```json title="Result"
{
 "result": true,
 "time": {
  "start": 1728454937.15091,
  "finish": 1728454937.42878,
  "duration": 0.277868986129761,
  "processing": 0.252010822296143,
  "date_start": "2024-10-09T09:22:17+03:00",
  "date_finish": "2024-10-09T09:22:17+03:00",
  "operating_reset_at": 1728455537,
  "operating": 0.53964114189148
 }
}
```
