Moogsoft Docs

updateUser

A Graze API POST request that updates an existing user.

Back to Graze API EndPoint Reference.

Request arguments

Endpoint updateUser takes the following request arguments:

Name

Type

Required

Description

auth_token

String

Yes

A valid auth_token returned from the authenticate request. See the authenticate endpoint for more information.

username

String

No, you use if uid.

Username of the user to be updated.

uid

Long

No, if you use username.

User ID of the user to be updated.

password

String

No

New user password, only valid for DB realm.

active

Boolean

No

Set to true if the user is active, false if the user is inactive. Default is true.

email

String

No

User's email address.

fullname

String

No

User's full name.

roles

JSON list

No

List of either the role IDs or the role names. For example, "roles":["Super User"].

primary_group

String or Number

No

User's primary group name or primary group ID.

department

String or Number

No

User's department ID or department name.

timezone

String

No

User's timezone.

contact_num

String

No

User's phone number.

session_expiry

Number

No

Number of minutes after which the user's session expires. Default is the system default.

competencies

JSON list

No

A list with the user competencies. Each competency should have have name or cid and ranking. For example:

[
        {"name":"SunOS", "ranking": 40},
        {"name":"SAP", "ranking": 50},
        {"name":"EMC", "ranking": 60}
]

teams

JSON list of Numbers or Strings

No

List of the user's team names or team IDs.

Response

Endpoint updateUser returns the following response:

Examples

The following examples demonstrate typical use of endpoint updateUser:

Request example

Example cURL request to update user ID 5:

curl -X POST -u graze:graze -k -v "https://localhost/graze/v1/updateUser" -H "Content-Type: application/json; charset=UTF-8" -d '{"uid" : 5, "active" : true, "password" : "test", "roles" : ["Super User", "Operator"], "teams" : ["my team 1"], "session_expiry" : null, "properties" : null, "contact_num" : "555-123456", "timezone" : "Europe/London", "fullname" : "John Doe", "department" : "Support", "primary_group" : "Network", "email" : "test@test.com"}'

Response example