> For the complete documentation index, see [llms.txt](https://docs.maiagent.ai/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.maiagent.ai/api/ja/api-reference/scim.md).

# SCIM

SCIM 2.0 エンドポイントを使用すると、ID プロバイダー（Entra ID、Okta など）から組織メンバーのプロビジョニング、更新、無効化を自動で行えます。ベース URL は `https://api.maiagent.ai/api/v1/scim/{orgUuid}` で、パスの末尾に `/` は付けません。認証には `Authorization: Bearer <SCIM Token>`（管理画面の ID 同期設定で取得します。API Key ではありません）を使用し、`Content-Type: application/scim+json` を指定します。リクエストの上限は組織ごとに毎分 100 回です。フィールドのマッピングと無効化の動作については、技術マニュアルの[メンバーのプロビジョニング](https://docs.maiagent.ai/tech/authorization-integration/member-provisioning)を参照してください。

### サービスプロバイダー設定を取得（IdP 検出用） <a href="#scim-service-provider-config-retrieve" id="scim-service-provider-config-retrieve"></a>

GET `/api/v1/scim/{orgUuid}/ServiceProviderConfig`

#### パラメータ

| パラメータ名    | 必須 | 型      | 説明 |
| --------- | -- | ------ | -- |
| `orgUuid` | ✅  | string |    |

#### コード例

{% tabs %}
{% tab title="Shell/Bash" %}

```bash
# API 呼び出し例 (Shell)
curl -X GET "https://api.maiagent.ai/api/v1/scim/550e8400-e29b-41d4-a716-446655440000/ServiceProviderConfig" \
  -H "Authorization: Bearer YOUR_SCIM_TOKEN"

# 実行前に YOUR_API_KEY を置き換え、リクエストデータを確認してください。
```

{% endtab %}

{% tab title="JavaScript" %}

```javascript
const axios = require('axios');

// リクエストヘッダーを設定します
const config = {
  headers: {
    'Authorization': 'Bearer YOUR_SCIM_TOKEN'
  }
};

axios.get("https://api.maiagent.ai/api/v1/scim/550e8400-e29b-41d4-a716-446655440000/ServiceProviderConfig", config)
  .then(response => {
    console.log('レスポンスを正常に取得しました:');
    console.log(response.data);
  })
  .catch(error => {
    console.error('リクエストでエラーが発生しました:');
    console.error(error.response?.data || error.message);
  });
```

{% endtab %}

{% tab title="Python" %}

```python
import requests

url = "https://api.maiagent.ai/api/v1/scim/550e8400-e29b-41d4-a716-446655440000/ServiceProviderConfig"
headers = {
    "Authorization": "Bearer YOUR_SCIM_TOKEN"
}


response = requests.get(url, headers=headers)
try:
    print("レスポンスを正常に取得しました:")
    print(response.json())
except Exception as e:
    print("リクエストでエラーが発生しました:", e)
```

{% endtab %}

{% tab title="PHP" %}

```php
<?php
require 'vendor/autoload.php';

$client = new GuzzleHttp\Client();

try {
    $response = $client->get("https://api.maiagent.ai/api/v1/scim/550e8400-e29b-41d4-a716-446655440000/ServiceProviderConfig", [
        'headers' => [
            'Authorization' => 'Bearer YOUR_SCIM_TOKEN'
        ]
    ]);
    
    $data = json_decode($response->getBody(), true);
    echo "レスポンスを正常に取得しました:\n";
    print_r($data);
} catch (Exception $e) {
    echo 'リクエストでエラーが発生しました: ' . $e->getMessage();
}
?>
```

{% endtab %}
{% endtabs %}

#### レスポンスボディ

| ステータスコード | 説明                                                                 |
| -------- | ------------------------------------------------------------------ |
| 200      | No response body                                                   |
| 4XX      | Error response; X-Error-Code carries its code (see "Error codes"). |

***

### メンバーを一覧取得または検索（\`filter\`、\`startIndex\`、\`count\` に対応） <a href="#scim-users-retrieve" id="scim-users-retrieve"></a>

GET `/api/v1/scim/{orgUuid}/Users`

#### パラメータ

| パラメータ名    | 必須 | 型      | 説明 |
| --------- | -- | ------ | -- |
| `orgUuid` | ✅  | string |    |

#### コード例

{% tabs %}
{% tab title="Shell/Bash" %}

```bash
# API 呼び出し例 (Shell)
curl -X GET "https://api.maiagent.ai/api/v1/scim/550e8400-e29b-41d4-a716-446655440000/Users" \
  -H "Authorization: Bearer YOUR_SCIM_TOKEN"

# 実行前に YOUR_API_KEY を置き換え、リクエストデータを確認してください。
```

{% endtab %}

{% tab title="JavaScript" %}

```javascript
const axios = require('axios');

// リクエストヘッダーを設定します
const config = {
  headers: {
    'Authorization': 'Bearer YOUR_SCIM_TOKEN'
  }
};

axios.get("https://api.maiagent.ai/api/v1/scim/550e8400-e29b-41d4-a716-446655440000/Users", config)
  .then(response => {
    console.log('レスポンスを正常に取得しました:');
    console.log(response.data);
  })
  .catch(error => {
    console.error('リクエストでエラーが発生しました:');
    console.error(error.response?.data || error.message);
  });
```

{% endtab %}

{% tab title="Python" %}

```python
import requests

url = "https://api.maiagent.ai/api/v1/scim/550e8400-e29b-41d4-a716-446655440000/Users"
headers = {
    "Authorization": "Bearer YOUR_SCIM_TOKEN"
}


response = requests.get(url, headers=headers)
try:
    print("レスポンスを正常に取得しました:")
    print(response.json())
except Exception as e:
    print("リクエストでエラーが発生しました:", e)
```

{% endtab %}

{% tab title="PHP" %}

```php
<?php
require 'vendor/autoload.php';

$client = new GuzzleHttp\Client();

try {
    $response = $client->get("https://api.maiagent.ai/api/v1/scim/550e8400-e29b-41d4-a716-446655440000/Users", [
        'headers' => [
            'Authorization' => 'Bearer YOUR_SCIM_TOKEN'
        ]
    ]);
    
    $data = json_decode($response->getBody(), true);
    echo "レスポンスを正常に取得しました:\n";
    print_r($data);
} catch (Exception $e) {
    echo 'リクエストでエラーが発生しました: ' . $e->getMessage();
}
?>
```

{% endtab %}
{% endtabs %}

#### レスポンスボディ

| ステータスコード | 説明                                                                 |
| -------- | ------------------------------------------------------------------ |
| 200      | No response body                                                   |
| 4XX      | Error response; X-Error-Code carries its code (see "Error codes"). |

***

### メンバーを作成 <a href="#scim-users-create" id="scim-users-create"></a>

POST `/api/v1/scim/{orgUuid}/Users`

#### パラメータ

| パラメータ名    | 必須 | 型      | 説明 |
| --------- | -- | ------ | -- |
| `orgUuid` | ✅  | string |    |

#### コード例

{% tabs %}
{% tab title="Shell/Bash" %}

```bash
# API 呼び出し例 (Shell)
curl -X POST "https://api.maiagent.ai/api/v1/scim/550e8400-e29b-41d4-a716-446655440000/Users" \
  -H "Authorization: Bearer YOUR_SCIM_TOKEN"

# 実行前に YOUR_API_KEY を置き換え、リクエストデータを確認してください。
```

{% endtab %}

{% tab title="JavaScript" %}

```javascript
const axios = require('axios');

// リクエストヘッダーを設定します
const config = {
  headers: {
    'Authorization': 'Bearer YOUR_SCIM_TOKEN'
  }
};

// リクエストボディ (payload)
const data = null;

axios.post("https://api.maiagent.ai/api/v1/scim/550e8400-e29b-41d4-a716-446655440000/Users", data, config)
  .then(response => {
    console.log('レスポンスを正常に取得しました:');
    console.log(response.data);
  })
  .catch(error => {
    console.error('リクエストでエラーが発生しました:');
    console.error(error.response?.data || error.message);
  });
```

{% endtab %}

{% tab title="Python" %}

```python
import requests

url = "https://api.maiagent.ai/api/v1/scim/550e8400-e29b-41d4-a716-446655440000/Users"
headers = {
    "Authorization": "Bearer YOUR_SCIM_TOKEN"
}


response = requests.post(url, headers=headers)
try:
    print("レスポンスを正常に取得しました:")
    print(response.json())
except Exception as e:
    print("リクエストでエラーが発生しました:", e)
```

{% endtab %}

{% tab title="PHP" %}

```php
<?php
require 'vendor/autoload.php';

$client = new GuzzleHttp\Client();

try {
    $response = $client->post("https://api.maiagent.ai/api/v1/scim/550e8400-e29b-41d4-a716-446655440000/Users", [
        'headers' => [
            'Authorization' => 'Bearer YOUR_SCIM_TOKEN'
        ]
    ]);
    
    $data = json_decode($response->getBody(), true);
    echo "レスポンスを正常に取得しました:\n";
    print_r($data);
} catch (Exception $e) {
    echo 'リクエストでエラーが発生しました: ' . $e->getMessage();
}
?>
```

{% endtab %}
{% endtabs %}

#### レスポンスボディ

| ステータスコード | 説明                                                                 |
| -------- | ------------------------------------------------------------------ |
| 200      | No response body                                                   |
| 4XX      | Error response; X-Error-Code carries its code (see "Error codes"). |

***

### 特定のメンバーを取得 <a href="#scim-users-retrieve2" id="scim-users-retrieve2"></a>

GET `/api/v1/scim/{orgUuid}/Users/{userId}`

#### パラメータ

| パラメータ名    | 必須 | 型      | 説明 |
| --------- | -- | ------ | -- |
| `orgUuid` | ✅  | string |    |
| `userId`  | ✅  | string |    |

#### コード例

{% tabs %}
{% tab title="Shell/Bash" %}

```bash
# API 呼び出し例 (Shell)
curl -X GET "https://api.maiagent.ai/api/v1/scim/550e8400-e29b-41d4-a716-446655440000/Users/550e8400-e29b-41d4-a716-446655440000" \
  -H "Authorization: Bearer YOUR_SCIM_TOKEN"

# 実行前に YOUR_API_KEY を置き換え、リクエストデータを確認してください。
```

{% endtab %}

{% tab title="JavaScript" %}

```javascript
const axios = require('axios');

// リクエストヘッダーを設定します
const config = {
  headers: {
    'Authorization': 'Bearer YOUR_SCIM_TOKEN'
  }
};

axios.get("https://api.maiagent.ai/api/v1/scim/550e8400-e29b-41d4-a716-446655440000/Users/550e8400-e29b-41d4-a716-446655440000", config)
  .then(response => {
    console.log('レスポンスを正常に取得しました:');
    console.log(response.data);
  })
  .catch(error => {
    console.error('リクエストでエラーが発生しました:');
    console.error(error.response?.data || error.message);
  });
```

{% endtab %}

{% tab title="Python" %}

```python
import requests

url = "https://api.maiagent.ai/api/v1/scim/550e8400-e29b-41d4-a716-446655440000/Users/550e8400-e29b-41d4-a716-446655440000"
headers = {
    "Authorization": "Bearer YOUR_SCIM_TOKEN"
}


response = requests.get(url, headers=headers)
try:
    print("レスポンスを正常に取得しました:")
    print(response.json())
except Exception as e:
    print("リクエストでエラーが発生しました:", e)
```

{% endtab %}

{% tab title="PHP" %}

```php
<?php
require 'vendor/autoload.php';

$client = new GuzzleHttp\Client();

try {
    $response = $client->get("https://api.maiagent.ai/api/v1/scim/550e8400-e29b-41d4-a716-446655440000/Users/550e8400-e29b-41d4-a716-446655440000", [
        'headers' => [
            'Authorization' => 'Bearer YOUR_SCIM_TOKEN'
        ]
    ]);
    
    $data = json_decode($response->getBody(), true);
    echo "レスポンスを正常に取得しました:\n";
    print_r($data);
} catch (Exception $e) {
    echo 'リクエストでエラーが発生しました: ' . $e->getMessage();
}
?>
```

{% endtab %}
{% endtabs %}

#### レスポンスボディ

| ステータスコード | 説明                                                                 |
| -------- | ------------------------------------------------------------------ |
| 200      | No response body                                                   |
| 4XX      | Error response; X-Error-Code carries its code (see "Error codes"). |

***

### メンバーを完全に置換 <a href="#scim-users-update" id="scim-users-update"></a>

PUT `/api/v1/scim/{orgUuid}/Users/{userId}`

#### パラメータ

| パラメータ名    | 必須 | 型      | 説明 |
| --------- | -- | ------ | -- |
| `orgUuid` | ✅  | string |    |
| `userId`  | ✅  | string |    |

#### コード例

{% tabs %}
{% tab title="Shell/Bash" %}

```bash
# API 呼び出し例 (Shell)
curl -X PUT "https://api.maiagent.ai/api/v1/scim/550e8400-e29b-41d4-a716-446655440000/Users/550e8400-e29b-41d4-a716-446655440000" \
  -H "Authorization: Bearer YOUR_SCIM_TOKEN"

# 実行前に YOUR_API_KEY を置き換え、リクエストデータを確認してください。
```

{% endtab %}

{% tab title="JavaScript" %}

```javascript
const axios = require('axios');

// リクエストヘッダーを設定します
const config = {
  headers: {
    'Authorization': 'Bearer YOUR_SCIM_TOKEN'
  }
};

// リクエストボディ (payload)
const data = null;

axios.put("https://api.maiagent.ai/api/v1/scim/550e8400-e29b-41d4-a716-446655440000/Users/550e8400-e29b-41d4-a716-446655440000", data, config)
  .then(response => {
    console.log('レスポンスを正常に取得しました:');
    console.log(response.data);
  })
  .catch(error => {
    console.error('リクエストでエラーが発生しました:');
    console.error(error.response?.data || error.message);
  });
```

{% endtab %}

{% tab title="Python" %}

```python
import requests

url = "https://api.maiagent.ai/api/v1/scim/550e8400-e29b-41d4-a716-446655440000/Users/550e8400-e29b-41d4-a716-446655440000"
headers = {
    "Authorization": "Bearer YOUR_SCIM_TOKEN"
}


response = requests.put(url, headers=headers)
try:
    print("レスポンスを正常に取得しました:")
    print(response.json())
except Exception as e:
    print("リクエストでエラーが発生しました:", e)
```

{% endtab %}

{% tab title="PHP" %}

```php
<?php
require 'vendor/autoload.php';

$client = new GuzzleHttp\Client();

try {
    $response = $client->put("https://api.maiagent.ai/api/v1/scim/550e8400-e29b-41d4-a716-446655440000/Users/550e8400-e29b-41d4-a716-446655440000", [
        'headers' => [
            'Authorization' => 'Bearer YOUR_SCIM_TOKEN'
        ]
    ]);
    
    $data = json_decode($response->getBody(), true);
    echo "レスポンスを正常に取得しました:\n";
    print_r($data);
} catch (Exception $e) {
    echo 'リクエストでエラーが発生しました: ' . $e->getMessage();
}
?>
```

{% endtab %}
{% endtabs %}

#### レスポンスボディ

| ステータスコード | 説明                                                                 |
| -------- | ------------------------------------------------------------------ |
| 200      | No response body                                                   |
| 4XX      | Error response; X-Error-Code carries its code (see "Error codes"). |

***

### メンバーを部分更新（無効化、名前の変更、externalId の変更） <a href="#scim-users-partial-update" id="scim-users-partial-update"></a>

PATCH `/api/v1/scim/{orgUuid}/Users/{userId}`

#### パラメータ

| パラメータ名    | 必須 | 型      | 説明 |
| --------- | -- | ------ | -- |
| `orgUuid` | ✅  | string |    |
| `userId`  | ✅  | string |    |

#### コード例

{% tabs %}
{% tab title="Shell/Bash" %}

```bash
# API 呼び出し例 (Shell)
curl -X PATCH "https://api.maiagent.ai/api/v1/scim/550e8400-e29b-41d4-a716-446655440000/Users/550e8400-e29b-41d4-a716-446655440000" \
  -H "Authorization: Bearer YOUR_SCIM_TOKEN"

# 実行前に YOUR_API_KEY を置き換え、リクエストデータを確認してください。
```

{% endtab %}

{% tab title="JavaScript" %}

```javascript
const axios = require('axios');

// リクエストヘッダーを設定します
const config = {
  headers: {
    'Authorization': 'Bearer YOUR_SCIM_TOKEN'
  }
};

// リクエストボディ (payload)
const data = null;

axios.patch("https://api.maiagent.ai/api/v1/scim/550e8400-e29b-41d4-a716-446655440000/Users/550e8400-e29b-41d4-a716-446655440000", data, config)
  .then(response => {
    console.log('レスポンスを正常に取得しました:');
    console.log(response.data);
  })
  .catch(error => {
    console.error('リクエストでエラーが発生しました:');
    console.error(error.response?.data || error.message);
  });
```

{% endtab %}

{% tab title="Python" %}

```python
import requests

url = "https://api.maiagent.ai/api/v1/scim/550e8400-e29b-41d4-a716-446655440000/Users/550e8400-e29b-41d4-a716-446655440000"
headers = {
    "Authorization": "Bearer YOUR_SCIM_TOKEN"
}


response = requests.patch(url, headers=headers)
try:
    print("レスポンスを正常に取得しました:")
    print(response.json())
except Exception as e:
    print("リクエストでエラーが発生しました:", e)
```

{% endtab %}

{% tab title="PHP" %}

```php
<?php
require 'vendor/autoload.php';

$client = new GuzzleHttp\Client();

try {
    $response = $client->patch("https://api.maiagent.ai/api/v1/scim/550e8400-e29b-41d4-a716-446655440000/Users/550e8400-e29b-41d4-a716-446655440000", [
        'headers' => [
            'Authorization' => 'Bearer YOUR_SCIM_TOKEN'
        ]
    ]);
    
    $data = json_decode($response->getBody(), true);
    echo "レスポンスを正常に取得しました:\n";
    print_r($data);
} catch (Exception $e) {
    echo 'リクエストでエラーが発生しました: ' . $e->getMessage();
}
?>
```

{% endtab %}
{% endtabs %}

#### レスポンスボディ

| ステータスコード | 説明                                                                 |
| -------- | ------------------------------------------------------------------ |
| 200      | No response body                                                   |
| 4XX      | Error response; X-Error-Code carries its code (see "Error codes"). |

***

### メンバーを無効化 <a href="#scim-users-destroy" id="scim-users-destroy"></a>

DELETE `/api/v1/scim/{orgUuid}/Users/{userId}`

#### パラメータ

| パラメータ名    | 必須 | 型      | 説明 |
| --------- | -- | ------ | -- |
| `orgUuid` | ✅  | string |    |
| `userId`  | ✅  | string |    |

#### コード例

{% tabs %}
{% tab title="Shell/Bash" %}

```bash
# API 呼び出し例 (Shell)
curl -X DELETE "https://api.maiagent.ai/api/v1/scim/550e8400-e29b-41d4-a716-446655440000/Users/550e8400-e29b-41d4-a716-446655440000" \
  -H "Authorization: Bearer YOUR_SCIM_TOKEN"

# 実行前に YOUR_API_KEY を置き換え、リクエストデータを確認してください。
```

{% endtab %}

{% tab title="JavaScript" %}

```javascript
const axios = require('axios');

// リクエストヘッダーを設定します
const config = {
  headers: {
    'Authorization': 'Bearer YOUR_SCIM_TOKEN'
  }
};

// リクエストボディ (payload)
const data = null;

axios.delete("https://api.maiagent.ai/api/v1/scim/550e8400-e29b-41d4-a716-446655440000/Users/550e8400-e29b-41d4-a716-446655440000", data, config)
  .then(response => {
    console.log('レスポンスを正常に取得しました:');
    console.log(response.data);
  })
  .catch(error => {
    console.error('リクエストでエラーが発生しました:');
    console.error(error.response?.data || error.message);
  });
```

{% endtab %}

{% tab title="Python" %}

```python
import requests

url = "https://api.maiagent.ai/api/v1/scim/550e8400-e29b-41d4-a716-446655440000/Users/550e8400-e29b-41d4-a716-446655440000"
headers = {
    "Authorization": "Bearer YOUR_SCIM_TOKEN"
}


response = requests.delete(url, headers=headers)
try:
    print("レスポンスを正常に取得しました:")
    print(response.json())
except Exception as e:
    print("リクエストでエラーが発生しました:", e)
```

{% endtab %}

{% tab title="PHP" %}

```php
<?php
require 'vendor/autoload.php';

$client = new GuzzleHttp\Client();

try {
    $response = $client->delete("https://api.maiagent.ai/api/v1/scim/550e8400-e29b-41d4-a716-446655440000/Users/550e8400-e29b-41d4-a716-446655440000", [
        'headers' => [
            'Authorization' => 'Bearer YOUR_SCIM_TOKEN'
        ]
    ]);
    
    $data = json_decode($response->getBody(), true);
    echo "レスポンスを正常に取得しました:\n";
    print_r($data);
} catch (Exception $e) {
    echo 'リクエストでエラーが発生しました: ' . $e->getMessage();
}
?>
```

{% endtab %}
{% endtabs %}

#### レスポンスボディ

| ステータスコード | 説明                                                                 |
| -------- | ------------------------------------------------------------------ |
| 204      | No response body                                                   |
| 4XX      | Error response; X-Error-Code carries its code (see "Error codes"). |

***

### グループを一覧取得（MaiAgent のロールに対応） <a href="#scim-groups-retrieve" id="scim-groups-retrieve"></a>

GET `/api/v1/scim/{orgUuid}/Groups`

#### パラメータ

| パラメータ名    | 必須 | 型      | 説明 |
| --------- | -- | ------ | -- |
| `orgUuid` | ✅  | string |    |

#### コード例

{% tabs %}
{% tab title="Shell/Bash" %}

```bash
# API 呼び出し例 (Shell)
curl -X GET "https://api.maiagent.ai/api/v1/scim/550e8400-e29b-41d4-a716-446655440000/Groups" \
  -H "Authorization: Bearer YOUR_SCIM_TOKEN"

# 実行前に YOUR_API_KEY を置き換え、リクエストデータを確認してください。
```

{% endtab %}

{% tab title="JavaScript" %}

```javascript
const axios = require('axios');

// リクエストヘッダーを設定します
const config = {
  headers: {
    'Authorization': 'Bearer YOUR_SCIM_TOKEN'
  }
};

axios.get("https://api.maiagent.ai/api/v1/scim/550e8400-e29b-41d4-a716-446655440000/Groups", config)
  .then(response => {
    console.log('レスポンスを正常に取得しました:');
    console.log(response.data);
  })
  .catch(error => {
    console.error('リクエストでエラーが発生しました:');
    console.error(error.response?.data || error.message);
  });
```

{% endtab %}

{% tab title="Python" %}

```python
import requests

url = "https://api.maiagent.ai/api/v1/scim/550e8400-e29b-41d4-a716-446655440000/Groups"
headers = {
    "Authorization": "Bearer YOUR_SCIM_TOKEN"
}


response = requests.get(url, headers=headers)
try:
    print("レスポンスを正常に取得しました:")
    print(response.json())
except Exception as e:
    print("リクエストでエラーが発生しました:", e)
```

{% endtab %}

{% tab title="PHP" %}

```php
<?php
require 'vendor/autoload.php';

$client = new GuzzleHttp\Client();

try {
    $response = $client->get("https://api.maiagent.ai/api/v1/scim/550e8400-e29b-41d4-a716-446655440000/Groups", [
        'headers' => [
            'Authorization' => 'Bearer YOUR_SCIM_TOKEN'
        ]
    ]);
    
    $data = json_decode($response->getBody(), true);
    echo "レスポンスを正常に取得しました:\n";
    print_r($data);
} catch (Exception $e) {
    echo 'リクエストでエラーが発生しました: ' . $e->getMessage();
}
?>
```

{% endtab %}
{% endtabs %}

#### レスポンスボディ

| ステータスコード | 説明                                                                 |
| -------- | ------------------------------------------------------------------ |
| 200      | No response body                                                   |
| 4XX      | Error response; X-Error-Code carries its code (see "Error codes"). |

***

### グループを作成 <a href="#scim-groups-create" id="scim-groups-create"></a>

POST `/api/v1/scim/{orgUuid}/Groups`

#### パラメータ

| パラメータ名    | 必須 | 型      | 説明 |
| --------- | -- | ------ | -- |
| `orgUuid` | ✅  | string |    |

#### コード例

{% tabs %}
{% tab title="Shell/Bash" %}

```bash
# API 呼び出し例 (Shell)
curl -X POST "https://api.maiagent.ai/api/v1/scim/550e8400-e29b-41d4-a716-446655440000/Groups" \
  -H "Authorization: Bearer YOUR_SCIM_TOKEN"

# 実行前に YOUR_API_KEY を置き換え、リクエストデータを確認してください。
```

{% endtab %}

{% tab title="JavaScript" %}

```javascript
const axios = require('axios');

// リクエストヘッダーを設定します
const config = {
  headers: {
    'Authorization': 'Bearer YOUR_SCIM_TOKEN'
  }
};

// リクエストボディ (payload)
const data = null;

axios.post("https://api.maiagent.ai/api/v1/scim/550e8400-e29b-41d4-a716-446655440000/Groups", data, config)
  .then(response => {
    console.log('レスポンスを正常に取得しました:');
    console.log(response.data);
  })
  .catch(error => {
    console.error('リクエストでエラーが発生しました:');
    console.error(error.response?.data || error.message);
  });
```

{% endtab %}

{% tab title="Python" %}

```python
import requests

url = "https://api.maiagent.ai/api/v1/scim/550e8400-e29b-41d4-a716-446655440000/Groups"
headers = {
    "Authorization": "Bearer YOUR_SCIM_TOKEN"
}


response = requests.post(url, headers=headers)
try:
    print("レスポンスを正常に取得しました:")
    print(response.json())
except Exception as e:
    print("リクエストでエラーが発生しました:", e)
```

{% endtab %}

{% tab title="PHP" %}

```php
<?php
require 'vendor/autoload.php';

$client = new GuzzleHttp\Client();

try {
    $response = $client->post("https://api.maiagent.ai/api/v1/scim/550e8400-e29b-41d4-a716-446655440000/Groups", [
        'headers' => [
            'Authorization' => 'Bearer YOUR_SCIM_TOKEN'
        ]
    ]);
    
    $data = json_decode($response->getBody(), true);
    echo "レスポンスを正常に取得しました:\n";
    print_r($data);
} catch (Exception $e) {
    echo 'リクエストでエラーが発生しました: ' . $e->getMessage();
}
?>
```

{% endtab %}
{% endtabs %}

#### レスポンス内容

| ステータスコード | 説明                                                                 |
| -------- | ------------------------------------------------------------------ |
| 200      | No response body                                                   |
| 4XX      | Error response; X-Error-Code carries its code (see "Error codes"). |

***

### 特定のグループを取得 <a href="#scim-groups-retrieve2" id="scim-groups-retrieve2"></a>

GET `/api/v1/scim/{orgUuid}/Groups/{groupId}`

#### パラメータ

| パラメータ名    | 必須 | 型      | 説明 |
| --------- | -- | ------ | -- |
| `groupId` | ✅  | string |    |
| `orgUuid` | ✅  | string |    |

#### コード例

{% tabs %}
{% tab title="Shell/Bash" %}

```bash
# API 呼び出し例 (Shell)
curl -X GET "https://api.maiagent.ai/api/v1/scim/550e8400-e29b-41d4-a716-446655440000/Groups/550e8400-e29b-41d4-a716-446655440000" \
  -H "Authorization: Bearer YOUR_SCIM_TOKEN"

# 実行前に YOUR_API_KEY を置き換え、リクエストデータを確認してください。
```

{% endtab %}

{% tab title="JavaScript" %}

```javascript
const axios = require('axios');

// リクエストヘッダーを設定します
const config = {
  headers: {
    'Authorization': 'Bearer YOUR_SCIM_TOKEN'
  }
};

axios.get("https://api.maiagent.ai/api/v1/scim/550e8400-e29b-41d4-a716-446655440000/Groups/550e8400-e29b-41d4-a716-446655440000", config)
  .then(response => {
    console.log('レスポンスを正常に取得しました:');
    console.log(response.data);
  })
  .catch(error => {
    console.error('リクエストでエラーが発生しました:');
    console.error(error.response?.data || error.message);
  });
```

{% endtab %}

{% tab title="Python" %}

```python
import requests

url = "https://api.maiagent.ai/api/v1/scim/550e8400-e29b-41d4-a716-446655440000/Groups/550e8400-e29b-41d4-a716-446655440000"
headers = {
    "Authorization": "Bearer YOUR_SCIM_TOKEN"
}


response = requests.get(url, headers=headers)
try:
    print("レスポンスを正常に取得しました:")
    print(response.json())
except Exception as e:
    print("リクエストでエラーが発生しました:", e)
```

{% endtab %}

{% tab title="PHP" %}

```php
<?php
require 'vendor/autoload.php';

$client = new GuzzleHttp\Client();

try {
    $response = $client->get("https://api.maiagent.ai/api/v1/scim/550e8400-e29b-41d4-a716-446655440000/Groups/550e8400-e29b-41d4-a716-446655440000", [
        'headers' => [
            'Authorization' => 'Bearer YOUR_SCIM_TOKEN'
        ]
    ]);
    
    $data = json_decode($response->getBody(), true);
    echo "レスポンスを正常に取得しました:\n";
    print_r($data);
} catch (Exception $e) {
    echo 'リクエストでエラーが発生しました: ' . $e->getMessage();
}
?>
```

{% endtab %}
{% endtabs %}

#### レスポンス内容

| ステータスコード | 説明                                                                 |
| -------- | ------------------------------------------------------------------ |
| 200      | No response body                                                   |
| 4XX      | Error response; X-Error-Code carries its code (see "Error codes"). |

***

### グループ全体を置換 <a href="#scim-groups-update" id="scim-groups-update"></a>

PUT `/api/v1/scim/{orgUuid}/Groups/{groupId}`

#### パラメータ

| パラメータ名    | 必須 | 型      | 説明 |
| --------- | -- | ------ | -- |
| `groupId` | ✅  | string |    |
| `orgUuid` | ✅  | string |    |

#### コード例

{% tabs %}
{% tab title="Shell/Bash" %}

```bash
# API 呼び出し例 (Shell)
curl -X PUT "https://api.maiagent.ai/api/v1/scim/550e8400-e29b-41d4-a716-446655440000/Groups/550e8400-e29b-41d4-a716-446655440000" \
  -H "Authorization: Bearer YOUR_SCIM_TOKEN"

# 実行前に YOUR_API_KEY を置き換え、リクエストデータを確認してください。
```

{% endtab %}

{% tab title="JavaScript" %}

```javascript
const axios = require('axios');

// リクエストヘッダーを設定します
const config = {
  headers: {
    'Authorization': 'Bearer YOUR_SCIM_TOKEN'
  }
};

// リクエストボディ (payload)
const data = null;

axios.put("https://api.maiagent.ai/api/v1/scim/550e8400-e29b-41d4-a716-446655440000/Groups/550e8400-e29b-41d4-a716-446655440000", data, config)
  .then(response => {
    console.log('レスポンスを正常に取得しました:');
    console.log(response.data);
  })
  .catch(error => {
    console.error('リクエストでエラーが発生しました:');
    console.error(error.response?.data || error.message);
  });
```

{% endtab %}

{% tab title="Python" %}

```python
import requests

url = "https://api.maiagent.ai/api/v1/scim/550e8400-e29b-41d4-a716-446655440000/Groups/550e8400-e29b-41d4-a716-446655440000"
headers = {
    "Authorization": "Bearer YOUR_SCIM_TOKEN"
}


response = requests.put(url, headers=headers)
try:
    print("レスポンスを正常に取得しました:")
    print(response.json())
except Exception as e:
    print("リクエストでエラーが発生しました:", e)
```

{% endtab %}

{% tab title="PHP" %}

```php
<?php
require 'vendor/autoload.php';

$client = new GuzzleHttp\Client();

try {
    $response = $client->put("https://api.maiagent.ai/api/v1/scim/550e8400-e29b-41d4-a716-446655440000/Groups/550e8400-e29b-41d4-a716-446655440000", [
        'headers' => [
            'Authorization' => 'Bearer YOUR_SCIM_TOKEN'
        ]
    ]);
    
    $data = json_decode($response->getBody(), true);
    echo "レスポンスを正常に取得しました:\n";
    print_r($data);
} catch (Exception $e) {
    echo 'リクエストでエラーが発生しました: ' . $e->getMessage();
}
?>
```

{% endtab %}
{% endtabs %}

#### レスポンス内容

| ステータスコード | 説明                                                                 |
| -------- | ------------------------------------------------------------------ |
| 200      | No response body                                                   |
| 4XX      | Error response; X-Error-Code carries its code (see "Error codes"). |

***

### グループを部分更新（名前の変更、メンバーの追加・削除） <a href="#scim-groups-partial-update" id="scim-groups-partial-update"></a>

PATCH `/api/v1/scim/{orgUuid}/Groups/{groupId}`

#### パラメータ

| パラメータ名    | 必須 | 型      | 説明 |
| --------- | -- | ------ | -- |
| `groupId` | ✅  | string |    |
| `orgUuid` | ✅  | string |    |

#### コード例

{% tabs %}
{% tab title="Shell/Bash" %}

```bash
# API 呼び出し例 (Shell)
curl -X PATCH "https://api.maiagent.ai/api/v1/scim/550e8400-e29b-41d4-a716-446655440000/Groups/550e8400-e29b-41d4-a716-446655440000" \
  -H "Authorization: Bearer YOUR_SCIM_TOKEN"

# 実行前に YOUR_API_KEY を置き換え、リクエストデータを確認してください。
```

{% endtab %}

{% tab title="JavaScript" %}

```javascript
const axios = require('axios');

// リクエストヘッダーを設定します
const config = {
  headers: {
    'Authorization': 'Bearer YOUR_SCIM_TOKEN'
  }
};

// リクエストボディ (payload)
const data = null;

axios.patch("https://api.maiagent.ai/api/v1/scim/550e8400-e29b-41d4-a716-446655440000/Groups/550e8400-e29b-41d4-a716-446655440000", data, config)
  .then(response => {
    console.log('レスポンスを正常に取得しました:');
    console.log(response.data);
  })
  .catch(error => {
    console.error('リクエストでエラーが発生しました:');
    console.error(error.response?.data || error.message);
  });
```

{% endtab %}

{% tab title="Python" %}

```python
import requests

url = "https://api.maiagent.ai/api/v1/scim/550e8400-e29b-41d4-a716-446655440000/Groups/550e8400-e29b-41d4-a716-446655440000"
headers = {
    "Authorization": "Bearer YOUR_SCIM_TOKEN"
}


response = requests.patch(url, headers=headers)
try:
    print("レスポンスを正常に取得しました:")
    print(response.json())
except Exception as e:
    print("リクエストでエラーが発生しました:", e)
```

{% endtab %}

{% tab title="PHP" %}

```php
<?php
require 'vendor/autoload.php';

$client = new GuzzleHttp\Client();

try {
    $response = $client->patch("https://api.maiagent.ai/api/v1/scim/550e8400-e29b-41d4-a716-446655440000/Groups/550e8400-e29b-41d4-a716-446655440000", [
        'headers' => [
            'Authorization' => 'Bearer YOUR_SCIM_TOKEN'
        ]
    ]);
    
    $data = json_decode($response->getBody(), true);
    echo "レスポンスを正常に取得しました:\n";
    print_r($data);
} catch (Exception $e) {
    echo 'リクエストでエラーが発生しました: ' . $e->getMessage();
}
?>
```

{% endtab %}
{% endtabs %}

#### レスポンス内容

| ステータスコード | 説明                                                                 |
| -------- | ------------------------------------------------------------------ |
| 200      | No response body                                                   |
| 4XX      | Error response; X-Error-Code carries its code (see "Error codes"). |

***

### グループを削除 <a href="#scim-groups-destroy" id="scim-groups-destroy"></a>

DELETE `/api/v1/scim/{orgUuid}/Groups/{groupId}`

#### パラメータ

| パラメータ名    | 必須 | 型      | 説明 |
| --------- | -- | ------ | -- |
| `groupId` | ✅  | string |    |
| `orgUuid` | ✅  | string |    |

#### コード例

{% tabs %}
{% tab title="Shell/Bash" %}

```bash
# API 呼び出し例 (Shell)
curl -X DELETE "https://api.maiagent.ai/api/v1/scim/550e8400-e29b-41d4-a716-446655440000/Groups/550e8400-e29b-41d4-a716-446655440000" \
  -H "Authorization: Bearer YOUR_SCIM_TOKEN"

# 実行前に YOUR_API_KEY を置き換え、リクエストデータを確認してください。
```

{% endtab %}

{% tab title="JavaScript" %}

```javascript
const axios = require('axios');

// リクエストヘッダーを設定します
const config = {
  headers: {
    'Authorization': 'Bearer YOUR_SCIM_TOKEN'
  }
};

// リクエストボディ (payload)
const data = null;

axios.delete("https://api.maiagent.ai/api/v1/scim/550e8400-e29b-41d4-a716-446655440000/Groups/550e8400-e29b-41d4-a716-446655440000", data, config)
  .then(response => {
    console.log('レスポンスを正常に取得しました:');
    console.log(response.data);
  })
  .catch(error => {
    console.error('リクエストでエラーが発生しました:');
    console.error(error.response?.data || error.message);
  });
```

{% endtab %}

{% tab title="Python" %}

```python
import requests

url = "https://api.maiagent.ai/api/v1/scim/550e8400-e29b-41d4-a716-446655440000/Groups/550e8400-e29b-41d4-a716-446655440000"
headers = {
    "Authorization": "Bearer YOUR_SCIM_TOKEN"
}


response = requests.delete(url, headers=headers)
try:
    print("レスポンスを正常に取得しました:")
    print(response.json())
except Exception as e:
    print("リクエストでエラーが発生しました:", e)
```

{% endtab %}

{% tab title="PHP" %}

```php
<?php
require 'vendor/autoload.php';

$client = new GuzzleHttp\Client();

try {
    $response = $client->delete("https://api.maiagent.ai/api/v1/scim/550e8400-e29b-41d4-a716-446655440000/Groups/550e8400-e29b-41d4-a716-446655440000", [
        'headers' => [
            'Authorization' => 'Bearer YOUR_SCIM_TOKEN'
        ]
    ]);
    
    $data = json_decode($response->getBody(), true);
    echo "レスポンスを正常に取得しました:\n";
    print_r($data);
} catch (Exception $e) {
    echo 'リクエストでエラーが発生しました: ' . $e->getMessage();
}
?>
```

{% endtab %}
{% endtabs %}

#### レスポンス内容

| ステータスコード | 説明                                                                 |
| -------- | ------------------------------------------------------------------ |
| 204      | No response body                                                   |
| 4XX      | Error response; X-Error-Code carries its code (see "Error codes"). |

***


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.maiagent.ai/api/ja/api-reference/scim.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
