1Create User
Overview
This API creates a new user in the system using the details provided.
Method: POST
Request URL: {kyvos-url}/rest/v2/users
Authorization
API Key: sessionid
This method authenticates requests using a session ID which acts like an API key.
BasicAuth: HTTP Authorization Scheme
This method authenticates requests using a username and password sent in the HTTP Authorization header.
Headers
Header Name | Type | Description | Possible Values |
|---|---|---|---|
Content-Type (Required) | String | Specifies media type of request body. |
|
sessionid | String | The session ID is the token received from the login API. Note: Session ID is required for token-based authentication. | – |
Request Body
Parameter Name | Type | Description | Possible Values |
|---|---|---|---|
json (Required) | String | JSON containing the details of the user to be created. Note: An example JSON is provided under the Resources section below. | – |
Responses
200 Success
{
"code": 0,
"message": "Successfully added user: Admin"
}Status Code | Description |
|---|---|
401 | Authorization information is missing or invalid. |
404 | Connection, database, schema, or table not found. |
412 | Precondition failed. Required parameter missing. |
500 | Internal Server Error |
Resources
Below is an example of JSON structure which can be used as a reference for the json parameter in the request body.
{
"userStatus": 1,
"roles": "2",
"description": "This is a sample kyvos user",
"password": "test",
"userAuthType": "NATIVE",
"groupIds": "1170747",
"name": "kyvos.user",
"id": "40234386341",
"userCustomAttributes": [],
"email": "kyvos@test.com"
} JSON Fields Description
Field | Type | Description | Possible Values | Example |
|---|---|---|---|---|
| String | Username (login name) for the new user. | Any valid username string |
|
| String | User ID. If provided, used as the internal user identifier. | Any unique string |
|
| String | Email address of the user. | Valid email address |
|
| String | Optional description or note about the user. | Any string |
|
| String | User's password. Leave blank when | Any string |
|
| String | Comma-separated role name(s) or role ID(s) to assign to the user. Only the first value is used as the primary role. |
|
|
| String | Comma-separated group ID(s) to assign the user to. | Any valid group ID(s) |
|
| String | Authentication type for the user. |
|
|
| Integer | Account status of the user. |
|
|
| Array | Array of custom attribute objects defined for the user. |
|
|
| String | Custom attribute name. Required when userCustomAttributes is used. | Any string. | "Department" |
| String | Type / source of the attribute name. Optional, default CUSTOM. | CUSTOM, etc. | "CUSTOM" |
| String | Custom attribute value. Required when userCustomAttributes is used. | Any string. | "Engineering" |
| String | Type / source of the attribute value. Optional, default CUSTOM. | CUSTOM, etc. | "CUSTOM" |