In this article
Create User
Create User
- Only Admin can create a new user.
- When you create a user without a username, the system automatically assigns the ID as the username and vice versa.
- User Subject property is auto generated. Do not pass it in the user object.
- To create UserCredentials, you can generate them on the client side and pass them with the object or pass a plaintextpassword.
- User Meta data is auto generated. Do not pass it in the user object.
- If you create a User with no plaintextpassword or Credentials object, the user will not have access to SecurityAPI.
URL
https://{{HOST}}/security/user?v={version}&userId={userId}
Method
POST
Required IMS Scopes
- securityapi_all
Versions Supported
- 2.0 (Default)
URL Query Parameters
| Name | Description | Example | Type |
|---|---|---|---|
| v optional |
Version of the api to use | /user?v=2.0 | number |
| userId required |
The ID of the user. | /user?userId=testUser | string |
Request Header Parameters
| Type | Value | Description |
|---|---|---|
| Authorization required |
Bearer {access_token} | IMS access token |
| Content-Type required |
application/json | Content Type |
Request Body Parameters
| Name | Description | Type |
|---|---|---|
| id required |
The username of the nw user | string |
| plaintextpassword optional |
The plain text password of the new user | string |
| identity optional |
Identity properties of the new user. Should include organization and could include things like address, name, phone number, etc. | JSON Object |
| privilege optional |
Contains properties related to the user’s privilege, such as roles and permissions. | JSON Object |
Example
Request
curl -X POST
'https://{{HOST}}/securityapi/user?v=2.0&userid={{userId}}'
-H 'Authorization: Bearer {access_token}'
-H 'Content-Type: application/json'
-d '{
"id": "testUser",
"plaintextpassword": "supersecectpasswordinplaintext",
"identity": {
"organization": "testOrganization"
},
"privilege": {
}
}'
Response
{
"success": true
}
Errors
| Error | Description |
|---|---|
| Error Name | Description of Error |
Response Body Parameters
| Name | Description | Schema |
|---|---|---|
| Object Name | Description | object definition |
| success | Description | object definition |