From 6d433c50ab66b9d539da8e31f417b126053aac37 Mon Sep 17 00:00:00 2001 From: Thomas Heartman Date: Fri, 4 Mar 2022 10:36:40 +0100 Subject: [PATCH] docs: add info about requiring `name` OR `email` --- website/docs/api/admin/user-admin.md | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/website/docs/api/admin/user-admin.md b/website/docs/api/admin/user-admin.md index 9ea63af5a7..e410b966f0 100644 --- a/website/docs/api/admin/user-admin.md +++ b/website/docs/api/admin/user-admin.md @@ -119,10 +119,14 @@ 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` | Yes | The user's email address. | `"user@getunleash.io"` | -| `name` | Yes | The user's name | `"Some Name"` | +| `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` |