> For the complete documentation index, see [llms.txt](https://docs.ggwp.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.ggwp.com/jp/idoyobiakusesuiam/apidokyumento-scim/yzapi/yzwo.md).

# ユーザーを作成

### 概要

システムに新しいユーザーを作成します。

このエンドポイントは、ユーザーのプロビジョニング中に Okta や Microsoft Azure Active Directory などのIDプロバイダーによって使用されます。

***

### エンドポイント

```bash
POST /Users
```

***

### 完全なURL

```bash
https://api.ggwp.com/scim/v2/Users
```

***

### 認証

```http
Authorization: Bearer <access_token>
```

***

## リクエスト本文

### 例

```json
{
  "schemas": ["urn:ietf:params:scim:schemas:core:2.0:User"],
  "userName": "Temp_user_prod",
  "externalId": "ABC1900BE",
  "name": {
    "givenName": "Temp",
    "familyName": "User"
  },
  "displayName": "一時ユーザー",
  "emails": [
    {
      "value": "temp_user_us@example.com",
      "primary": true
    }
  ],
  "roles": [
    {
      "value": "admin"
    }
  ],
  "active": true
}
```

***

## 本文パラメータ

### schemas

* **型:** `配列[string]`
* **必須:** はい
* **値:**  `urn:ietf:params:scim:schemas:core:2.0:User`&#x20;

***

### userName

* **型:** `文字列`
* **必須:** はい
* **説明:** ユーザーの一意識別子

***

### name

* **型:** `オブジェクト`
* **必須:** 任意

#### サブ属性

<table><thead><tr><th width="150.5">フィールド</th><th width="137.5">型</th><th>説明</th></tr></thead><tbody><tr><td>givenName</td><td>文字列</td><td>名</td></tr><tr><td>familyName</td><td>文字列</td><td>姓</td></tr></tbody></table>

***

### emails

* **型:** `配列[オブジェクト]`
* **必須:** はい

#### サブ属性

<table><thead><tr><th width="134.5">フィールド</th><th width="143">型</th><th width="131.5">必須</th><th>説明</th></tr></thead><tbody><tr><td>値</td><td>文字列</td><td>✅</td><td>メールアドレス</td></tr><tr><td>type</td><td>文字列</td><td>❌</td><td>勤務先、家庭</td></tr><tr><td>primary</td><td>真偽値</td><td>❌</td><td>主要メールアドレス</td></tr></tbody></table>

***

### active

* **型:** `真偽値`
* **必須:** 任意
* **既定値:** `true`

***

## レスポンス

### 成功（200 OK）

```json
{
  "schemas": ["urn:ietf:params:scim:schemas:core:2.0:User"],
  "id": "c118d158-c11b-495b-ab88-f57c8ac473c0",
  "userName": "Temp_user_prod",
  "externalId": "ABC1900BE",
  "active": true,
  "name": {
    "givenName": "Temp",
    "familyName": "User"
  },
  "displayName": "一時ユーザー",
  "emails": [
    {
      "value": "temp_user_us@example.com",
      "primary": true
    }
  ],
  "roles": [
    {
      "value": "admin"
    }
  ],
  "meta": {
    "resourceType": "User",
    "location": "https://api.ggwp.com/scim/v2/Users/c118d158-c11b-495b-ab88-f57c8ac473c0",
    "created": "2026-04-01T11:15:22Z",
    "lastModified": "2026-04-01T11:15:22Z"
  }
}
```

***

## エラーレスポンス

### 400 不正なリクエスト

```json
{
  "schemas": ["urn:ietf:params:scim:api:messages:2.0:Error"],
  "status": "400",
  "detail": "無効なリクエスト"
}
```

***

### 409 Conflict（重複ユーザー）

```json
{
  "schemas": ["urn:ietf:params:scim:api:messages:2.0:Error"],
  "status": "409",
  "detail": "このユーザー名を持つユーザーはすでに存在します"
}
```

***

## 検証ルール

* `schemas` 存在し、有効でなければなりません
* `userName` 一意でなければなりません
* メールアドレス形式は有効かつ一意でなければなりません
* 重複ユーザーは返す必要があります `409 Conflict`
* 無効なペイロードは返す必要があります `400`
