> For the complete documentation index, see [llms.txt](https://developer.perculus.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://developer.perculus.com/v2-en/services/user-management/user-update.md).

# Updating a User

{% hint style="info" %}
Create and update operations for Users use the same endpoint. The only difference is that if you send a `user_guid` along with other parameters, the endpoint will treat it as an update request.
{% endhint %}

Below is a list of available parameters for updating users:

<table><thead><tr><th>Parameter</th><th width="134">Type</th><th>Required</th><th>Description</th></tr></thead><tbody><tr><td>user_guid</td><td>string</td><td>Yes</td><td>GUID of the user</td></tr><tr><td>name</td><td>string</td><td>No</td><td>Name of the user</td></tr><tr><td>surname</td><td>string</td><td>No</td><td>Surname of the user</td></tr><tr><td>email</td><td>string</td><td>No</td><td>Email of the user</td></tr><tr><td>username</td><td>string</td><td>No</td><td>Username of the user</td></tr><tr><td>role</td><td>string</td><td>No</td><td>Role of the user(<a href="/pages/UTVEaKGzw0Q9EmCFXDq1">see</a>)</td></tr><tr><td>psd</td><td>string</td><td>No</td><td>Password of the user</td></tr><tr><td>mobile</td><td>string</td><td>No</td><td>Mobile of the user</td></tr><tr><td>login_allowed</td><td>bool</td><td>No</td><td>Flag if the login is allowed</td></tr><tr><td>active</td><td>bool</td><td>No</td><td>Flag if the user is active</td></tr><tr><td>lang</td><td>string</td><td>No</td><td>Language of the user(<a href="/pages/lsSvGzmzOzBbQwfL34jH">see</a>). This option modifies: <mark style="color:green;">session interface, panel interface and mails.</mark></td></tr><tr><td>timezone</td><td>string</td><td>No</td><td>Timezone of the user(<a href="/pages/gQdFQ1QzG6GgP6cR2hOQ">see</a>) This option modifies: how the user sees <mark style="color:green;">sessions' hours.</mark></td></tr><tr><td>expires_at</td><td>string</td><td>No</td><td><p>Date which the user will </p><p>expire(<a href="/pages/KC5egNFm9kBLa1ddQFOf">see</a>)</p></td></tr></tbody></table>

**Example request:**

{% tabs %}
{% tab title="CURL" %}

```bash
curl -L -X POST 'https://<DOMAIN>/api/groups/xapi/user' \
-H 'Content-Type: application/json' \
-d '{
  "user_guid": "6D9D158D-5A41-4FE5-A151-DE008BC978DE",
  "name": "UPDATED JOHN"
}'
```

{% endtab %}

{% tab title="Python" %}

```python
client.users.upsert_user(
   {
     "user_guid": "6D9D158D-5A41-4FE5-A151-DE008BC978DE",
     "name": "UPDATED JOHN"
   }
)
```

{% endtab %}
{% endtabs %}

**Example response:**

A successful update operation will return `200 OK`  with body including the following information:

```json
{
    "user_guid": "6D9D158D-5A41-4FE5-A151-DE008BC978DE",
    "name": "UPDATED JOHN",
    "surname": "Doe",
    "username": "johndoe2",
    "email": "john.doe@constructor.tech",
    "role": "u",
    "mobile": null,
    "login_allowed": true,
    "status": 1,
    "lang": "en-US",
    "timezone": "Europe/Istanbul",
    "expires_at": null,
    "creation_date": "2025-01-30T10:21:59.01073+03:00",
    "updating_date": "2025-01-30T10:21:59.01073+03:00"
}
```
