Update an existing user

Use the Update User Details API to update an existing user information in the Control Room.

Prerequisites

Edit Users permission
Users who have edit users permission can update a specific user details.
JSON Web Token (JWT)
All Control Room APIs require a JSON Web Token (JWT) to access the APIs. Generate an authentication token using the Authentication API. See Enterprise 11 Authentication API.
  • URL: http://<your_control_room_url>/v1/usermanagement/users/{ID}.

    Replace the content in the angle brackets with your Control Room URL.

  • Method: PUT.
  • Use the Swagger definition files installed with your Control Room to test the APIs. View the available Swagger APIs at: http://<your_control_room_url>/swagger/.
  • You can also use a REST client to complete this task.

Procedure

  1. Add an authentication token to the request header.
    Use the Authentication API to generate a JSON Web Token. See Enterprise 11 Authentication API.
  2. Select PUT as the method.
  3. In the request header, add an existing user ID you want to update. To find a user ID you want to update, execute the Search Users API.
    PUT http://<your_control_room_url>/v1/usermanagement/users/27

    In the request body, add the mandatory parameters.

    Parameter name Mandatory parameters Type Description
    Username Yes String (255 max) New user name
    Email Yes String; must include @ sign, such as a@a.com New user email
    Roles: name Yes String (255 max) New name for the role

    Request body

    { 
        "username": "docsusermd2",
        "domain": "",
        "firstName": "DocsUserMHD1",
        "lastName": "DocUserMHD2",
        "version": 2,
        "principalId": 27,
        "email": "aamd@aa.com",  
        "description": "Created a user to create other roles and users", 
        "createdOn": "2019-11-26T23:44:12.937Z", 
        "updatedOn": "2019-11-26T23:51:39.163Z",  
        "roles": [{
          "id": 27,
          "name": "RoleBotDocsMD6",
          "version": "0"
        }],
        "deleted": false
      }
  4. Send the request.
    • In Swagger, click Execute.
    • In a REST client, click SEND.

    Response body:

    
    {
      "id": 27,
      "email": "aamd@aa.com",
      "username": "docsusermd",
      "domain": null,
      "firstName": "DocsUserMHD1",
      "lastName": "DocUserMHD2",
      "version": 6,
      "principalId": 27,
      "deleted": false,
      "roles": [{
        "name": "RoleBotDocsMD6",
        "id": 27,
        "version": 0
      }],
      "sysAssignedRoles": [],
      "groupNames": [],
      "permissions": [],
      "licenseFeatures": [],
      "emailVerified": true,
      "passwordSet": true,
      "questionsSet": true,
      "enableAutoLogin": false,
      "disabled": false,
      "clientRegistered": false,
      "description": "Created a user to create other roles and users",
      "createdBy": 4,
      "createdOn": "2019-11-26T23:44:12Z",
      "updatedBy": 4,
      "updatedOn": "2019-12-02T23:31:25Z",
      "publicKey": null,
      "appType": null,
      "routingName": null,
      "appUrl": null
    }
Note: You can also run REST requests from a command terminal. The following is a curl request example. This example is formatted for readability. Replace the text inside the angle brackets, <authentication_token>, with your authentication token.
curl -X PUT "http://<your_control_room_url>/v1/usermanagement/users/27" 
-H "accept: application/json" 
-H "X-Authorization: <authentication_token>" 
-H "Content-Type: application/json" -d "'{
    "username": "docsusermd2",
    "domain": "",
    "firstName": "DocsUserMHD1",
    "lastName": "DocUserMHD2",
    "version": 2,
    "principalId": 27,
    "email": "aamd@aa.com",  
    "description": "Created a user to create other roles and users", 
    "createdOn": "2019-11-26T23:44:12.937Z", 
    "updatedOn": "2019-11-26T23:51:39.163Z",  
    "roles": [{
      "id": 27,
      "name": "RoleBotDocsMD6",
      "version": "0"
    }],
    "deleted": false
  }'