Remove Users from an Identity Domain (v2)
The Remove Users from an Identity Domain (v2) REST API deletes the accounts indentified in an identity domain that are provided in the request payload.
This API should be run only by a user who is assigned to the Identity Domain Administrator role in the identity domain from which users are to be removed. In addition, this user should also have a predefined role in the environment on which the API is run. The payload should not include the account of the user who executes this command. Because user accounts are common to all service environments that an identity domain supports, deleting an account for one environment deletes it for all environments that share the identity domain. 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 removing users.
This API is version v2.
Required Roles
Identity Domain Administrator and any predefined role (Service Administrator, Power User, User, or Viewer)
REST Resource
POST /interop/rest/security/v2/users/remove
Note:
Before using the REST resources, you must understand how to access the REST resources and other important concepts. See Implementation Best Practices for EPM Cloud REST APIs. Using this REST API requires prerequisites. See Prerequisites.
Table 12-11 Tasks for Remove Users from an Identity Domain
Task | Request | REST Resource |
---|---|---|
Remove users | POST | /interop/rest/security/v2/users/remove |
Request
Supported Media Types: application/json
The following table summarizes the POST request parameters.
Table 12-12 Parameters
Name | Description | Type | Required | Default |
---|---|---|---|---|
users |
List of user login IDs of the users to remove | Payload | Yes | None |
Example URL and Payload
https://<BASE-URL>/interop/rest/security/v2/users/remove
{
"users":
[
{
"userlogin": "jdoe"
},
{
"userlogin": "chris"
}
]
}
Response
Supported Media Types: application/json
Table 12-13 Parameters
Name | Description |
---|---|
links |
Detailed information about the link and HTTP call type |
status |
Identifies the status of the operation
|
|
Detailed information about the error |
details |
Detailed status of the operation performed. Total number of records processed, succeeded, and failed and reason for why it failed. |
Examples of Response Body
The following examples show the contents of the response body in JSON format:
Example 1: Job Completes without Errors
{
"links": {
"href": "https://<BASE-URL>/interop/rest/security/v2/users/remove",
"action": "POST"
},
"status": 0,
"error": null,
"details": {
"processed": 2,
"succeeded": 2,
"failed": 0,
"faileditems": null
}
Example 2: Job Completes with Errors
{
"links": {
"href": "https://<BASE-URL>/interop/rest/security/v2/users/remove",
"action": "POST"
},
"status": 1,
"error": {
"errorcode": "EPMCSS-21147",
"errormessage": "Failed to remove users. Invalid or insufficient parameters specified. Provide all required parameters for the REST API."
},
"details": null
}
Example 3: Job Completes with Partial Errors
{
"links": {
"href": "https://<BASE-URL>/interop/rest/security/v2/users/remove",
"action": "POST"
},
"status": 0,
"error": null,
"details": {
"processed": 5,
"succeeded": 3,
"failed": 2,
"faileditems":
[
{
"userlogin": "jdoe",
"errorcode": "EPMCSS-21174",
"errormessage": "Failed to remove user. User jdoe does not exist. Provide a valid userlogin."
},
{
"userlogin": "chris",
"errorcode": "EPMCSS-21174",
"errormessage": " Failed to remove user. User chris does not exist. Provide a valid userlogin."
}
]
}
}
Sample cURL Command Basic Auth
curl -X POST -s -u '<USERNAME>:<PASSWORD>' -H
'Content-Type: application/json' -d '{"users":[{"userlogin":"<USERLOGIN>"},{"userlogin":"<USERLOGIN>"}]}'
'https://<BASE-URL>/interop/rest/security/v2/users/remove'
Sample cURL Command OAuth 2.0
curl -X POST --header "Authorization: Bearer <OAUTH_ACCESS_TOKEN>" -H
'Content-Type: application/json' -d '{"users":[{"userlogin":"<USERLOGIN>"},{"userlogin":"<USERLOGIN>"}]}'
'https://<BASE-URL>/interop/rest/security/v2/users/remove'