# Update User

| **API URL**         | {{url}}/fhir-user-service/users/update |
| ------------------- | -------------------------------------- |
| **Method**          | PUT                                    |
| **Request Headers** | Authorization : Bearer \[token]        |
| **Description**     | Updates a existing user                |

#### **Input** <a href="#accountcreate-input" id="accountcreate-input"></a>

| **Field Name**       | **Type** | **Example**    |
| -------------------- | -------- | -------------- |
| username             | String   | Healthcarezone |
| password             | String   |                |
| firstName            | String   |                |
| middleName           | String   |                |
| lastname             | String   |                |
| companyName          | String   |                |
| companyEmail         | String   |                |
| countryCode          | String   |                |
| phone                | String   |                |
| address              | String   |                |
| website              | String   |                |
| id(Country)          | Long     |                |
| name(Country)        | String   |                |
| code(Country)        | String   |                |
| id(timezone)         | Long     |                |
| name(timezone)       | String   |                |
| offset(timezone)     | String   |                |
| forgetPasswordCount  | Integer  |                |
| invalidLoginAttempts | Integer  |                |

#### **Sample Input:** <a href="#accountcreate-sampleinput" id="accountcreate-sampleinput"></a>

```postman_json
{
    "user": {
        "id": 1,
        "active": true,
        "deleted": false,
        "username": "fhiradmin@mtdlabs.com",
        "password": "hello123",
        "firstName": "Akash",
        "middleName": " kumaer",
        "lastname": "  n t ",
        "companyName": "leo Inc",
        "companyEmail": "leo.doe@abc.com",
        "countryCode": "US",
        "phone": "123-98765436-7890",
        "address": "123 Main Street",
        "website": "https://www.example.com",
        "country": {
            "id": 1
        },
        "timezone": {
            "id": 1
        },
        "roles": [
            {
                "id": 1
            }
        ]
    }
}

```

#### **Sample Output:** <a href="#accountcreate-sampleoutput" id="accountcreate-sampleoutput"></a>

```
{
    "message": "User updated successfully.",
    "entity": {
        "id": 1,
        "username": "fhiradmin@mtdlabs.com",
        "firstName": "Akash",
        "middleName": " kumaer",
        "lastname": "  n t ",
        "companyName": "leo Inc",
        "companyEmail": "leo.doe@abc.com",
        "countryCode": "US",
        "phone": "123-98765436-7890",
        "address": "123 Main Street",
        "website": "https://www.example.com",
        "country": {
            "id": 1,
            "name": null,
            "code": null,
            "abbreviation": null
        },
        "timezone": {
            "id": 1,
            "offset": null,
            "description": null
        },
        "forgetPasswordCount": 0,
        "invalidLoginAttempts": 0,
        "roles": [
            {
                "id": 1,
                "name": "FHIR_Admin",
                "level": "1"
            }
        ],
        "authorization": null,
        "currentDate": 0,
        "isSuperUser": false,
        "createdBy": 1,
        "updatedBy": 1
    },
    "status": true,
    "entityList": null,
    "responseCode": 200,
    "totalCount": null
}
```
