> For the complete documentation index, see [llms.txt](https://spice.docs.medtroniclabs.org/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://spice.docs.medtroniclabs.org/engineering/api-documentation/admin-services/user/user-create-and-update.md).

# User Create and Update

| **API URL**     | {{url}}/admin-service/healthfacility/user-update |
| --------------- | ------------------------------------------------ |
| **Method**      | PUT                                              |
| **Description** | Creation of the Users                            |

#### **Sample Input** <a href="#usercreate-and-update-v2-sampleinput" id="usercreate-and-update-v2-sampleinput"></a>

| **Field Name**         | **Type** | **Mandatory** | **Example**                                                                                                                             |
| ---------------------- | -------- | ------------- | --------------------------------------------------------------------------------------------------------------------------------------- |
| appTypes               | String   | Yes           | AppTypes for user                                                                                                                       |
| firstName              | String   | Yes           | First Name of user                                                                                                                      |
| roles                  | String   | Yes           | Roles for the user                                                                                                                      |
| lastName               | String   | Yes           | Last name of the user                                                                                                                   |
| gender                 | String   | Yes           | User gender                                                                                                                             |
| phoneNumber            | Bigint   | Yes           | User Phone Number                                                                                                                       |
| username               | String   | Yes           | login user name                                                                                                                         |
| culture                | String   | Yes           | User culture                                                                                                                            |
| countryCode            | Bigint   | Yes           | Country Code                                                                                                                            |
| country                | String   | Yes           | Country details                                                                                                                         |
| tenantId               | Bigint   | Yes           | Tenant Id                                                                                                                               |
| supervisorId           | Bigint   | Yes           | Supervisor Id                                                                                                                           |
| roleIds                | Bigint   | Yes           | Role Ids                                                                                                                                |
| active                 | Boolean  | Yes           | Status for user                                                                                                                         |
| redRisk                | Boolean  | Yes           | RedRisk for user                                                                                                                        |
| Authorization (Header) | String   | Yes           | Bearer 1ba363a1edf54402b51f58060aa52b11d30f99a490295adec900fdabf2b472181c0bfb165be18f4f5c430c7218a244bd29b9300d3471acc08197ccfb996118f6 |
| client                 | String   | Yes           | web                                                                                                                                     |

```
{
  "appTypes": [
    "COMMUNITY"
  ],
  "firstName": "Test",
  "lastName": "Peer Supervisor",
  "gender": "Male",
  "username": "XXXemkXXXXkar@ideXXit.com",
  "phoneNumber": "99XXXX834",
  "culture": {
    "id": 1,
    "createdBy": null,
    "updatedBy": null,
    "createdAt": "2024-05-06T15:22:46+05:30",
    "updatedAt": "2024-05-06T15:22:46+05:30",
    "name": "English",
    "code": "en",
    "appTypes": [
      "COMMUNITY"
    ],
    "active": true,
    "deleted": false
  },
  "countryCode": "232",
  "country": {
    "id": 1
  },
  "tenantId": 570,
  "supervisorId": null,
  "roleIds": [
    5
  ],
  "villageIds": [],
  "timezone": null,
  "designation": null,
  "reportUserOrganizationIds": [],
  "insightUserOrganizationIds": [],
  "id": 1,
  "redRisk": false
}
```

#### **Sample Output** <a href="#usercreate-and-update-v2-sampleoutput" id="usercreate-and-update-v2-sampleoutput"></a>

| **Field Name** | **Type** | **Comments**                |
| -------------- | -------- | --------------------------- |
| message        | String   | Admin updated successfully. |
| status         | Boolean  | User entity status          |

```
{
  "message": "Admin updated successfully.",
  "entity": null,
  "status": true,
  "entityList": null,
  "responseCode": 200,
  "totalCount": null
}
```
