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

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

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

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

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

::: noteclassic
このメソッドは*スーパ管理者*ユーザータイプでのみ利用可能です。
このメソッドを呼び出す権限はユーザーロールの設定で取り消すことができます。詳細は[ユーザーロール](/manual/web_interface/frontend_sections/users/user_roles)を参照してください。
:::

::: noteclassic
ユーザーパスワードの強度は、認証APIで定義されたパスワードポリシールールに従って検証されます。詳細は[認証API](/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)` `userids`プロパティの下で作成されたユーザーのIDを含むオブジェクトを返します。 返されるIDの順序は、渡されたユーザーの順序と一致します。

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

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

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

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

新しいユーザーを作成し、ユーザーグループに追加し、新しいメディアを作成します。

[リクエスト](/manual/api#performing-requests):

```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"
            }
        ]
    },
    "id": 1
}
```

レスポンス:

```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})
