πŸ‘©Updating a User

This step shows how to update Groups users.

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.

Below is a list of available parameters for updating users:

Parameter
Type
Required
Description

user_guid

string

Yes

GUID of the user

name

string

No

Name of the user

surname

string

No

Surname of the user

email

string

No

Email of the user

username

string

No

Username of the user

role

string

No

Role of the user(see)

psd

string

No

Password of the user

mobile

string

No

Mobile of the user

login_allowed

bool

No

Flag if the login is allowed

active

bool

No

Flag if the user is active

lang

string

No

Language of the user(see). This option modifies: session interface, panel interface and mails.

timezone

string

No

Timezone of the user(see) This option modifies: how the user sees sessions' hours.

expires_at

string

No

Date which the user will

expire(see)

Example request:

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

Example response:

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

{
    "user_guid": "6D9D158D-5A41-4FE5-A151-DE008BC978DE",
    "name": "UPDATED JOHN",
    "surname": "Doe",
    "username": "johndoe2",
    "email": "[email protected]",
    "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"
}

Last updated

Was this helpful?