Update Users (v2)

Updates user attributes as provided in the request payload. It modifies user attributes such as first name, last name, and email for a user in an identity domain identified by user login. If a user definition in the payload matches a user account that exists in the identity domain, no changes are made to the existing user account, and the REST API responds back with an error. Because user accounts are common to all service environments that an identity domain supports, updated users are available to all the environments that share the identity domain.

This API should be run only by an Identity Domain Administrator in the identity domain where users will be updated. In addition, the user running the API must also be assigned a predefined role in the environment where the API is targeted. With this API, you can see which records failed and the reason why they failed in addition to how many records passed and failed.

This topic describes the simplified v2 version of this REST API. This version contains all parameters in the payload and does not require URL encoding while calling the REST APIs. This makes the v2 API easier to use.

The API is synchronous and returns the outcome of the operation in the response. Any non-zero status indicates failure of updating users.

This API is version v2.

Required Roles

Identity Domain Administrator and any predefined role (Service Administrator, Power User, User, or Viewer)

REST Resource

PUT /interop/rest/security/v2/users/update

Note:

Before using the REST resources, you must understand how to access the REST resources and other important concepts. See Implementation Best Practices for Cloud EPM REST APIs. Using this REST API requires prerequisites. See Prerequisites.

Request

Supported Media Types: application/json

Request Payload

Table 12-44 Payload Parameters

Name Description Type Required Default
userlogin User login IDs of the user, whose attributes are to be modified Payload Yes None
firstname User's first name to modify Payload No None
lastname User's last name to modify Payload No None
email User's email to modify Payload No None

Example URL and Payload

https://<BASE-URL>/interop/rest/security/v2/users/update
{
  "users": [
    {
      "userlogin": "jdoe",
      "firstname": "Jane",
      "lastname": "Doe",
      "email": jane.doe@example.com,
    },
    {
      "userlogin": "chris",
      "firstname": "chris",
      "email": chris.newton@example.com
    },
    {
      "userlogin": "alex",
      "firstname": "alex",
      "lastname": "peter",
    },
    {
      "userlogin": "jeff",
      "email": jeff.chris@example.com
    },
    
  ]
}

Response

Supported Media Types: application/json

Table 12-45 Response Parameters

Name Description
links Detailed information about the link and HTTP call type
status

Identifies the status of the operation

  • 0 - Operation succeeded

  • 1 - Operation failed

error Detailed information about the error
details Detailed status of the operation performed. Total number of records processed, succeeded, and failed, and the reason for why they failed.

Examples of Response Body

The following examples show the contents of the response body in JSON format:

Example 1: REST API Completes without Errors

{
  "links": {
    "href": "https://<BASE-URL>/interop/rest/security/v2/users/update",
    "action": "PUT"
  },
  "status": 0,
  "error": null,
  "details": {
    "processed": 2,
    "succeeded": 2,
    "failed": 0,
    "faileditems": null
  }
} 

Example 2: REST API Completes with Errors

{
  "links": {
    "href": "https://<BASE-URL>/interop/rest/security/v2/users/update",
    "action": "PUT"
  },
  "status": 1,
  "error": {
    "errorcode": "EPMCSS-21192",
    "errormessage": "Failed to update user. Authorization failed. Please provide valid authorized user."
  },
  "details": null
}

Example 3: REST API Completes with Partial Errors

{
  "links": {
    "href": "https://<BASE-URL>/interop/rest/security/v2/users/update",
    "action": "PUT"
  },
  "status": 0,
  "error": null,
  "details": {
    "processed": 5,
    "succeeded": 3,
    "failed": 2,
    "faileditems": [
      {
        "userlogin": "jdoe",
        "errorcode": "EPMCSS-21142",
        "errormessage": "Failed to update user. User already exists in System. Provide different user login."
      },
      {
        "userlogin": "alex",
        "errorcode": "EPMCSS-21143",
        "errormessage": "Failed to update user. Invalid email. Provide valid email."
      }
          ]
  }
}

Sample cURL Command Basic Auth

curl -X PUT -s -u '<USERNAME>:<PASSWORD>' -H 'Content-Type: application/json' -d '{"users":[{"userlogin":"jdoe","firstname":"Jane","lastname":"Doe","email":jane.doe@example.com},{"userlogin":"chris","firstname":"chris","lastname":"west","email":chris.west@example.com},{"userlogin":"jeff","email":jeff.chris@example.com}]}' 'https://<BASE-URL>/interop/rest/security/v2/users/update'

Sample cURL Command OAuth 2.0

curl -X PUT --header "Authorization: Bearer <OAUTH_TOKEN>" 'Content-Type: application/json' -d '{"users":[{"userlogin":"jdoe","firstname":"Jane","lastname":"Doe","email":jane.doe@example.com},{"userlogin":"chris","firstname":"chris","lastname":"west","email":chris.west@example.com},{"userlogin":"jeff","email":jeff.chris@example.com}]}' 'https://<BASE-URL>/interop/rest/security/v2/users/update'