This article will guide you through disabling / enabling users via BioStar 2 API.
We are going to use the following API. This API updates user information.
[PUT] /api/users/{user_id}
[Path Variables]
| Parameter | Type | Required | Description | 
|---|---|---|---|
| user_id | Number | Y | ID of user you want to edit. | 
[Body Parameters]
In this article, I'll only show the body parameter that is related to user status.
You can add other parameters if you wish to change/update other user information to this API.
| Parameter | Type | Required | Description | 
|---|---|---|---|
| disabled | Boolean | Y | Toogle User active or not; false for active, true for non-active. | 
First, let's see how to make a user active !
Put "false" for "disabled" in the body parameter.
[Request Body Example]
| { "User": { "disabled": "false" } } | 
[Response Body Example]
| { "Response": { "code": "0", "link": "https://support.supremainc.com/en/support/home", "message": "Success" } } | 
After running the API, you can see that the user is now ‘active’ in the screenshot below.

Next, let's see how to make a user inactive !
Put "true" for "disabled" in the body parameter.
[Request Body Example]
| { "User": { "disabled": "true" } } | 
[Response Body Example]
| { "Response": { "code": "0", "link": "https://support.supremainc.com/en/support/home", "message": "Success" } } | 
After running the API, you can see that the user is now ‘inactive’ in the screenshot below.

When a disabled user tries to authenticate, below alarm will be shown on your BioStar 2.

