Add Users to an Identity Domain (v2)
This API creates users directly from parameters provided in the request payload. It is synchronous, returns the operation outcome directly in the response, and simplifies API usage by eliminating the need for URL encoding.
REST Resource
POST /interop/rest/security/v2/users/add
Table 2-7 Tasks for Add Users to an Identity Domain
| Task | Request | REST Resource |
|---|---|---|
| Add users | POST | /interop/rest/security/v2/users/add |
Request
Supported Media Types: application/json
Table 2-8 Parameters
| Name | Description | Type | Required | Default |
|---|---|---|---|---|
users |
List of users to add. The |
Payload | Yes | None |
Example URL and Payload
https://<BASE-URL>/interop/rest/security/v2/users/add
{
"users":
[
{
"firstname": "Jane",
"lastname": "Doe",
"email": "jane.doe@example.com",
"userlogin": "jdoe",
"resetpassword": true
},
{
"lastname": "west",
"email": "chris.west@example.com",
"userlogin": "chris",
"password": "userPassword",
"resetpassword": false
}
]
}
Response
Supported Media Types: application/json
Table 2-9 Parameters
| Name | Description |
|---|---|
links |
Detailed information about the link and HTTP call type |
status |
Identifies the status of the operation
|
error |
Detailed information about the error |
details |
Detailed status of the operation performed. Total number of records processed, succeeded, and failed and reason why they failed. |
Examples of Response Body
Example 1: Job Completes without Errors
{
"links": {
"href": "https://<BASE-URL>/interop/rest/security/v2/users/add",
"action": "POST"
},
"status": 0,
"error": null,
"details": {
"processed": 3,
"succeeded": 3,
"failed": 0,
"faileditems": null
}
}
Example 2: Job Completes with Errors
{
"links": {
"href": "https://<BASE-URL>/interop/rest/security/v2/users/add",
"action": "POST"
},
"status": 1,
"error": {
"errorcode": "EPMCSS-21146",
"errormessage": "Failed to add 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/add",
"action": "POST"
},
"status": 0,
"error": null,
"details": {
**"processed": 5,**
"succeeded": 4,
**"failed": 1,**
"faileditems": [
{
"userlogin": "jdoe",
"errorcode": "EPMCSS-21150",
"errormessage": "Failed to add user. Invalid email jdoe.com. Please provide a valid email."
}
]
}
}
Sample cURL Command Basic Auth
curl -X POST -s -u '<USERNAME>:<PASSWORD>' -H 'Content-Type: application/json' -d '{"users":[{"firstname":"Jane","lastname":"Doe","email":"jane.doe@example.com","userlogin":"jdoe","resetpassword":true},{"lastname":"west","email":"chris.west@example.com","userlogin":"chris","password":"userPassword","resetpassword":false}]}' 'https://<BASE-URL>/interop/rest/security/v2/users/add'
Sample cURL Command OAuth 2.0
curl -X POST --header "Authorization: Bearer <OAUTH_ACCESS_TOKEN>" -H 'Content-Type: application/json' -d '{"users":[{"firstname":"Jane","lastname":"Doe","email":"jane.doe@example.com","userlogin":"jdoe","resetpassword":true},{"lastname":"west","email":"chris.west@example.com","userlogin":"chris","password":"userPassword","resetpassword":false}]}' 'https://<BASE-URL>/interop/rest/security/v2/users/add'