[comment]: # ({a79da37c-a79da37c})
# user.create

[comment]: # ({/a79da37c-a79da37c})

[comment]: # ({6269f520-7dc5480b})
### 説明

`object user.create(object/array users)`

このメソッドは、新しいユーザーを作成します。

::: noteclassic
このメソッドは、*Super admin*タイプのユーザのみが使用できます。 このメソッドを呼び出す権限は、ユーザーロールの設定で無効にできます。 詳細は[ユーザーの役割](/manual/web_interface/frontend_sections/administration/user_roles)を参照してください。
:::

::: noteclassic
ユーザーのパスワード強度は、Authentication APIで定義されたパスワードポリシーに従って検証されます。 詳細は[Authentication](/manual/api/reference/authentication)を参照してください。
:::

[comment]: # ({/6269f520-7dc5480b})

[comment]: # ({db383808-9e6b7fba})
### パラメータ

`(object/array)` 作成するユーザー。

このメソッドは、[標準のユーザープロパティ](object#user)に加えて、
以下のパラメータを受け付けます。

|パラメータ|[Type](/manual/api/reference_commentary#data-types)|説明|
|--|--|------|
|usrgrps|array|ユーザーを追加する[ユーザーグループ](/manual/api/reference/usergroup/object#user-group)。<br><br>ユーザーグループでは、`usrgrpid`プロパティのみを定義する必要があります。|
|medias|array|作成する[ユーザーメディア](/manual/api/reference/user/object#media)。|

[comment]: # ({/db383808-9e6b7fba})

[comment]: # ({7e32f5f9-7e32f5f9})
### 戻り値

`(object)` 作成されたユーザーのID(`userids`プロパティ)を持つオブジェクトを返します。 返されるIDの順序は、渡したユーザーの順序と一致します。

[comment]: # ({/7e32f5f9-7e32f5f9})

[comment]: # ({b41637d2-b41637d2})
### 例

[comment]: # ({/b41637d2-b41637d2})

[comment]: # ({37809083-0df8c129})
#### ユーザー作成

新しいユーザーを作成します。その際に、ユーザーグループへの追加と新しいメディアの作成を行います。

Request:

```json
{
    "jsonrpc": "2.0",
    "method": "user.create",
    "params": {
        "username": "John",
        "passwd": "Doe123",
        "roleid": "5",
        "usrgrps": [
            {
                "usrgrpid": "7"
            }
        ],
        "medias": [
            {
                "mediatypeid": "1",
                "sendto": [
                    "support@company.com"
                ],
                "active": 0,
                "severity": 63,
                "period": "1-7,00:00-24:00"
            }
        ]
    },
    "auth": "038e1d7b1735c6a5436ee9eae095879e",
    "id": 1
}
```

Response:

```json
{
    "jsonrpc": "2.0",
    "result": {
        "userids": [
            "12"
        ]
    },
    "id": 1
}
```

[comment]: # ({/37809083-0df8c129})

[comment]: # ({b839f25d-130699eb})
### 関連項目

-   [認証](/manual/api/reference/authentication)
-   [メディア](/manual/api/reference/user/object#media)
-   [ユーザーグループ](/manual/api/reference/usergroup/object#user-group)
-   [ロール](/manual/api/reference/role/object#role)

[comment]: # ({/b839f25d-130699eb})

[comment]: # ({61de33e2-61de33e2})
### ソース

CUser::create() in *ui/include/classes/api/services/CUser.php*.

[comment]: # ({/61de33e2-61de33e2})
