Create user
This API call creates a cluster user account.
Authentication
The ServiceProviderAPI
(Service Provider API) Api-Token scope is required to get the default realm password policy configuration using the Dynatrace API. With this API method, you can preset user's password by passing passwordClearText
value. This is allowed only if a specific Feature Flag is enabled. To do this - contact Dynatrace ONE via help chat or e-mail.
Endpoint
/api/v1.0/onpremise/users
Parameter
Parameter | Type | Description | In | Required |
---|---|---|---|---|
body | User | The JSON body of the request, containing parameters of the user. | body | optional |
Request body objects
The UserConfig
object
The configuration of the user.
Element | Type | Description | Required |
---|---|---|---|
id | string | User ID | required |
string | User's email address | required | |
firstName | string | User's first name | required |
lastName | string | User's last name | required |
passwordClearText | string | User's password in a clear text; used only to set initial password | optional |
groups | string[] | List of user's user group IDs. | optional |
Request body JSON model
This is a model of the request body, showing the possible elements. It has to be adjusted for usage in an actual request.
{
"id": "string",
"email": "string",
"firstName": "string",
"lastName": "string",
"passwordClearText": "string",
"groups": [
"string"
]
}
Response
Response codes
Code | Type | Description |
---|---|---|
200 | User | Successfully created |
400 | Operation failed. The input is invalid. Possible reasons:
| |
403 | Operation forbidden - users and groups are fully managed via LDAP or SSO | |
406 | Unacceptable request | |
522 | Couldn't create user | |
523 | User already exists | |
524 | Email address already registered |
Response body objects
The UserConfig
object
The configuration of the user.
Element | Type | Description |
---|---|---|
id | string | User ID |
string | User's email address | |
firstName | string | User's first name |
lastName | string | User's last name |
passwordClearText | string | User's password in a clear text; used only to set initial password |
groups | string[] | List of user's user group IDs. |
Response body JSON model
{
"id": "string",
"email": "string",
"firstName": "string",
"lastName": "string",
"passwordClearText": "string",
"groups": [
"string"
]
}
Example
In this example, you add john.wicked
user and assign admins
group. As a response, you will receive back persisted state of the entity.
Curl
curl -X PUT "https://myManaged.cluster.com/api/v1.0/onpremise/users" -H "accept: application/json" -H "Content-Type: application/json" -d "{\"id\":\"john.wicked\",\"email\":\"john.wicked@company.com\",\"firstName\":\"John\",\"lastName\":\"Wicked\",\"passwordClearText\":null,\"groups\":[\"admin\"]}"
Request URL
https://myManaged.cluster.com/api/v1.0/onpremise/users
Response body
{
"id": "john.wicked",
"email": "john.wicked@company.com",
"firstName": "John",
"lastName": "Wicked",
"passwordClearText": null,
"groups": [
"admin"
]
}
Response code
200