--- title: "サブアカウントの作成" slug: "management-subaccount-createsubaccount" updated: 2026-09-17T09:58:05Z published: 2026-09-17T09:58:05Z canonical: "api.ncloud-docs.com/management-subaccount-createsubaccount" --- > ## Documentation Index > Fetch the complete documentation index at: https://api.ncloud-docs.com/llms.txt > Use this file to discover all available pages before exploring further. # サブアカウントの作成 Classic/VPC環境で利用できます。 サブアカウントを作成します。サブアカウントを作成すると、アカウントごとに権限を設定できるため、安全かつ安定的にサービスを運用できます。 参考 サブアカウントは最大500個まで作成できます。 ## リクエスト リクエスト形式を説明します。リクエスト形式は次の通りです。 | メソッド | URI | | --- | --- | | POST | /api/v1/sub-accounts | ### リクエストヘッダ Sub Account APIで共通して使用されるヘッダの詳細は、[Sub Accountのリクエストヘッダ](/docs/ja/management-subaccount#%EC%9A%94%EC%B2%AD%ED%97%A4%EB%8D%94)をご参照ください。 ### リクエストボディ リクエストボディの説明は次の通りです。 | フィールド | タイプ | 必須の有無 | 説明 | | --- | --- | --- | --- | | `apiAllowSources` | Array | Optional | サブアカウントが APIにアクセス可能なソースリスト: [apiAllowSources](/docs/ja/management-subaccount-createsubaccount#apiAllowSources) | | `canAPIGatewayAccess` | Boolean | Required | サブアカウントは API Gatewayにアクセス可能かどうか - Access Keyを作成すると API Gatewayに登録された APIは使用可能かどうか - `true` \| `false` - `true`: 可能 - `false`: 不可 | | `canConsoleAccess` | Boolean | Required | サブアカウントはコンソールにアクセス可能かどうか - `true` \| `false` - `true`: 可能 - `false`: 不可 | | `consolePermitIps` | Array | Optional | サブアカウントがコンソールにアクセスできる IPアドレス帯域リスト | | `email` | String | Optional | サブアカウントユーザーのメールアドレス - 6~100文字 | | `isMfaMandatory` | Boolean | Optional | サブアカウントの2段階認証は必須かどうか - `true` \| `false` (デフォルト) - `true`: 必須 - `false`: 任意 | | `loginId` | String | Required | サブアカウントログイン ID - 英字の大文字・小文字、数字、記号。「@ - _」を使用して3~60文字 - 先頭文字は英字の大文字・小文字 - [サブアカウントログイン IDの重複チェック](/docs/ja/management-subaccount-checkloginid)を通じて IDが重複していないか確認できる | | `memo` | String | Optional | サブアカウントの説明(Bytes) - 0~300 | | `name` | String | Required | サブアカウントのユーザー名 - 2~30文字 | | `needPasswordGenerate` | Boolean | Optional | サブアカウントログインパスワードの作成方法 - `true` \| `false` (デフォルト) - `true`: 自動作成 - `false`: 直接入力 | | `needPasswordReset` | Boolean | Required | サブアカウントログインパスワード再設定を通知するか - サブアカウントで初回ログイン時にパスワード変更の案内をするかどうか - `true` \| `false` - `true`: 案内する - `false`: 案内しない | | `password` | String | Conditional | サブアカウントログインパスワード - `needPasswordGenerate`が`false`の場合は必ず入力 - 英字の大文字・小文字、数字、記号を組み合わせて8~16文字 - [ログインパスワードのチェック](/docs/ja/management-subaccount-checkpassword)を通じてパスワードの有効性を確認できる | | `useApiAllowSource` | Boolean | Optional | サブアカウントが APIにアクセス可能なソースを制限するか - `true` \| `false` - `true`: 指定のソースからのみアクセス可能 - `false`: すべてのソースからアクセス可能 | | `useConsolePermitIp` | Boolean | Optional | サブアカウントがコンソールにアクセス可能な IPアドレス帯域を制限するか - `true` \| `false` - `true`: 指定の IPアドレス帯域からのみアクセス可能 - `false`: 制限なしでアクセス可能 | | `tags` | Map | Optional | サブアカウントのタグ - リソースごとに最大20個 - [key、valueの制限条件](/docs/ja/management-resourcemanager-attachtag)を参照 | #### `apiAllowSources` `apiAllowSources`の説明は次の通りです。 | フィールド | タイプ | 必須の有無 | 説明 | | --- | --- | --- | --- | | `type` | String | Conditional | アクセスソースのタイプ - `IP` \| `VPC` \| `VPC_SERVER` - `IP`: サーバの単一 IPアドレスまたはサブネットを含む IPアドレス帯域 - `VPC`: 使用中の VPC - `VPC_SERVER`: 使用中の VPC環境のサーバ | | `source` | String | Conditional | アクセスソース情報 - IPアドレスまたはインスタンス番号を入力 | ### リクエスト例 リクエストのサンプルコードは次の通りです。 ``` curl --location --request POST 'https://subaccount.apigw.ntruss.com/api/v1/sub-accounts' \ --header 'x-ncp-apigw-timestamp: {Timestamp}' \ --header 'x-ncp-iam-access-key: {Access Key}' \ --header 'x-ncp-apigw-signature-v2: {API Gateway Signature}' \ --header 'Accept: application/json' \ --header 'Content-Type: application/json' \ --data '{ "apiAllowSources": [ { "type": "IP", "source": "***.***.***.***" } ], "canAPIGatewayAccess": true, "canConsoleAccess": true, "consolePermitIps": [ "***.***.***.***" ], "email": "email@ncloud.com", "isMfaMandatory": false, "loginId": "testuser33", "memo": "testuser account", "name": "userts3", "needPasswordGenerate": true, "needPasswordReset": true, "useApiAllowSource": true, "useConsolePermitIp": true, "tags": { "env": "dev", "team": "a" } }' ``` ## レスポンス レスポンス形式を説明します。 ### レスポンスボディ レスポンスボディの説明は次の通りです。 | フィールド | タイプ | 必須の有無 | 説明 | | --- | --- | --- | --- | | `id` | String | - | サブアカウント ID | | `success` | Boolean | - | API呼び出しは成功したか - `true` \| `false` - `true`: 成功 - `false`: 失敗 | | `generatedPassword` | String | - | サブアカウントのパスワード - `needPasswordGenerate`が`true`の場合に表示 | ### レスポンスステータスコード Sub Account APIで共通して使用されるレスポンスステータスコードの詳細は、[Sub Accountのレスポンスステータスコード](/docs/ja/management-subaccount#%EC%9D%91%EB%8B%B5%EC%83%81%ED%83%9C%EC%BD%94%EB%93%9C)をご参照ください。 ### レスポンス例 レスポンスのサンプルコードは次の通りです。 ``` { "id": "e60b75d0-****-****-****-***********", "success": true, "generatedPassword": "*****************" } ```