1
0
mirror of https://github.com/Unleash/unleash.git synced 2024-12-22 19:07:54 +01:00

Merge pull request #1342 from Unleash/docs/user-admin-send-email-props

docs: Add payload properties for user-admin post payload
This commit is contained in:
Thomas Heartman 2022-03-04 12:10:02 +01:00 committed by GitHub
commit cf2a8de161
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -115,7 +115,21 @@ You can also search for users via the search API. It will preform a simple searc
`POST https://unleash.host.com/api/admin/user-admin`
Creates a new use with the given root role.
Creates a new user with the given root role.
**Payload properties**
:::info Requirements
The payload **must** contain **at least one of** the `name` and `email` properties, though which one is up to you. For the user to be able to log in to the system, the user **must** have an email.
:::
| Property name | Required | Description | Example value(s) |
|---------------|----------|-------------------------------------------------------------------------------------------|------------------------|
| `email` | No | The user's email address. Must be provided if `name` is not provided. | `"user@getunleash.io"` |
| `name` | No | The user's name. Must be provided if `email` is not provided. | `"Some Name"` |
| `rootRole` | Yes | The role to assign to the user. Can be either the role's ID or its unique name. | `2`, `"Editor"` |
| `sendEmail` | No | Whether to send a welcome email with a login link to the user or not. Defaults to `true`. | `false` |
**Body**
@ -128,12 +142,6 @@ Creates a new use with the given root role.
}
```
**Notes**
- `email` - Required field.
- `rootRole` - can either be the role id or the unique name of the role (e.g: `Editor`).
- `sendEmail` - set to `true` if you want Unleash to send Welcome email to the new user. Do require the Unleash instance to be configured with email settings.
#### Return values: {#return-values}
`201: Created`