> 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/jue-se-he-quan-xian.md).

# ロールと権限

### ロールの作成 <a href="#organizations-groups-create" id="organizations-groups-create"></a>

POST `/api/v1/organizations/{organizationPk}/groups/`

#### パラメータ

| パラメータ名           | 必須 | 型      | 説明                                   |
| ---------------- | -- | ------ | ------------------------------------ |
| `organizationPk` | ✅  | string | A UUID string identifying this 組織 ID |

#### リクエストボディ

**リクエストパラメータ**

| フィールド                    | 型              | 必須  | 説明                                                                                                                                                                                                          |
| ------------------------ | -------------- | --- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| name                     | string         | はい  |                                                                                                                                                                                                             |
| organization             | string (uuid)  | いいえ |                                                                                                                                                                                                             |
| permissions              | array\[string] | はい  |                                                                                                                                                                                                             |
| canCreateChatbot         | boolean        | いいえ |                                                                                                                                                                                                             |
| canCreateKnowledgeBase   | boolean        | いいえ |                                                                                                                                                                                                             |
| canCreateInbox           | boolean        | いいえ |                                                                                                                                                                                                             |
| canCreateDatabase        | boolean        | いいえ |                                                                                                                                                                                                             |
| canCreateTool            | boolean        | いいえ |                                                                                                                                                                                                             |
| canCreateAgentUiTool     | boolean        | いいえ |                                                                                                                                                                                                             |
| canCreateSkill           | boolean        | いいえ |                                                                                                                                                                                                             |
| maigptCanCodeInterpreter | boolean        | いいえ | Whether members of this role may use the code interpreter built-in tool in MaiGPT.                                                                                                                          |
| maigptCanRag             | boolean        | いいえ | Whether members of this role may use the knowledge base RAG built-in tool in MaiGPT.                                                                                                                        |
| maigptCanDeepResearch    | boolean        | いいえ | Whether members of this role may use Deep Research in MaiGPT. Deep Research reaches the public internet through its own built-in search, so a role that revokes the official web-search tools needs this... |
| maigptCanBrowserTool     | boolean        | いいえ | Whether members of this role may use the browser built-in tool in MaiGPT.                                                                                                                                   |
| maigptAllLlms            | boolean        | いいえ | Whether members of this role may use every organization-available LLM in MaiGPT. Off = only the bound LLMs; an empty binding then means none.                                                               |
| maigptAllTools           | boolean        | いいえ | Whether members of this role may call every official (global) tool in MaiGPT. Off = only the bound tools; an empty binding then means none.                                                                 |
| maigptAllConnectors      | boolean        | いいえ | Whether members of this role may call every official (global) MCP connector in MaiGPT. Off = only the bound connectors; an empty binding then means none.                                                   |
| maigptAllSkills          | boolean        | いいえ | Whether members of this role may use every official (global) skill in MaiGPT. Off = only the bound skills; an empty binding then means none.                                                                |
| usageStatisticsScope     | object         | いいえ | What this role's usage statistics permission shows: the whole organization, or only the AI assistants granted to the member's roles. A member with any organization-wide granting role sees the whole or... |
| allowedLlms              | array\[string] | いいえ |                                                                                                                                                                                                             |
| allowedTools             | array\[string] | いいえ |                                                                                                                                                                                                             |
| allowedConnectors        | array\[string] | いいえ |                                                                                                                                                                                                             |
| allowedSkills            | array\[string] | いいえ |                                                                                                                                                                                                             |

**リクエストスキーマの例**

```typescript
{
  "name": string
  "organization"?: string (uuid) // 任意
  "permissions": [
    string (uuid)
  ]
  "canCreateChatbot"?: boolean // 任意
  "canCreateKnowledgeBase"?: boolean // 任意
  "canCreateInbox"?: boolean // 任意
  "canCreateDatabase"?: boolean // 任意
  "canCreateTool"?: boolean // 任意
  "canCreateAgentUiTool"?: boolean // 任意
  "canCreateSkill"?: boolean // 任意
  "maigptCanCodeInterpreter"?: boolean // Whether members of this role may use the code interpreter built-in tool in MaiGPT. (任意)
  "maigptCanRag"?: boolean // Whether members of this role may use the knowledge base RAG built-in tool in MaiGPT. (任意)
  "maigptCanDeepResearch"?: boolean // Whether members of this role may use Deep Research in MaiGPT. Deep Research reaches the public internet through its own built-in search, so a role that revokes the official web-search tools needs this switch too. (任意)
  "maigptCanBrowserTool"?: boolean // Whether members of this role may use the browser built-in tool in MaiGPT. (任意)
  "maigptAllLlms"?: boolean // Whether members of this role may use every organization-available LLM in MaiGPT. Off = only the bound LLMs; an empty binding then means none. (任意)
  "maigptAllTools"?: boolean // Whether members of this role may call every official (global) tool in MaiGPT. Off = only the bound tools; an empty binding then means none. (任意)
  "maigptAllConnectors"?: boolean // Whether members of this role may call every official (global) MCP connector in MaiGPT. Off = only the bound connectors; an empty binding then means none. (任意)
  "maigptAllSkills"?: boolean // Whether members of this role may use every official (global) skill in MaiGPT. Off = only the bound skills; an empty binding then means none. (任意)
  "usageStatisticsScope"?:  // What this role's usage statistics permission shows: the whole organization, or only the AI assistants granted to the member's roles. A member with any organization-wide granting role sees the whole organization.

* `organization` - Organization-wide
* `accessible_chatbots` - Authorized AI assistants only (任意)
  {
  }
  "allowedLlms"?: [ // 任意
    string (uuid)
  ]
  "allowedTools"?: [ // 任意
    string (uuid)
  ]
  "allowedConnectors"?: [ // 任意
    string (uuid)
  ]
  "allowedSkills"?: [ // 任意
    string (uuid)
  ]
}
```

**リクエスト値の例**

```json
{
  "name": "名前の例",
  "organization": "550e8400-e29b-41d4-a716-446655440000",
  "permissions": [
    "550e8400-e29b-41d4-a716-446655440000"
  ],
  "canCreateChatbot": true,
  "canCreateKnowledgeBase": true,
  "canCreateInbox": true,
  "canCreateDatabase": true,
  "canCreateTool": true,
  "canCreateAgentUiTool": true,
  "canCreateSkill": true,
  "maigptCanCodeInterpreter": true,
  "maigptCanRag": true,
  "maigptCanDeepResearch": true,
  "maigptCanBrowserTool": true,
  "maigptAllLlms": true,
  "maigptAllTools": true,
  "maigptAllConnectors": true,
  "maigptAllSkills": true,
  "usageStatisticsScope": {},
  "allowedLlms": [
    "550e8400-e29b-41d4-a716-446655440000"
  ],
  "allowedTools": [
    "550e8400-e29b-41d4-a716-446655440000"
  ],
  "allowedConnectors": [
    "550e8400-e29b-41d4-a716-446655440000"
  ],
  "allowedSkills": [
    "550e8400-e29b-41d4-a716-446655440000"
  ]
}
```

#### コード例

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

```bash
# API 呼び出しの例 (Shell)
curl -X POST "https://api.maiagent.ai/api/v1/organizations/550e8400-e29b-41d4-a716-446655440000/groups/" \
  -H "Authorization: Api-Key YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "名前の例",
    "organization": "550e8400-e29b-41d4-a716-446655440000",
    "permissions": [
      "550e8400-e29b-41d4-a716-446655440000"
    ],
    "canCreateChatbot": true,
    "canCreateKnowledgeBase": true,
    "canCreateInbox": true,
    "canCreateDatabase": true,
    "canCreateTool": true,
    "canCreateAgentUiTool": true,
    "canCreateSkill": true,
    "maigptCanCodeInterpreter": true,
    "maigptCanRag": true,
    "maigptCanDeepResearch": true,
    "maigptCanBrowserTool": true,
    "maigptAllLlms": true,
    "maigptAllTools": true,
    "maigptAllConnectors": true,
    "maigptAllSkills": true,
    "usageStatisticsScope": {},
    "allowedLlms": [
      "550e8400-e29b-41d4-a716-446655440000"
    ],
    "allowedTools": [
      "550e8400-e29b-41d4-a716-446655440000"
    ],
    "allowedConnectors": [
      "550e8400-e29b-41d4-a716-446655440000"
    ],
    "allowedSkills": [
      "550e8400-e29b-41d4-a716-446655440000"
    ]
  }'

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

{% endtab %}

{% tab title="JavaScript" %}

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

// リクエストヘッダーを設定します
const config = {
  headers: {
    'Authorization': 'Api-Key YOUR_API_KEY',
    'Content-Type': 'application/json'
  }
};

// リクエストボディ (payload)
const data = {
    "name": "名前の例",
    "organization": "550e8400-e29b-41d4-a716-446655440000",
    "permissions": [
      "550e8400-e29b-41d4-a716-446655440000"
    ],
    "canCreateChatbot": true,
    "canCreateKnowledgeBase": true,
    "canCreateInbox": true,
    "canCreateDatabase": true,
    "canCreateTool": true,
    "canCreateAgentUiTool": true,
    "canCreateSkill": true,
    "maigptCanCodeInterpreter": true,
    "maigptCanRag": true,
    "maigptCanDeepResearch": true,
    "maigptCanBrowserTool": true,
    "maigptAllLlms": true,
    "maigptAllTools": true,
    "maigptAllConnectors": true,
    "maigptAllSkills": true,
    "usageStatisticsScope": {},
    "allowedLlms": [
      "550e8400-e29b-41d4-a716-446655440000"
    ],
    "allowedTools": [
      "550e8400-e29b-41d4-a716-446655440000"
    ],
    "allowedConnectors": [
      "550e8400-e29b-41d4-a716-446655440000"
    ],
    "allowedSkills": [
      "550e8400-e29b-41d4-a716-446655440000"
    ]
  };

axios.post("https://api.maiagent.ai/api/v1/organizations/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/organizations/550e8400-e29b-41d4-a716-446655440000/groups/"
headers = {
    "Authorization": "Api-Key YOUR_API_KEY",
    "Content-Type": "application/json"
}

# リクエストボディ (payload)
data = {
    "name": "名前の例",
    "organization": "550e8400-e29b-41d4-a716-446655440000",
    "permissions": [
        "550e8400-e29b-41d4-a716-446655440000"
    ],
    "canCreateChatbot": True,
    "canCreateKnowledgeBase": True,
    "canCreateInbox": True,
    "canCreateDatabase": True,
    "canCreateTool": True,
    "canCreateAgentUiTool": True,
    "canCreateSkill": True,
    "maigptCanCodeInterpreter": True,
    "maigptCanRag": True,
    "maigptCanDeepResearch": True,
    "maigptCanBrowserTool": True,
    "maigptAllLlms": True,
    "maigptAllTools": True,
    "maigptAllConnectors": True,
    "maigptAllSkills": True,
    "usageStatisticsScope": {},
    "allowedLlms": [
        "550e8400-e29b-41d4-a716-446655440000"
    ],
    "allowedTools": [
        "550e8400-e29b-41d4-a716-446655440000"
    ],
    "allowedConnectors": [
        "550e8400-e29b-41d4-a716-446655440000"
    ],
    "allowedSkills": [
        "550e8400-e29b-41d4-a716-446655440000"
    ]
}

response = requests.post(url, json=data, 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/organizations/550e8400-e29b-41d4-a716-446655440000/groups/", [
        'headers' => [
            'Authorization' => 'Api-Key YOUR_API_KEY',
            'Content-Type' => 'application/json'
        ],
        'json' => [
            'name' => '名前の例',
            'organization' => '550e8400-e29b-41d4-a716-446655440000',
            'permissions' => [
                '550e8400-e29b-41d4-a716-446655440000'
            ],
            'canCreateChatbot' => true,
            'canCreateKnowledgeBase' => true,
            'canCreateInbox' => true,
            'canCreateDatabase' => true,
            'canCreateTool' => true,
            'canCreateAgentUiTool' => true,
            'canCreateSkill' => true,
            'maigptCanCodeInterpreter' => true,
            'maigptCanRag' => true,
            'maigptCanDeepResearch' => true,
            'maigptCanBrowserTool' => true,
            'maigptAllLlms' => true,
            'maigptAllTools' => true,
            'maigptAllConnectors' => true,
            'maigptAllSkills' => true,
            'usageStatisticsScope' => new \stdClass(),
            'allowedLlms' => [
                '550e8400-e29b-41d4-a716-446655440000'
            ],
            'allowedTools' => [
                '550e8400-e29b-41d4-a716-446655440000'
            ],
            'allowedConnectors' => [
                '550e8400-e29b-41d4-a716-446655440000'
            ],
            'allowedSkills' => [
                '550e8400-e29b-41d4-a716-446655440000'
            ]
        ]
    ]);
    
    $data = json_decode($response->getBody(), true);
    echo "レスポンスを正常に取得しました:\n";
    print_r($data);
} catch (Exception $e) {
    echo 'リクエストでエラーが発生しました: ' . $e->getMessage();
}
?>
```

{% endtab %}
{% endtabs %}

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

**ステータスコード: 201**

**レスポンススキーマの例**

```typescript
{
  "id": string (uuid)
  "name": string
  "type": 
  {
  }
  "permissions": [
    object
  ]
  "membersPreview": [
    string
  ]
  "membersCount": integer // 残りのメンバー数（リストに表示される 3 人を差し引いた数）を返します。フロントエンドの +N バッジ表示に使用します

リソースの count とは異なります：
- members_count: total - 3 を返します（+N バッジ用）。None は総数が <= 3 であることを示します
- chatbots_count/knowledge_bases_count/inboxes_count: 総数を返します
  "chatbotsCount": integer
  "chatbotsPreview": [
    string
  ]
  "knowledgeBasesCount": integer
  "knowledgeBasesPreview": [
    string
  ]
  "inboxesCount": integer
  "inboxesPreview": [
    string
  ]
  "databasesCount": integer
  "databasesPreview": [
    string
  ]
  "canCreateChatbot"?: boolean // 任意
  "canCreateKnowledgeBase"?: boolean // 任意
  "canCreateInbox"?: boolean // 任意
  "canCreateDatabase"?: boolean // 任意
  "canCreateTool"?: boolean // 任意
  "canCreateAgentUiTool"?: boolean // 任意
  "canCreateSkill"?: boolean // 任意
  "maigptCanCodeInterpreter"?: boolean // Whether members of this role may use the code interpreter built-in tool in MaiGPT. (任意)
  "maigptCanRag"?: boolean // Whether members of this role may use the knowledge base RAG built-in tool in MaiGPT. (任意)
  "maigptCanDeepResearch"?: boolean // Whether members of this role may use Deep Research in MaiGPT. Deep Research reaches the public internet through its own built-in search, so a role that revokes the official web-search tools needs this switch too. (任意)
  "maigptCanBrowserTool"?: boolean // Whether members of this role may use the browser built-in tool in MaiGPT. (任意)
  "maigptAllLlms"?: boolean // Whether members of this role may use every organization-available LLM in MaiGPT. Off = only the bound LLMs; an empty binding then means none. (任意)
  "maigptAllTools"?: boolean // Whether members of this role may call every official (global) tool in MaiGPT. Off = only the bound tools; an empty binding then means none. (任意)
  "maigptAllConnectors"?: boolean // Whether members of this role may call every official (global) MCP connector in MaiGPT. Off = only the bound connectors; an empty binding then means none. (任意)
  "maigptAllSkills"?: boolean // Whether members of this role may use every official (global) skill in MaiGPT. Off = only the bound skills; an empty binding then means none. (任意)
  "usageStatisticsScope"?:  // What this role's usage statistics permission shows: the whole organization, or only the AI assistants granted to the member's roles. A member with any organization-wide granting role sees the whole organization.

* `organization` - Organization-wide
* `accessible_chatbots` - Authorized AI assistants only (任意)
  {
  }
  "createdAt": string (timestamp)
}
```

**レスポンス値の例**

```json
{
  "id": "550e8400-e29b-41d4-a716-446655440000",
  "name": "レスポンス文字列",
  "type": {},
  "permissions": [
    {
      "id": "550e8400-e29b-41d4-a716-446655440000",
      "name": "レスポンス名の例",
      "description": "レスポンスの説明の例"
    }
  ],
  "membersPreview": [
    "レスポンス文字列"
  ],
  "membersCount": 456,
  "chatbotsCount": 456,
  "chatbotsPreview": [
    "レスポンス文字列"
  ],
  "knowledgeBasesCount": 456,
  "knowledgeBasesPreview": [
    "レスポンス文字列"
  ],
  "inboxesCount": 456,
  "inboxesPreview": [
    "レスポンス文字列"
  ],
  "databasesCount": 456,
  "databasesPreview": [
    "レスポンス文字列"
  ],
  "canCreateChatbot": false,
  "canCreateKnowledgeBase": false,
  "canCreateInbox": false,
  "canCreateDatabase": false,
  "canCreateTool": false,
  "canCreateAgentUiTool": false,
  "canCreateSkill": false,
  "maigptCanCodeInterpreter": false,
  "maigptCanRag": false,
  "maigptCanDeepResearch": false,
  "maigptCanBrowserTool": false,
  "maigptAllLlms": false,
  "maigptAllTools": false,
  "maigptAllConnectors": false,
  "maigptAllSkills": false,
  "usageStatisticsScope": {},
  "createdAt": "レスポンス文字列"
}
```

***

### ロールメンバーの一括追加 <a href="#organizations-groups-group-members-bulk-create-create" id="organizations-groups-group-members-bulk-create-create"></a>

POST `/api/v1/organizations/{organizationPk}/groups/{groupPk}/group-members/bulk-create/`

#### パラメータ

| パラメータ名           | 必須 | 型      | 説明                                   |
| ---------------- | -- | ------ | ------------------------------------ |
| `groupPk`        | ✅  | string |                                      |
| `organizationPk` | ✅  | string | A UUID string identifying this 組織 ID |

#### リクエスト内容

**リクエストパラメータ**

| フィールド   | 型              | 必須 | 説明 |
| ------- | -------------- | -- | -- |
| members | array\[string] | はい |    |

**リクエスト構造の例**

```typescript
{
  "members": [
    string (uuid)
  ]
}
```

**リクエスト値の例**

```json
{
  "members": [
    "550e8400-e29b-41d4-a716-446655440000"
  ]
}
```

#### コードサンプル

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

```bash
# API 呼び出しのサンプル (Shell)
curl -X POST "https://api.maiagent.ai/api/v1/organizations/550e8400-e29b-41d4-a716-446655440000/groups/550e8400-e29b-41d4-a716-446655440000/group-members/bulk-create/" \
  -H "Authorization: Api-Key YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "members": [
      "550e8400-e29b-41d4-a716-446655440000"
    ]
  }'

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

{% endtab %}

{% tab title="JavaScript" %}

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

// リクエストヘッダーを設定します
const config = {
  headers: {
    'Authorization': 'Api-Key YOUR_API_KEY',
    'Content-Type': 'application/json'
  }
};

// リクエストボディ (payload)
const data = {
    "members": [
      "550e8400-e29b-41d4-a716-446655440000"
    ]
  };

axios.post("https://api.maiagent.ai/api/v1/organizations/550e8400-e29b-41d4-a716-446655440000/groups/550e8400-e29b-41d4-a716-446655440000/group-members/bulk-create/", 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/organizations/550e8400-e29b-41d4-a716-446655440000/groups/550e8400-e29b-41d4-a716-446655440000/group-members/bulk-create/"
headers = {
    "Authorization": "Api-Key YOUR_API_KEY",
    "Content-Type": "application/json"
}

# リクエストボディ (payload)
data = {
    "members": [
        "550e8400-e29b-41d4-a716-446655440000"
    ]
}

response = requests.post(url, json=data, 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/organizations/550e8400-e29b-41d4-a716-446655440000/groups/550e8400-e29b-41d4-a716-446655440000/group-members/bulk-create/", [
        'headers' => [
            'Authorization' => 'Api-Key YOUR_API_KEY',
            'Content-Type' => 'application/json'
        ],
        'json' => [
            'members' => [
                '550e8400-e29b-41d4-a716-446655440000'
            ]
        ]
    ]);
    
    $data = json_decode($response->getBody(), true);
    echo "レスポンスを正常に取得しました:\n";
    print_r($data);
} catch (Exception $e) {
    echo 'リクエストでエラーが発生しました: ' . $e->getMessage();
}
?>
```

{% endtab %}
{% endtabs %}

#### レスポンス内容

**ステータスコード: 201**

**レスポンス構造の例**

```typescript
[
  {
    "id"?: string (uuid) // ロールメンバー ID (任意)
    "member"?: { // 任意
    {
      "id"?: string (uuid) // メンバー ID (任意)
      "name"?: string // メンバー名 (任意)
      "email"?: string (email) // メンバーのメールアドレス (任意)
      "organization"?: { // 任意
      {
        "id"?: string (uuid) // 組織 ID (任意)
        "name"?: string // 組織名 (任意)
        "createdAt"?: string // 組織の作成タイムスタンプ (任意)
        "usageStatistics"?: { // 任意
        {
          "chatbotsCount"?: integer // チャットボット数 (任意)
          "countableChatbotsCount"?: integer // 作成枠を消費するチャットボット数（モードがプランの許可リストに含まれないものは除外） (任意)
          "exemptChatbotsByMode"?: object // 枠を消費しないチャットボット数（対象外となるモードごとにグループ化） (任意)
          "canCreateChatbot"?: boolean // チャットボットを作成できるかどうか (任意)
          "createChatbotLimit"?: integer // 作成できるチャットボット数の上限（-1 は無制限、0 は作成禁止） (任意)
          "currentMonthWordsCountTotal"?: integer // 当月の総文字数の上限 (任意)
          "currentMonthUsedWordsCountTotal"?: integer // 当月の使用済み文字数 (任意)
          "currentMonthUsedConversationsCountTotal"?: integer // 当月の使用済み会話数 (任意)
          "availableUploadFilesSizeTotal"?: integer // アップロード可能なファイルの合計サイズ (任意)
          "usedUploadFileSizeTotal"?: integer // 使用済みのアップロードファイルサイズ (任意)
        }
        }
        "organizationPlan"?: { // 任意
        {
          "id"?: string (uuid) // プラン ID (任意)
          "planName"?: string // プラン名 (任意)
          "expiredAt"?: string // プランの有効期限 (任意)
        }
        }
      }
      }
      "isOwner"?: boolean // 組織のオーナーかどうか (任意)
      "permissions"?: { // 任意
      {
        "hasOrganizationAccessPermission"?: boolean // 組織へのアクセス権限があるかどうか (任意)
        "hasChatAccessPermission"?: boolean // チャットへのアクセス権限があるかどうか (任意)
        "hasConversationAccessPermission"?: boolean // 会話へのアクセス権限があるかどうか (任意)
        "hasChatbotAccessPermission"?: boolean // チャットボットへのアクセス権限があるかどうか (任意)
      }
      }
      "createdAt"?: string // メンバーの作成タイムスタンプ (任意)
    }
    }
    "createdAt"?: string // ロールメンバーの作成タイムスタンプ (任意)
  }
]
```

**レスポンス値の例**

```json
[
  {
    "id": "c1e54f04-01fc-45e9-b40c-9d8b37bd0ac0",
    "member": {
      "id": "af4e472d-3f9b-446b-bab8-05de4112d086",
      "name": "h",
      "email": "h@gmail.com",
      "organization": {
        "id": "670e3d30-9d24-47b4-b2cc-6bf224b2f3bb",
        "name": "Updated Org Name",
        "createdAt": "1745288290000",
        "usageStatistics": {
          "chatbotsCount": 1,
          "countableChatbotsCount": 1,
          "exemptChatbotsByMode": {},
          "canCreateChatbot": false,
          "createChatbotLimit": 1,
          "currentMonthWordsCountTotal": 1000000,
          "currentMonthUsedWordsCountTotal": 0,
          "currentMonthUsedConversationsCountTotal": 0,
          "availableUploadFilesSizeTotal": 104857600,
          "usedUploadFileSizeTotal": 0
        },
        "organizationPlan": {
          "id": "16136181-ae0d-4b3f-aaeb-9a6ed251459f",
          "planName": "無料プラン",
          "expiredAt": null
        }
      },
      "isOwner": false,
      "permissions": {
        "hasMaigptAccessPermission": false,
        "hasChatbotAccessPermission": false,
        "hasAgentopsAccessPermission": false,
        "hasConversationAccessPermission": false,
        "hasChatAccessPermission": false,
        "hasDeveloperAccessPermission": false,
        "hasOrganizationAccessPermission": true
      },
      "createdAt": "1748335331000"
    },
    "createdAt": "1748341252000"
  }
]
```

***

### ロールに AI アシスタントを一括割り当て <a href="#organizations-groups-group-chatbots-bulk-create-create" id="organizations-groups-group-chatbots-bulk-create-create"></a>

POST `/api/v1/organizations/{organizationPk}/groups/{groupPk}/group-chatbots/bulk-create/`

#### パラメーター

| パラメーター名          | 必須 | 型       | 説明                          |
| ---------------- | -- | ------- | --------------------------- |
| `groupPk`        | ✅  | string  |                             |
| `organizationPk` | ✅  | string  | この組織 ID を識別する UUID テキスト列です。 |
| `page`           | ❌  | integer | ページ分割された結果セット内のページ番号です。     |
| `pageSize`       | ❌  | integer | 1 ページあたりに返す結果数です。           |
| `query`          | ❌  | string  |                             |
| `search`         | ❌  | string  |                             |

#### リクエストボディ

**リクエストパラメーター**

| フィールド    | 型              | 必須 | 説明 |
| -------- | -------------- | -- | -- |
| chatbots | array\[string] | はい |    |

**リクエストスキーマの例**

```typescript
{
  "chatbots": [
    string (uuid)
  ]
}
```

**リクエスト値の例**

```json
{
  "chatbots": [
    "550e8400-e29b-41d4-a716-446655440000"
  ]
}
```

#### コード例

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

```bash
# API 呼び出し例 (Shell)
curl -X POST "https://api.maiagent.ai/api/v1/organizations/550e8400-e29b-41d4-a716-446655440000/groups/550e8400-e29b-41d4-a716-446655440000/group-chatbots/bulk-create/?page=1&pageSize=1&query=example&search=example" \
  -H "Authorization: Api-Key YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "chatbots": [
      "550e8400-e29b-41d4-a716-446655440000"
    ]
  }'

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

{% endtab %}

{% tab title="JavaScript" %}

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

// リクエストヘッダーを設定します
const config = {
  headers: {
    'Authorization': 'Api-Key YOUR_API_KEY',
    'Content-Type': 'application/json'
  }
};

// リクエストボディ (payload)
const data = {
    "chatbots": [
      "550e8400-e29b-41d4-a716-446655440000"
    ]
  };

axios.post("https://api.maiagent.ai/api/v1/organizations/550e8400-e29b-41d4-a716-446655440000/groups/550e8400-e29b-41d4-a716-446655440000/group-chatbots/bulk-create/?page=1&pageSize=1&query=example&search=example", 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/organizations/550e8400-e29b-41d4-a716-446655440000/groups/550e8400-e29b-41d4-a716-446655440000/group-chatbots/bulk-create/?page=1&pageSize=1&query=example&search=example"
headers = {
    "Authorization": "Api-Key YOUR_API_KEY",
    "Content-Type": "application/json"
}

# リクエストボディ (payload)
data = {
    "chatbots": [
        "550e8400-e29b-41d4-a716-446655440000"
    ]
}

response = requests.post(url, json=data, 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/organizations/550e8400-e29b-41d4-a716-446655440000/groups/550e8400-e29b-41d4-a716-446655440000/group-chatbots/bulk-create/?page=1&pageSize=1&query=example&search=example", [
        'headers' => [
            'Authorization' => 'Api-Key YOUR_API_KEY',
            'Content-Type' => 'application/json'
        ],
        'json' => [
            'chatbots' => [
                '550e8400-e29b-41d4-a716-446655440000'
            ]
        ]
    ]);
    
    $data = json_decode($response->getBody(), true);
    echo "レスポンスを通常に取得しました:\n";
    print_r($data);
} catch (Exception $e) {
    echo 'リクエストエラーが発生しました: ' . $e->getMessage();
}
?>
```

{% endtab %}
{% endtabs %}

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

**ステータスコード: 201**

**レスポンススキーマの例**

```typescript
{
  "count": integer
  "next"?: string (uri) // 省略可能
  "previous"?: string (uri) // 省略可能
  "results": [
    {
      "id": string (uuid)
      "group": string (uuid)
      "chatbot": 
      {
        "id": string (uuid)
        "name": string // チャットボット名です。Agent モードでは意味を持ちますが、他のモードではチャットボットの識別にのみ使用されます。
        "largeLanguageModel": string (uuid) // チャットボットが回答生成に使用する大規模言語モデルです（組織独自の AI Gateway モデルを含みます）。作成時に省略できるのは、組織の AI アシスタントのデフォルト設定でデフォルトモデルが設定されている場合のみです。
        "llm":  // 紐付けられたモデルの id、name、提供終了情報です。外部キーから直接取得するため、組織がモデルを無効にしていても返されます。
        {
          "id": string (uuid)
          "name": string
          "retiresAt": string (date) // プロバイダーによる提供終了日です。この日を過ぎると、毎日の定期処理がアシスタントを replacement に切り替え、このモデルを無効にします。null は提供終了が未定であることを示します。
          "replacement":  // 提供終了後の代替モデル（id と name）です。null は未指定を示し、提供終了時に自動移行しません。
          {
            "id": string (uuid)
            "name": string
          }
        }
        "organizationEnforcedSettings": [ // 組織の AI アシスタントのデフォルト設定によって、このアシスタントに強制適用される設定コードです（同 API のキーと一致します）。これらのフィールドは強制適用された値を返し、異なる値での更新は拒否されます（読み取り専用です。公式組み込み Agent と MaiGPT では空になります）。
          string
        ]
        "embeddingModel"?: string (uuid) // テキストのベクトル化に使用する埋め込みモデルです。省略可能です。 (省略可能)
        "rerankerModel"?: string (uuid) // 再ランキングに使用するモデルです。省略可能です。 (省略可能)
        "instructions"?: string // チャットボットの役割と動作を定義するロール指示です。 (省略可能)
        "knowledgeBases"?: [ // チャットボットがアクセスできるナレッジベースの一覧です。 (省略可能)
          {
            "id": string (uuid)
            "name": string
          }
        ]
        "databases"?: [ // チャットボットがアクセスできる SQL データベースの一覧です（Text-to-SQL 機能用）。 (省略可能)
          {
            "id": string (uuid)
            "name": string
          }
        ]
        "updatedAt": string (timestamp)
        "organization"?: string (uuid) // チャットボットが所属する組織です。空の場合は個人用チャットボットです。 (省略可能)
        "replyMode"?:  // 応答モードです。通常応答またはストリーミング応答を指定します。

* `normal` - 通常
* `template` - テンプレート
* `hybrid` - ハイブリッド
* `agent` - エージェント (省略可能)
        {
        }
        "template"?: string // Template モードと Hybrid モードで使用するテンプレートです。 (省略可能)
        "unanswerableTemplate"?: string // 質問に回答できない場合に Template モードと Hybrid モードで使用するテンプレートです。 (省略可能)
        "totalWordsCount"?: integer (int64) // 使用した累積総単語数です。 (省略可能)
        "outputMode"?:  // 出力モードです。テキスト、表、またはカスタム形式を指定します。

* `text` - テキスト
* `json_schema` - JSON Schema (省略可能)
        {
        }
        "rawOutputFormat"?: object // カスタム出力形式の JSON スキーマ定義です。 (省略可能)
        "groups"?: [ // チャットボットがアクセスできるグループの一覧です。 (省略可能)
          {
            "id": string (uuid)
            "name": string
          }
        ]
        "tools"?: [ // チャットボットが使用できるツールの一覧です。 (省略可能)
          {
            "id": string (uuid)
            "name": string
            "description": string
            "displayName": string
            "toolType": string
          }
        ]
        "skills"?: [ // チャットボットに関連付けられたスキルの一覧です。 (省略可能)
          {
            "id": string (uuid)
            "name": string
            "description": string
          }
        ]
        "connectors"?: [ // このチャットボットに関連付けられ、連絡先ごとの OAuth 認可を制御するコネクタです。 (省略可能)
          {
            "id": string (uuid)
            "name": string
          }
        ]
        "agentMode"?:  // エージェントモードです。通常、SQL、またはワークフローモードを指定します。

* `normal` - 通常
* `canvas` - キャンバス
* `team` - チーム (省略可能)
        {
        }
        "numberOfRetrievedChunks"?: integer // 取得する参照チャンク数です。デフォルトは 12、最小値は 1 です。 (省略可能)
        "defaultLabelRelations"?: object // アシスタント単位のデフォルトのナレッジベースラベルフィルターです。形式は query_metadata.label_relations と同じで、null はフィルタリングしないことを示します。呼び出し元が query_metadata を指定しなかった場合のみ、最も優先度の低いフォールバックとして適用されます。 (省略可能)
        "useFullRetrievalRange"?: boolean // 有効にすると、LLM の top_k による切り詰めを無視し、再ランキング結果をすべて返します。 (省略可能)
        "enableEvaluation"?: boolean // 省略可能
        "enableInlineCitations"?: boolean // インライン引用を有効にし、[1][2] などの引用マーカーを回答に挿入します。 (省略可能)
        "enableCodeInterpreter"?: boolean // 有効にすると、隔離されたコンテナでコードを実行する Code Interpreter ツールを提供します。 (省略可能)
        "enableBrowserTool"?: boolean // Web タスク用のブラウザー自動操作ツールを有効にします。 (省略可能)
        "enableImageSearch"?: boolean // 関連付けられたナレッジベースのいずれかがマルチモーダル埋め込みモデルを使用している場合に image_search ツールを提供します。無効にするとツールを完全に削除します。 (省略可能)
        "enableClaudeStreamRetry"?: boolean // Claude のストリーミング呼び出しが最初のチャンクまたは途中で停止した場合、呼び出しを中断し、非ストリーミングモードで 1 回再試行します。途中の再試行ではリセット信号を送り、クライアントが表示済みの部分出力を破棄できるようにします。再試行ごとに同じプロンプトに対する追加料金が発生します。 (省略可能)
        "customMaxLlmOutputTokens"?: integer // LLM の最大出力トークン数を指定します。最小値は 512 です。 (省略可能)
        "voiceConfig"?: { // 省略可能
        {
          "enabled"?: boolean // このチャットボットを音声エージェントとして使用できるかどうかを示します。プラットフォームごとのスイッチではなく、すべての会話プラットフォーム（WebChat、SIP 電話、管理画面／マーケットプレイスの音声テスト）がこの値を確認します。 (省略可能)
          "voiceAgentType"?: string (uuid) // 音声エージェントのモード種別です。 (省略可能)
          "sttProvider"?: string (uuid) // 音声認識サービスのプロバイダーです。 (省略可能)
          "sttConfig"?: object // STT の設定パラメーターです（JSON）。 (省略可能)
          "ttsProvider"?: string (uuid) // 音声合成サービスのプロバイダーです。 (省略可能)
          "ttsConfig"?: object // TTS の設定パラメーターです（JSON）。 (省略可能)
          "realtimeProvider"?: string (uuid) // Realtime エンドツーエンド音声モデルのプロバイダーです。 (省略可能)
          "realtimeConfig"?: object // Realtime の設定パラメーターです（JSON）。 (省略可能)
          "realtimeInstructions"?: string // リアルタイム音声セッション専用のプロンプトです。空の場合はチャットボットの指示を使用します。 (省略可能)
          "turnHandling"?: object // 音声エージェントの発話交代と割り込みに関する設定です。 (省略可能)
          "enableVoiceReply"?: boolean // 無効にすると、音声エージェントはテキストのみで応答し、発話しません。 (省略可能)
        }
        }
        "thinkingConfig"?: object // 思考レベルです。null（モデルのデフォルト）または {"reasoning_effort": "off|minimal|low|medium|high|xhigh|max"} を指定します。 (省略可能)
        "enableToolSearching"?: boolean // 旧フィールドです。代わりに tool_loading_mode を使用してください。true の書き込みは tool_loading_mode=search、false は all に相当します。両方を指定した場合は tool_loading_mode が優先されます。読み取り時は、ツールの読み込み方式が全件読み込み以外かどうかを返します。 (省略可能)
        "toolLoadingMode"?:  // ツールの読み込み方式です。auto（そのターンで利用可能なツール数とモデルに応じて自動選択）、all（すべて読み込み）、search（動的検索）を指定します。新規アシスタントのデフォルトは auto です。未設定の既存アシスタントは、旧スイッチから変換した値を返します（オン→search、オフ→all）。

* `auto` - 自動
* `all` - すべて読み込み
* `search` - 動的検索 (省略可能)
        {
        }
        "maxAgentIterations"?: integer // AgentWorkflow の最大反復回数です（1～100、デフォルト: 20）。 (省略可能)
        "agentTimeoutSeconds"?: integer // AgentWorkflow の実行タイムアウト時間です（秒単位、30～1200、デフォルト: 600）。 (省略可能)
        "agentTimeoutMessage"?: string // AgentWorkflow がタイムアウトしたときにユーザーに表示するカスタムメッセージです（最大 500 文字）。空の場合はシステムのデフォルトを使用します。 (省略可能)
        "requireTextWithFlexCards"?: boolean // 有効にすると、ユーザー向けのテキストがなく Flex Message カードのみで終了するターンを LLM に 1 回再送し、先にテキストを作成してからカードを送信するよう求めます。再試行ごとに同じプロンプトに対する追加料金が発生します。 (省略可能)
        "isMultimodalLlm": boolean // チャットボットの LLM がマルチモーダルに対応しているかどうかを示します（読み取り専用）。
        "enableSizeBasedToolResultTruncation"?: boolean // 有効にすると、文字数のしきい値を超えるツール結果を会話履歴に書き込む際に、先頭と末尾、および省略部分に含まれる識別子を保持します。ナレッジベース、SQL、会話検索の結果は、この設定にかかわらず 100 文字で切り詰めます。コードインタープリターの bash 標準出力や Web 検索結果など、大きなツール出力によるメモリの肥大化を抑えます。 (省略可能)
        "toolResultMaxChars"?: integer // サイズに基づくツール結果の切り詰めの文字数しきい値です（500～50000）。enable_size_based_tool_result_truncation が True の場合のみ有効です。 (省略可能)
        "enableVectorMemory"?: boolean // 有効にすると、アーカイブ済みメッセージをベクトル化し、事実抽出を行って意味検索に使用します（従来の動作です）。無効にすると、アーカイブ済みメッセージを破棄し、複数ターンのコンテキストには現在のチャット履歴ウィンドウのみを使用します。 (省略可能)
        "longTermMemoryTopK"?: integer // 長期記憶の検索ごとに取得する記憶ノード数です（ベクトル検索の similarity_top_k）。デフォルトは 10、範囲は 1～50 です。 (省略可能)
        "enableCrossConversationSearch"?: boolean // 有効にすると、会話履歴ツールは指定した遡及期間内における、同じ受信トレイ内のこの連絡先の他の会話も対象にします。無効の場合は現在の会話のみを対象にします。 (省略可能)
        "crossConversationLookbackDays"?: integer // 会話をまたぐ検索で、各会話の最終メッセージから遡れる日数です（1～365 日）。空の場合は 90 日になります。enable_cross_conversation_search が True の場合のみ有効です。 (省略可能)
        "useGatewayFallback"?: boolean // 有効にすると、単一の LLM の代わりにフォールバックグループを使用します。 (省略可能)
        "gatewayFallbackGroup"?: string (uuid) // 省略可能
        "enableSearchMessagesTool"?: boolean // AI が現在の会話の過去のメッセージを検索できるようにします。 (省略可能)
        "enableGetMessageContextTool"?: boolean // AI が特定のメッセージの前後のメッセージを取得し、コンテキストとして使用できるようにします。 (省略可能)
        "enableReadAttachmentFullTextTool"?: boolean // AI がプレーンテキスト添付ファイルの全文を読めるようにします。AGENT モード専用です。 (省略可能)
        "enableParseAttachmentContentTool"?: boolean // AI が PDF、Office、音声などの添付ファイルを解析できるようにします。AGENT モード専用です。 (省略可能)
        "enableListAvailableParsersTool"?: boolean // AI が利用可能なパーサーとその機能を一覧表示できるようにします。AGENT モード専用です。 (省略可能)
        "enableGetDownloadLinkTool"?: boolean // AI が生成コンテンツの共有可能なダウンロードリンクを作成できるようにします。AGENT モード専用です。 (省略可能)
        "isLocked": boolean // ロックされたインスタンスです。設定は公式版に従い、専用ナレッジベースのみ変更できます。
        "sourceBuildInAgent": string (uuid) // レンタルによってインスタンス化された場合、公式の組み込み Agent のブループリントを参照します。
        "canUpdate": boolean // 現在のユーザーがこのリソースを更新できるかどうかを返します。
        "canDelete": boolean // 現在のユーザーがこのリソースを削除できるかどうかを返します。
        "team": 
        {
          "id": string (uuid)
          "name": string
        }
        "webChatIsActive"?: boolean // 省略可能で、作成時のみ有効です。Web ウィジェットチャネルを有効な状態で作成するかどうかを指定します。省略または null の場合、新規チャットボットチャネルに対する組織のデフォルトに従います（プラットフォーム管理者が有効にしていなければ無効です）。更新時は無視されるため、既存チャネルはチャネル設定から変更してください。 (省略可能)
        "apiIsActive"?: boolean // 省略可能で、作成時のみ有効です。API チャネルを有効な状態で作成するかどうかを指定します。省略または null の場合、新規チャットボットチャネルに対する組織のデフォルトに従います（プラットフォーム管理者が有効にしていなければ無効です）。更新時は無視されるため、既存チャネルはチャネル設定から変更してください。管理画面のチャネルは常に有効な状態で作成され、ここでは設定できません。 (省略可能)
        "fileWorkspaceMode"?:  // Work の内部会話におけるファイルワークスペースのモードです。none、bound、user_mount のいずれかです。

* `none` - なし
* `bound` - 紐付けられたワークスペース
* `user_mount` - ユーザーマウント (省略可能)
        {
        }
        "fileWorkspaceFolder"?: string (uuid) // 紐付けるワークスペース（フォルダー ID）です。モードが bound の場合は必須で、それ以外の場合はクリアされます。 (省略可能)
        "fileWorkspaceStatus": object // 読み取り専用です。{"folder": {"id", "name"} | null, "state": "ok" | "missing" | "builder_lost_edit" | null}
        "fileWorkspaceAvailable": boolean // 読み取り専用です。組織がファイルライブラリを持ち、このエージェントがファイルワークスペースを設定できるかどうかを示します。
      }
      "canRead"?: boolean // 省略可能
      "canUpdate"?: boolean // 省略可能
      "canDelete"?: boolean // 省略可能
      "createdAt": string (timestamp)
    }
  ]
}
```

**レスポンス値の例**

```json
{
  "count": 123,
  "next": "http://api.example.org/accounts/?page=4",
  "previous": "http://api.example.org/accounts/?page=2",
  "results": [
    {
      "id": "550e8400-e29b-41d4-a716-446655440000",
      "group": "550e8400-e29b-41d4-a716-446655440000",
      "chatbot": {
        "id": "550e8400-e29b-41d4-a716-446655440000",
        "name": "レスポンステキスト列",
        "largeLanguageModel": "550e8400-e29b-41d4-a716-446655440000",
        "llm": {
          "id": "550e8400-e29b-41d4-a716-446655440000",
          "name": "レスポンステキスト列",
          "retiresAt": "レスポンステキスト列",
          "replacement": {
            "id": "550e8400-e29b-41d4-a716-446655440000",
            "name": "レスポンステキスト列"
          }
        },
        "organizationEnforcedSettings": [
          "レスポンステキスト列"
        ],
        "embeddingModel": "550e8400-e29b-41d4-a716-446655440000",
        "rerankerModel": "550e8400-e29b-41d4-a716-446655440000",
        "instructions": "レスポンステキスト列",
        "knowledgeBases": [
          {
            "id": "550e8400-e29b-41d4-a716-446655440000",
            "name": "レスポンステキスト列"
          }
        ],
        "databases": [
          {
            "id": "550e8400-e29b-41d4-a716-446655440000",
            "name": "レスポンステキスト列"
          }
        ],
        "updatedAt": "レスポンステキスト列",
        "organization": "550e8400-e29b-41d4-a716-446655440000",
        "replyMode": {},
        "template": "レスポンステキスト列",
        "unanswerableTemplate": "レスポンステキスト列",
        "totalWordsCount": 456,
        "outputMode": {},
        "rawOutputFormat": null,
        "groups": [
          {
            "id": "550e8400-e29b-41d4-a716-446655440000",
            "name": "レスポンステキスト列"
          }
        ],
        "tools": [
          {
            "id": "550e8400-e29b-41d4-a716-446655440000",
            "name": "レスポンステキスト列",
            "description": "レスポンステキスト列",
            "displayName": "レスポンステキスト列",
            "toolType": "レスポンステキスト列"
          }
        ],
        "skills": [
          {
            "id": "550e8400-e29b-41d4-a716-446655440000",
            "name": "レスポンステキスト列",
            "description": "レスポンステキスト列"
          }
        ],
        "connectors": [
          {
            "id": "550e8400-e29b-41d4-a716-446655440000",
            "name": "レスポンステキスト列"
          }
        ],
        "agentMode": {},
        "numberOfRetrievedChunks": 456,
        "defaultLabelRelations": null,
        "useFullRetrievalRange": false,
        "enableEvaluation": false,
        "enableInlineCitations": false,
        "enableCodeInterpreter": false,
        "enableBrowserTool": false,
        "enableImageSearch": false,
        "enableClaudeStreamRetry": false,
        "customMaxLlmOutputTokens": 456,
        "voiceConfig": {
          "enabled": false,
          "voiceAgentType": "550e8400-e29b-41d4-a716-446655440000",
          "sttProvider": "550e8400-e29b-41d4-a716-446655440000",
          "sttConfig": null,
          "ttsProvider": "550e8400-e29b-41d4-a716-446655440000",
          "ttsConfig": null,
          "realtimeProvider": "550e8400-e29b-41d4-a716-446655440000",
          "realtimeConfig": null,
          "realtimeInstructions": "レスポンステキスト列",
          "turnHandling": null,
          "enableVoiceReply": false
        },
        "thinkingConfig": null,
        "enableToolSearching": false,
        "toolLoadingMode": {},
        "maxAgentIterations": 456,
        "agentTimeoutSeconds": 456,
        "agentTimeoutMessage": "レスポンステキスト列",
        "requireTextWithFlexCards": false,
        "isMultimodalLlm": false,
        "enableSizeBasedToolResultTruncation": false,
        "toolResultMaxChars": 456,
        "enableVectorMemory": false,
        "longTermMemoryTopK": 456,
        "enableCrossConversationSearch": false,
        "crossConversationLookbackDays": 456,
        "useGatewayFallback": false,
        "gatewayFallbackGroup": "550e8400-e29b-41d4-a716-446655440000",
        "enableSearchMessagesTool": false,
        "enableGetMessageContextTool": false,
        "enableReadAttachmentFullTextTool": false,
        "enableParseAttachmentContentTool": false,
        "enableListAvailableParsersTool": false,
        "enableGetDownloadLinkTool": false,
        "isLocked": false,
        "sourceBuildInAgent": "550e8400-e29b-41d4-a716-446655440000",
        "canUpdate": false,
        "canDelete": false,
        "team": {
          "id": "550e8400-e29b-41d4-a716-446655440000",
          "name": "レスポンステキスト列"
        },
        "webChatIsActive": false,
        "apiIsActive": false,
        "fileWorkspaceMode": {},
        "fileWorkspaceFolder": "550e8400-e29b-41d4-a716-446655440000",
        "fileWorkspaceStatus": {
          "name": "example.pdf",
          "content": "base64encoded_content",
          "contentType": "application/pdf"
        },
        "fileWorkspaceAvailable": false
      },
      "canRead": false,
      "canUpdate": false,
      "canDelete": false,
      "createdAt": "レスポンステキスト列"
    }
  ]
}
```

***

### 受信トレイをロールに一括割り当て <a href="#organizations-groups-group-inboxes-bulk-create-create" id="organizations-groups-group-inboxes-bulk-create-create"></a>

POST `/api/v1/organizations/{organizationPk}/groups/{groupPk}/group-inboxes/bulk-create/`

#### パラメータ

| パラメータ名           | 必須 | 型      | 説明                                   |
| ---------------- | -- | ------ | ------------------------------------ |
| `groupPk`        | ✅  | string |                                      |
| `organizationPk` | ✅  | string | A UUID string identifying this 組織 ID |

#### コードサンプル

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

```bash
# API 呼び出しのサンプル (Shell)
curl -X POST "https://api.maiagent.ai/api/v1/organizations/550e8400-e29b-41d4-a716-446655440000/groups/550e8400-e29b-41d4-a716-446655440000/group-inboxes/bulk-create/" \
  -H "Authorization: Api-Key YOUR_API_KEY"

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

{% endtab %}

{% tab title="JavaScript" %}

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

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

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

axios.post("https://api.maiagent.ai/api/v1/organizations/550e8400-e29b-41d4-a716-446655440000/groups/550e8400-e29b-41d4-a716-446655440000/group-inboxes/bulk-create/", 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/organizations/550e8400-e29b-41d4-a716-446655440000/groups/550e8400-e29b-41d4-a716-446655440000/group-inboxes/bulk-create/"
headers = {
    "Authorization": "Api-Key YOUR_API_KEY"
}


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/organizations/550e8400-e29b-41d4-a716-446655440000/groups/550e8400-e29b-41d4-a716-446655440000/group-inboxes/bulk-create/", [
        'headers' => [
            'Authorization' => 'Api-Key YOUR_API_KEY'
        ]
    ]);
    
    $data = json_decode($response->getBody(), true);
    echo "レスポンスを正常に取得しました:\n";
    print_r($data);
} catch (Exception $e) {
    echo 'リクエストエラーが発生しました: ' . $e->getMessage();
}
?>
```

{% endtab %}
{% endtabs %}

#### レスポンス

| ステータスコード | 説明               |
| -------- | ---------------- |
| 200      | No response body |

***

### ロールへのナレッジベースの一括割り当て <a href="#organizations-groups-group-knowledge-bases-bulk-create-create" id="organizations-groups-group-knowledge-bases-bulk-create-create"></a>

POST `/api/v1/organizations/{organizationPk}/groups/{groupPk}/group-knowledge-bases/bulk-create/`

#### パラメータ

| パラメータ名           | 必須 | 型       | 説明                                             |
| ---------------- | -- | ------- | ---------------------------------------------- |
| `groupPk`        | ✅  | string  |                                                |
| `organizationPk` | ✅  | string  | A UUID string identifying this 組織 ID           |
| `page`           | ❌  | integer | A page number within the paginated result set. |
| `pageSize`       | ❌  | integer | Number of results to return per page.          |
| `query`          | ❌  | string  |                                                |
| `search`         | ❌  | string  |                                                |

#### リクエスト

**リクエストパラメータ**

| フィールド          | 型              | 必須 | 説明 |
| -------------- | -------------- | -- | -- |
| knowledgeBases | array\[string] | はい |    |

**リクエストスキーマ例**

```typescript
{
  "knowledgeBases": [
    string (uuid)
  ]
}
```

**リクエスト例**

```json
{
  "knowledgeBases": [
    "550e8400-e29b-41d4-a716-446655440000"
  ]
}
```

#### コード例

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

```bash
# API 呼び出し例 (Shell)
curl -X POST "https://api.maiagent.ai/api/v1/organizations/550e8400-e29b-41d4-a716-446655440000/groups/550e8400-e29b-41d4-a716-446655440000/group-knowledge-bases/bulk-create/?page=1&pageSize=1&query=example&search=example" \
  -H "Authorization: Api-Key YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "knowledgeBases": [
      "550e8400-e29b-41d4-a716-446655440000"
    ]
  }'

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

{% endtab %}

{% tab title="JavaScript" %}

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

// リクエストヘッダーを設定
const config = {
  headers: {
    'Authorization': 'Api-Key YOUR_API_KEY',
    'Content-Type': 'application/json'
  }
};

// リクエストペイロード
const data = {
    "knowledgeBases": [
      "550e8400-e29b-41d4-a716-446655440000"
    ]
  };

axios.post("https://api.maiagent.ai/api/v1/organizations/550e8400-e29b-41d4-a716-446655440000/groups/550e8400-e29b-41d4-a716-446655440000/group-knowledge-bases/bulk-create/?page=1&pageSize=1&query=example&search=example", 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/organizations/550e8400-e29b-41d4-a716-446655440000/groups/550e8400-e29b-41d4-a716-446655440000/group-knowledge-bases/bulk-create/?page=1&pageSize=1&query=example&search=example"
headers = {
    "Authorization": "Api-Key YOUR_API_KEY",
    "Content-Type": "application/json"
}

# リクエストペイロード
data = {
    "knowledgeBases": [
        "550e8400-e29b-41d4-a716-446655440000"
    ]
}

response = requests.post(url, json=data, 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/organizations/550e8400-e29b-41d4-a716-446655440000/groups/550e8400-e29b-41d4-a716-446655440000/group-knowledge-bases/bulk-create/?page=1&pageSize=1&query=example&search=example", [
        'headers' => [
            'Authorization' => 'Api-Key YOUR_API_KEY',
            'Content-Type' => 'application/json'
        ],
        'json' => [
            'knowledgeBases' => [
                '550e8400-e29b-41d4-a716-446655440000'
            ]
        ]
    ]);
    
    $data = json_decode($response->getBody(), true);
    echo "レスポンスを正常に取得しました:\n";
    print_r($data);
} catch (Exception $e) {
    echo 'リクエストエラーが発生しました: ' . $e->getMessage();
}
?>
```

{% endtab %}
{% endtabs %}

#### レスポンス

**ステータスコード: 201**

**レスポンススキーマ例**

```typescript
{
  "count": integer
  "next"?: string (uri) // 任意
  "previous"?: string (uri) // 任意
  "results": [
    {
      "id": string (uuid)
      "group": string (uuid)
      "knowledgeBase": 
      {
        "id": string (uuid)
        "createdBy": 
        {
          "id": string (uuid)
          "name": string
        }
        "organization"?: string (uuid) // 任意
        "embeddingModel": string (uuid)
        "rerankerModel": string (uuid)
        "name": string
        "description"?: string // 任意
        "numberOfRetrievedChunks"?: integer // 取得する参照データの件数。デフォルトは 12、最小値は 1 (任意)
        "enableHyde"?: boolean // HyDE を有効にします。デフォルトは False (任意)
        "similarityCutoff"?: number (double) // 類似度のしきい値。デフォルトは 0.0、範囲は 0.0-1.0 (任意)
        "enableRerank"?: boolean // リランキングを有効にするかどうか。デフォルトは True (任意)
        "enableRrf"?: boolean // Enable Reciprocal Rank Fusion for hybrid search. Disable this if using a custom Elasticsearch without enterprise license. (任意)
        "vectorDatabaseType"?:  // Type of vector database: elasticsearch or opensearch.

* `elasticsearch` - Elasticsearch
* `opensearch` - OpenSearch
* `oracle` - Oracle AI Database 26ai
* `synxdb` - SynxDB (任意)
        {
        }
        "vectorDatabaseUrl"?: string // Custom vector database endpoint URL or Oracle DSN. For Elasticsearch/OpenSearch: URL format (e.g., "https://host:9200"). For Oracle: DSN format (e.g., "host:1521/service_name"). (任意)
        "vectorDatabaseApiKey"?: string // API Key for Elasticsearch. Not used for OpenSearch. (任意)
        "opensearchUsername"?: string // Username for OpenSearch Basic Auth. (任意)
        "opensearchPassword"?: string // Password for OpenSearch Basic Auth. (任意)
        "oracleUser"?: string // Oracle database username. (任意)
        "oraclePassword"?: string // Oracle database password. (任意)
        "synxdbUser"?: string // SynxDB database username. (任意)
        "synxdbPassword"?: string // SynxDB database password. (任意)
        "labels": [
          {
            "id": string (uuid)
            "name": string
          }
        ]
        "chatbots"?: [ // 任意
          {
            "id": string (uuid)
            "name": string
          }
        ]
        "groups"?: [ // ナレッジベースにアクセスできるグループの一覧 (任意)
          {
            "id": string (uuid)
            "name": string
          }
        ]
        "filesCount": integer // Return count of KnowledgeBaseFile excluding processed files, conversation attachments, and soft-deleted.
        "vectorStorageSize": integer
        "chunksCount": integer
        "canUpdate": boolean // Return whether the current user can update this resource.
        "canDelete": boolean // Return whether the current user can delete this resource.
        "createdAt": string (timestamp)
        "updatedAt": string (timestamp)
      }
      "canRead"?: boolean // 任意
      "canUpdate"?: boolean // 任意
      "canDelete"?: boolean // 任意
      "createdAt": string (timestamp)
    }
  ]
}
```

**レスポンス例**

```json
{
  "count": 123,
  "next": "http://api.example.org/accounts/?page=4",
  "previous": "http://api.example.org/accounts/?page=2",
  "results": [
    {
      "id": "550e8400-e29b-41d4-a716-446655440000",
      "group": "550e8400-e29b-41d4-a716-446655440000",
      "knowledgeBase": {
        "id": "550e8400-e29b-41d4-a716-446655440000",
        "createdBy": {
          "id": "550e8400-e29b-41d4-a716-446655440000",
          "name": "レスポンス文字列"
        },
        "organization": "550e8400-e29b-41d4-a716-446655440000",
        "embeddingModel": "550e8400-e29b-41d4-a716-446655440000",
        "rerankerModel": "550e8400-e29b-41d4-a716-446655440000",
        "name": "レスポンス文字列",
        "description": "レスポンス文字列",
        "numberOfRetrievedChunks": 456,
        "enableHyde": false,
        "similarityCutoff": 456,
        "enableRerank": false,
        "enableRrf": false,
        "vectorDatabaseType": {},
        "vectorDatabaseUrl": "レスポンス文字列",
        "vectorDatabaseApiKey": "レスポンス文字列",
        "opensearchUsername": "レスポンス文字列",
        "opensearchPassword": "レスポンス文字列",
        "oracleUser": "レスポンス文字列",
        "oraclePassword": "レスポンス文字列",
        "synxdbUser": "レスポンス文字列",
        "synxdbPassword": "レスポンス文字列",
        "labels": [
          {
            "id": "550e8400-e29b-41d4-a716-446655440000",
            "name": "レスポンス文字列"
          }
        ],
        "chatbots": [
          {
            "id": "550e8400-e29b-41d4-a716-446655440000",
            "name": "レスポンス文字列"
          }
        ],
        "groups": [
          {
            "id": "550e8400-e29b-41d4-a716-446655440000",
            "name": "レスポンス文字列"
          }
        ],
        "filesCount": 456,
        "vectorStorageSize": 456,
        "chunksCount": 456,
        "canUpdate": false,
        "canDelete": false,
        "createdAt": "レスポンス文字列",
        "updatedAt": "レスポンス文字列"
      },
      "canRead": false,
      "canUpdate": false,
      "canDelete": false,
      "createdAt": "レスポンス文字列"
    }
  ]
}
```

***

### ロールへのデータベースの一括割り当て <a href="#organizations-groups-group-databases-bulk-create-create" id="organizations-groups-group-databases-bulk-create-create"></a>

POST `/api/v1/organizations/{organizationPk}/groups/{groupPk}/group-databases/bulk-create/`

#### パラメータ

| パラメータ名           | 必須 | 型       | 説明                                             |
| ---------------- | -- | ------- | ---------------------------------------------- |
| `groupPk`        | ✅  | string  |                                                |
| `organizationPk` | ✅  | string  | A UUID string identifying this 組織 ID           |
| `page`           | ❌  | integer | A page number within the paginated result set. |
| `pageSize`       | ❌  | integer | Number of results to return per page.          |
| `query`          | ❌  | string  |                                                |
| `search`         | ❌  | string  |                                                |

#### リクエスト

**リクエストパラメータ**

| フィールド     | 型              | 必須 | 説明 |
| --------- | -------------- | -- | -- |
| databases | array\[string] | はい |    |

**リクエストスキーマ例**

```typescript
{
  "databases": [
    string (uuid)
  ]
}
```

**リクエスト例**

```json
{
  "databases": [
    "550e8400-e29b-41d4-a716-446655440000"
  ]
}
```

#### コード例

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

```bash
# API 呼び出し例 (Shell)
curl -X POST "https://api.maiagent.ai/api/v1/organizations/550e8400-e29b-41d4-a716-446655440000/groups/550e8400-e29b-41d4-a716-446655440000/group-databases/bulk-create/?page=1&pageSize=1&query=example&search=example" \
  -H "Authorization: Api-Key YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "databases": [
      "550e8400-e29b-41d4-a716-446655440000"
    ]
  }'

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

{% endtab %}

{% tab title="JavaScript" %}

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

// リクエストヘッダーを設定
const config = {
  headers: {
    'Authorization': 'Api-Key YOUR_API_KEY',
    'Content-Type': 'application/json'
  }
};

// リクエストペイロード
const data = {
    "databases": [
      "550e8400-e29b-41d4-a716-446655440000"
    ]
  };

axios.post("https://api.maiagent.ai/api/v1/organizations/550e8400-e29b-41d4-a716-446655440000/groups/550e8400-e29b-41d4-a716-446655440000/group-databases/bulk-create/?page=1&pageSize=1&query=example&search=example", 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/organizations/550e8400-e29b-41d4-a716-446655440000/groups/550e8400-e29b-41d4-a716-446655440000/group-databases/bulk-create/?page=1&pageSize=1&query=example&search=example"
headers = {
    "Authorization": "Api-Key YOUR_API_KEY",
    "Content-Type": "application/json"
}

# リクエストペイロード
data = {
    "databases": [
        "550e8400-e29b-41d4-a716-446655440000"
    ]
}

response = requests.post(url, json=data, 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/organizations/550e8400-e29b-41d4-a716-446655440000/groups/550e8400-e29b-41d4-a716-446655440000/group-databases/bulk-create/?page=1&pageSize=1&query=example&search=example", [
        'headers' => [
            'Authorization' => 'Api-Key YOUR_API_KEY',
            'Content-Type' => 'application/json'
        ],
        'json' => [
            'databases' => [
                '550e8400-e29b-41d4-a716-446655440000'
            ]
        ]
    ]);
    
    $data = json_decode($response->getBody(), true);
    echo "レスポンスを正常に取得しました:\n";
    print_r($data);
} catch (Exception $e) {
    echo 'リクエストエラーが発生しました: ' . $e->getMessage();
}
?>
```

{% endtab %}
{% endtabs %}

#### レスポンス

**ステータスコード: 201**

**レスポンススキーマ例**

```typescript
{
  "count": integer
  "next"?: string (uri) // 任意
  "previous"?: string (uri) // 任意
  "results": [
    {
      "id": string (uuid)
      "group": string (uuid)
      "database": 
      {
        "id": string (uuid)
        "name": string // Display name for this database connection
        "description": string // Description of the database and its purpose
        "databaseType":  // Type of database: PostgreSQL, MySQL, MSSQL, Oracle, SynxDB, or MaiAgent

* `postgresql` - PostgreSQL
* `mysql` - MySQL
* `maiagent` - MaiAgent
* `oracle` - Oracle
* `mssql` - MSSQL
* `synxdb` - SynxDB
        {
        }
        "includeTables": object // Optional list of tables to include. Format: {"tables": ["table1", "table2"]}. For MaiAgent type, this is auto-populated from uploaded files.
        "isActive": boolean // When disabled, this database will not be used in Text-to-SQL queries
        "status": 
        {
        }
        "deletedAt": string (timestamp)
        "tables": [
          {
            "id": string (uuid)
            "tableName": string // Name of the table in the database
            "sheetName": string // Name of the source worksheet/sheet this table was created from. Empty for tables created before this field was added.
            "description"?: string // Description of the table and its data for better Text-to-SQL understanding (任意)
            "status": 
            {
            }
            "errorMessage": string // Error details if table creation or deletion failed
            "sourceFile": 
            {
              "id": string (uuid)
              "name": string
              "isFromKnowledgeBase": boolean // Determine if the source file originated from a knowledge base upload.

Returns True if the file was uploaded via knowledge base,
False if uploaded directly to the database.
            }
            "columns": [
              {
                "id": string (uuid)
                "columnName": string
                "columnType"?: string // Data type of the column (e.g., VARCHAR, INTEGER, TIMESTAMP) (任意)
                "description"?: string // Description of the column for better Text-to-SQL understanding (任意)
                "isPrimaryKey"?: boolean // 任意
                "isNullable"?: boolean // 任意
                "createdAt": string (timestamp)
                "updatedAt": string (timestamp)
              }
            ]
            "createdAt": string (timestamp)
            "updatedAt": string (timestamp)
          }
        ]
        "chatbots": [
          {
            "id": string (uuid)
            "name": string
          }
        ]
        "groups": [
          {
            "id": string (uuid)
            "name": string
          }
        ]
        "createdAt": string (timestamp)
        "updatedAt": string (timestamp)
      }
      "canRead"?: boolean // 任意
      "canUpdate"?: boolean // 任意
      "canDelete"?: boolean // 任意
      "createdAt": string (timestamp)
    }
  ]
}
```

**レスポンス例**

```json
{
  "count": 123,
  "next": "http://api.example.org/accounts/?page=4",
  "previous": "http://api.example.org/accounts/?page=2",
  "results": [
    {
      "id": "550e8400-e29b-41d4-a716-446655440000",
      "group": "550e8400-e29b-41d4-a716-446655440000",
      "database": {
        "id": "550e8400-e29b-41d4-a716-446655440000",
        "name": "レスポンス文字列",
        "description": "レスポンス文字列",
        "databaseType": {},
        "includeTables": null,
        "isActive": false,
        "status": {},
        "deletedAt": "レスポンス文字列",
        "tables": [
          {
            "id": "550e8400-e29b-41d4-a716-446655440000",
            "tableName": "レスポンス文字列",
            "sheetName": "レスポンス文字列",
            "description": "レスポンス文字列",
            "status": {},
            "errorMessage": "レスポンス文字列",
            "sourceFile": {
              "id": "550e8400-e29b-41d4-a716-446655440000",
              "name": "レスポンス文字列",
              "isFromKnowledgeBase": false
            },
            "columns": [
              {
                "id": "550e8400-e29b-41d4-a716-446655440000",
                "columnName": "レスポンス文字列",
                "columnType": "レスポンス文字列",
                "description": "レスポンス文字列",
                "isPrimaryKey": false,
                "isNullable": false,
                "createdAt": "レスポンス文字列",
                "updatedAt": "レスポンス文字列"
              }
            ],
            "createdAt": "レスポンス文字列",
            "updatedAt": "レスポンス文字列"
          }
        ],
        "chatbots": [
          {
            "id": "550e8400-e29b-41d4-a716-446655440000",
            "name": "レスポンス文字列"
          }
        ],
        "groups": [
          {
            "id": "550e8400-e29b-41d4-a716-446655440000",
            "name": "レスポンス文字列"
          }
        ],
        "createdAt": "レスポンス文字列",
        "updatedAt": "レスポンス文字列"
      },
      "canRead": false,
      "canUpdate": false,
      "canDelete": false,
      "createdAt": "レスポンス文字列"
    }
  ]
}
```

***

### 権限一覧の取得 <a href="#permissions-list" id="permissions-list"></a>

GET `/api/v1/permissions/`

#### コード例

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

```bash
# API 呼び出し例 (Shell)
curl -X GET "https://api.maiagent.ai/api/v1/permissions/" \
  -H "Authorization: Api-Key YOUR_API_KEY"

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

{% endtab %}

{% tab title="JavaScript" %}

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

// リクエストヘッダーを設定
const config = {
  headers: {
    'Authorization': 'Api-Key YOUR_API_KEY'
  }
};

axios.get("https://api.maiagent.ai/api/v1/permissions/", 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/permissions/"
headers = {
    "Authorization": "Api-Key YOUR_API_KEY"
}


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/permissions/", [
        'headers' => [
            'Authorization' => 'Api-Key YOUR_API_KEY'
        ]
    ]);
    
    $data = json_decode($response->getBody(), true);
    echo "レスポンスを正常に取得しました:\n";
    print_r($data);
} catch (Exception $e) {
    echo 'リクエストエラーが発生しました: ' . $e->getMessage();
}
?>
```

{% endtab %}
{% endtabs %}

#### レスポンス

**ステータスコード: 200**

**レスポンススキーマ例**

```typescript
[
  {
    "id": string (uuid)
    "name": string
    "value": string
    "description": string
    "children": [
      object
    ]
  }
]
```

**レスポンス値の例**

```json
[
  {
    "id": "550e8400-e29b-41d4-a716-446655440000",
    "name": "レスポンス文字列",
    "value": "レスポンス文字列",
    "description": "レスポンス文字列",
    "children": [
      {
        "id": "550e8400-e29b-41d4-a716-446655440000",
        "name": "レスポンス例の名前",
        "description": "レスポンス例の説明"
      }
    ]
  }
]
```

***

### ロール一覧の取得 <a href="#organizations-groups-list" id="organizations-groups-list"></a>

GET `/api/v1/organizations/{organizationPk}/groups/`

#### パラメータ

| パラメータ名           | 必須 | 型       | 説明                                                             |
| ---------------- | -- | ------- | -------------------------------------------------------------- |
| `organizationPk` | ✅  | string  | A UUID string identifying this organization ID                 |
| `page`           | ❌  | integer | A page number within the paginated result set.                 |
| `pageSize`       | ❌  | integer | Number of results to return per page.                          |
| `query`          | ❌  | string  |                                                                |
| `search`         | ❌  | string  |                                                                |
| `type`           | ❌  | string  | \`owner\`: オーナー ; \`default\`: デフォルトロール ; \`custom\`: カスタムロール; |

#### コード例

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

```bash
# API 呼び出し例 (Shell)
curl -X GET "https://api.maiagent.ai/api/v1/organizations/550e8400-e29b-41d4-a716-446655440000/groups/?page=1&pageSize=1&query=example&search=example&type=custom" \
  -H "Authorization: Api-Key YOUR_API_KEY"

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

{% endtab %}

{% tab title="JavaScript" %}

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

// リクエストヘッダーを設定
const config = {
  headers: {
    'Authorization': 'Api-Key YOUR_API_KEY'
  }
};

axios.get("https://api.maiagent.ai/api/v1/organizations/550e8400-e29b-41d4-a716-446655440000/groups/?page=1&pageSize=1&query=example&search=example&type=custom", 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/organizations/550e8400-e29b-41d4-a716-446655440000/groups/?page=1&pageSize=1&query=example&search=example&type=custom"
headers = {
    "Authorization": "Api-Key YOUR_API_KEY"
}


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/organizations/550e8400-e29b-41d4-a716-446655440000/groups/?page=1&pageSize=1&query=example&search=example&type=custom", [
        'headers' => [
            'Authorization' => 'Api-Key YOUR_API_KEY'
        ]
    ]);
    
    $data = json_decode($response->getBody(), true);
    echo "レスポンスを正常に取得しました:\n";
    print_r($data);
} catch (Exception $e) {
    echo 'リクエスト中にエラーが発生しました: ' . $e->getMessage();
}
?>
```

{% endtab %}
{% endtabs %}

#### レスポンス

**ステータスコード: 200**

**レスポンススキーマの例**

```typescript
{
  "count": integer
  "next"?: string (uri) // 任意
  "previous"?: string (uri) // 任意
  "results": [
    {
      "id": string (uuid)
      "name": string
      "type": 
      {
      }
      "permissions": [
        object
      ]
      "membersPreview": [
        string
      ]
      "membersCount": integer // 残りのメンバー数（一覧に表示される 3 人を除く）を返します。フロントエンドの +N バッジ表示に使用されます

リソースの count とは異なります：
- members_count: total - 3 を返します（+N バッジ用）。None は合計が 3 以下であることを示します
- chatbots_count/knowledge_bases_count/inboxes_count: 合計数を返します
      "chatbotsCount": integer
      "chatbotsPreview": [
        string
      ]
      "knowledgeBasesCount": integer
      "knowledgeBasesPreview": [
        string
      ]
      "inboxesCount": integer
      "inboxesPreview": [
        string
      ]
      "databasesCount": integer
      "databasesPreview": [
        string
      ]
      "canCreateChatbot"?: boolean // 任意
      "canCreateKnowledgeBase"?: boolean // 任意
      "canCreateInbox"?: boolean // 任意
      "canCreateDatabase"?: boolean // 任意
      "canCreateTool"?: boolean // 任意
      "canCreateAgentUiTool"?: boolean // 任意
      "canCreateSkill"?: boolean // 任意
      "maigptCanCodeInterpreter"?: boolean // Whether members of this role may use the code interpreter built-in tool in MaiGPT. (任意)
      "maigptCanRag"?: boolean // Whether members of this role may use the knowledge base RAG built-in tool in MaiGPT. (任意)
      "maigptCanDeepResearch"?: boolean // Whether members of this role may use Deep Research in MaiGPT. Deep Research reaches the public internet through its own built-in search, so a role that revokes the official web-search tools needs this switch too. (任意)
      "maigptCanBrowserTool"?: boolean // Whether members of this role may use the browser built-in tool in MaiGPT. (任意)
      "maigptAllLlms"?: boolean // Whether members of this role may use every organization-available LLM in MaiGPT. Off = only the bound LLMs; an empty binding then means none. (任意)
      "maigptAllTools"?: boolean // Whether members of this role may call every official (global) tool in MaiGPT. Off = only the bound tools; an empty binding then means none. (任意)
      "maigptAllConnectors"?: boolean // Whether members of this role may call every official (global) MCP connector in MaiGPT. Off = only the bound connectors; an empty binding then means none. (任意)
      "maigptAllSkills"?: boolean // Whether members of this role may use every official (global) skill in MaiGPT. Off = only the bound skills; an empty binding then means none. (任意)
      "usageStatisticsScope"?:  // What this role's usage statistics permission shows: the whole organization, or only the AI assistants granted to the member's roles. A member with any organization-wide granting role sees the whole organization.

* `organization` - Organization-wide
* `accessible_chatbots` - Authorized AI assistants only (任意)
      {
      }
      "createdAt": string (timestamp)
    }
  ]
}
```

**レスポンスのサンプル値**

```json
{
  "count": 123,
  "next": "http://api.example.org/accounts/?page=4",
  "previous": "http://api.example.org/accounts/?page=2",
  "results": [
    {
      "id": "550e8400-e29b-41d4-a716-446655440000",
      "name": "レスポンス文字列",
      "type": {},
      "permissions": [
        {
          "id": "550e8400-e29b-41d4-a716-446655440000",
          "name": "レスポンスの例の名前",
          "description": "レスポンスの例の説明"
        }
      ],
      "membersPreview": [
        "レスポンス文字列"
      ],
      "membersCount": 456,
      "chatbotsCount": 456,
      "chatbotsPreview": [
        "レスポンス文字列"
      ],
      "knowledgeBasesCount": 456,
      "knowledgeBasesPreview": [
        "レスポンス文字列"
      ],
      "inboxesCount": 456,
      "inboxesPreview": [
        "レスポンス文字列"
      ],
      "databasesCount": 456,
      "databasesPreview": [
        "レスポンス文字列"
      ],
      "canCreateChatbot": false,
      "canCreateKnowledgeBase": false,
      "canCreateInbox": false,
      "canCreateDatabase": false,
      "canCreateTool": false,
      "canCreateAgentUiTool": false,
      "canCreateSkill": false,
      "maigptCanCodeInterpreter": false,
      "maigptCanRag": false,
      "maigptCanDeepResearch": false,
      "maigptCanBrowserTool": false,
      "maigptAllLlms": false,
      "maigptAllTools": false,
      "maigptAllConnectors": false,
      "maigptAllSkills": false,
      "usageStatisticsScope": {},
      "createdAt": "レスポンス文字列"
    }
  ]
}
```

***

### ロール詳細の取得 <a href="#organizations-groups-retrieve" id="organizations-groups-retrieve"></a>

GET `/api/v1/organizations/{organizationPk}/groups/{id}/`

#### パラメータ

| パラメータ名           | 必須 | 型      | 説明                                             |
| ---------------- | -- | ------ | ---------------------------------------------- |
| `id`             | ✅  | string | A UUID string identifying this Group.          |
| `organizationPk` | ✅  | string | A UUID string identifying this organization ID |

#### コード例

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

```bash
# API 呼び出し例 (Shell)
curl -X GET "https://api.maiagent.ai/api/v1/organizations/550e8400-e29b-41d4-a716-446655440000/groups/550e8400-e29b-41d4-a716-446655440000/" \
  -H "Authorization: Api-Key YOUR_API_KEY"

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

{% endtab %}

{% tab title="JavaScript" %}

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

// リクエストヘッダーを設定
const config = {
  headers: {
    'Authorization': 'Api-Key YOUR_API_KEY'
  }
};

axios.get("https://api.maiagent.ai/api/v1/organizations/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/organizations/550e8400-e29b-41d4-a716-446655440000/groups/550e8400-e29b-41d4-a716-446655440000/"
headers = {
    "Authorization": "Api-Key YOUR_API_KEY"
}


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/organizations/550e8400-e29b-41d4-a716-446655440000/groups/550e8400-e29b-41d4-a716-446655440000/", [
        'headers' => [
            'Authorization' => 'Api-Key YOUR_API_KEY'
        ]
    ]);
    
    $data = json_decode($response->getBody(), true);
    echo "レスポンスを正常に取得しました:\n";
    print_r($data);
} catch (Exception $e) {
    echo 'リクエスト中にエラーが発生しました: ' . $e->getMessage();
}
?>
```

{% endtab %}
{% endtabs %}

#### レスポンス

**ステータスコード: 200**

**レスポンススキーマの例**

```typescript
{
  "id": string (uuid)
  "name": string
  "type": 
  {
  }
  "permissions": [
    object
  ]
  "membersPreview": [
    string
  ]
  "membersCount": integer // 残りのメンバー数（一覧に表示される 3 人を除く）を返します。フロントエンドの +N バッジ表示に使用されます

リソースの count とは異なります：
- members_count: total - 3 を返します（+N バッジ用）。None は合計が 3 以下であることを示します
- chatbots_count/knowledge_bases_count/inboxes_count: 合計数を返します
  "chatbotsCount": integer
  "chatbotsPreview": [
    string
  ]
  "knowledgeBasesCount": integer
  "knowledgeBasesPreview": [
    string
  ]
  "inboxesCount": integer
  "inboxesPreview": [
    string
  ]
  "databasesCount": integer
  "databasesPreview": [
    string
  ]
  "canCreateChatbot"?: boolean // 任意
  "canCreateKnowledgeBase"?: boolean // 任意
  "canCreateInbox"?: boolean // 任意
  "canCreateDatabase"?: boolean // 任意
  "canCreateTool"?: boolean // 任意
  "canCreateAgentUiTool"?: boolean // 任意
  "canCreateSkill"?: boolean // 任意
  "maigptCanCodeInterpreter"?: boolean // Whether members of this role may use the code interpreter built-in tool in MaiGPT. (任意)
  "maigptCanRag"?: boolean // Whether members of this role may use the knowledge base RAG built-in tool in MaiGPT. (任意)
  "maigptCanDeepResearch"?: boolean // Whether members of this role may use Deep Research in MaiGPT. Deep Research reaches the public internet through its own built-in search, so a role that revokes the official web-search tools needs this switch too. (任意)
  "maigptCanBrowserTool"?: boolean // Whether members of this role may use the browser built-in tool in MaiGPT. (任意)
  "maigptAllLlms"?: boolean // Whether members of this role may use every organization-available LLM in MaiGPT. Off = only the bound LLMs; an empty binding then means none. (任意)
  "maigptAllTools"?: boolean // Whether members of this role may call every official (global) tool in MaiGPT. Off = only the bound tools; an empty binding then means none. (任意)
  "maigptAllConnectors"?: boolean // Whether members of this role may call every official (global) MCP connector in MaiGPT. Off = only the bound connectors; an empty binding then means none. (任意)
  "maigptAllSkills"?: boolean // Whether members of this role may use every official (global) skill in MaiGPT. Off = only the bound skills; an empty binding then means none. (任意)
  "usageStatisticsScope"?:  // What this role's usage statistics permission shows: the whole organization, or only the AI assistants granted to the member's roles. A member with any organization-wide granting role sees the whole organization.

* `organization` - Organization-wide
* `accessible_chatbots` - Authorized AI assistants only (任意)
  {
  }
  "createdAt": string (timestamp)
}
```

**レスポンスのサンプル値**

```json
{
  "id": "550e8400-e29b-41d4-a716-446655440000",
  "name": "レスポンス文字列",
  "type": {},
  "permissions": [
    {
      "id": "550e8400-e29b-41d4-a716-446655440000",
      "name": "レスポンスの例の名前",
      "description": "レスポンスの例の説明"
    }
  ],
  "membersPreview": [
    "レスポンス文字列"
  ],
  "membersCount": 456,
  "chatbotsCount": 456,
  "chatbotsPreview": [
    "レスポンス文字列"
  ],
  "knowledgeBasesCount": 456,
  "knowledgeBasesPreview": [
    "レスポンス文字列"
  ],
  "inboxesCount": 456,
  "inboxesPreview": [
    "レスポンス文字列"
  ],
  "databasesCount": 456,
  "databasesPreview": [
    "レスポンス文字列"
  ],
  "canCreateChatbot": false,
  "canCreateKnowledgeBase": false,
  "canCreateInbox": false,
  "canCreateDatabase": false,
  "canCreateTool": false,
  "canCreateAgentUiTool": false,
  "canCreateSkill": false,
  "maigptCanCodeInterpreter": false,
  "maigptCanRag": false,
  "maigptCanDeepResearch": false,
  "maigptCanBrowserTool": false,
  "maigptAllLlms": false,
  "maigptAllTools": false,
  "maigptAllConnectors": false,
  "maigptAllSkills": false,
  "usageStatisticsScope": {},
  "createdAt": "レスポンス文字列"
}
```

***

### ロールのメンバー一覧を取得 <a href="#organizations-groups-group-members-list" id="organizations-groups-group-members-list"></a>

GET `/api/v1/organizations/{organizationPk}/groups/{groupPk}/group-members/`

#### パラメータ

| パラメータ名           | 必須 | 型       | 説明                                             |
| ---------------- | -- | ------- | ---------------------------------------------- |
| `groupPk`        | ✅  | string  |                                                |
| `organizationPk` | ✅  | string  | A UUID string identifying this organization ID |
| `page`           | ❌  | integer | A page number within the paginated result set. |
| `pageSize`       | ❌  | integer | Number of results to return per page.          |
| `query`          | ❌  | string  |                                                |
| `search`         | ❌  | string  |                                                |

#### コード例

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

```bash
# API 呼び出し例 (Shell)
curl -X GET "https://api.maiagent.ai/api/v1/organizations/550e8400-e29b-41d4-a716-446655440000/groups/550e8400-e29b-41d4-a716-446655440000/group-members/?page=1&pageSize=1&query=example&search=example" \
  -H "Authorization: Api-Key YOUR_API_KEY"

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

{% endtab %}

{% tab title="JavaScript" %}

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

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

axios.get("https://api.maiagent.ai/api/v1/organizations/550e8400-e29b-41d4-a716-446655440000/groups/550e8400-e29b-41d4-a716-446655440000/group-members/?page=1&pageSize=1&query=example&search=example", 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/organizations/550e8400-e29b-41d4-a716-446655440000/groups/550e8400-e29b-41d4-a716-446655440000/group-members/?page=1&pageSize=1&query=example&search=example"
headers = {
    "Authorization": "Api-Key YOUR_API_KEY"
}


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/organizations/550e8400-e29b-41d4-a716-446655440000/groups/550e8400-e29b-41d4-a716-446655440000/group-members/?page=1&pageSize=1&query=example&search=example", [
        'headers' => [
            'Authorization' => 'Api-Key YOUR_API_KEY'
        ]
    ]);
    
    $data = json_decode($response->getBody(), true);
    echo "レスポンスを正常に取得しました:\n";
    print_r($data);
} catch (Exception $e) {
    echo 'リクエストエラーが発生しました: ' . $e->getMessage();
}
?>
```

{% endtab %}
{% endtabs %}

#### レスポンス内容

**ステータスコード: 200**

**レスポンス構造の例**

```typescript
{
  "count": integer
  "next"?: string (uri) // 任意
  "previous"?: string (uri) // 任意
  "results": [
    {
      "id": string (uuid)
      "member": {
      {
        "id": string (uuid)
        "name": string
        "displayName": string // Name set by the organization owner for this organization only; empty string when not set (``name`` then falls back to the account name).
        "accountName": string // Account name of the member (shared across organizations); shown when display name is cleared.
        "isScimManaged": boolean // True when the member is provisioned by SCIM; the identity provider manages the member and the organization name cannot be changed manually.
        "email": string
        "isActive": boolean
        "isOwner": boolean // メンバーが組織のオーナーかどうかを確認します（OWNER Group 経由）

キャッシュを使用して、同一リクエスト内での重複クエリを防ぎます
キャッシュの有効期間：メンバーインスタンスが存在する間、有効です

アノテーションの結果がある場合は優先して使用し、重複クエリを防ぎます
        "permissions": [ // Compute the permission tree once per (organization, custom-group set) per request.

The tree depends only on the member's organization (default groups, feature
flags, plan whitelist), the member's custom groups, and the global ``Config``,
so members sharing a group set get the same result. A large role's
``pagination=false`` listing otherwise recomputes it per row — one Redis
``Config`` fetch plus the permission walk each time (issue #8436; the largest
prod role has 3,837 members and a single group set). The memo lives in the
serializer context, so it never outlives the request. Rows without the eager
loaded ``_custom_groups_cache`` (single-object paths) keep computing directly.
          object
        ]
        "groups": [
          object
        ]
        "creditQuotaRequired"?: boolean // When True, member must have an active quota to consume credits (任意)
        "activeQuota": object // Return the most recent quota summary (active first), via prefetch to avoid N+1.
        "metadata": object // Organization-scoped member attributes, injected into LLM system prompt
        "availabilityStatus":  // Self-declared availability for auto-assignment. Paused members are skipped by the dispatch engine but can still be manually assigned or claim conversations. Not touched by SCIM provisioning.

* `available` - Available
* `paused` - Paused
        {
        }
        "createdAt": string (timestamp)
      }
      }
      "createdAt": string (timestamp)
    }
  ]
}
```

**レスポンス値の例**

```json
{
  "count": 123,
  "next": "http://api.example.org/accounts/?page=4",
  "previous": "http://api.example.org/accounts/?page=2",
  "results": [
    {
      "id": "550e8400-e29b-41d4-a716-446655440000",
      "member": {
        "id": "550e8400-e29b-41d4-a716-446655440000",
        "name": "レスポンス文字列",
        "displayName": "レスポンス文字列",
        "accountName": "レスポンス文字列",
        "isScimManaged": false,
        "email": "レスポンス文字列",
        "isActive": false,
        "isOwner": false,
        "permissions": [
          {
            "id": "550e8400-e29b-41d4-a716-446655440000",
            "name": "レスポンス例の名前",
            "description": "レスポンス例の説明"
          }
        ],
        "groups": [
          {
            "id": "550e8400-e29b-41d4-a716-446655440000",
            "name": "レスポンス例の名前",
            "description": "レスポンス例の説明"
          }
        ],
        "creditQuotaRequired": false,
        "activeQuota": {
          "id": "550e8400-e29b-41d4-a716-446655440000",
          "name": "レスポンス例の名前",
          "description": "レスポンス例の説明"
        },
        "metadata": null,
        "availabilityStatus": {},
        "createdAt": "レスポンス文字列"
      },
      "createdAt": "レスポンス文字列"
    }
  ]
}
```

***

### 特定のロールメンバーを取得 <a href="#organizations-groups-group-members-retrieve" id="organizations-groups-group-members-retrieve"></a>

GET `/api/v1/organizations/{organizationPk}/groups/{groupPk}/group-members/{id}/`

#### パラメータ

| パラメータ名           | 必須 | 型      | 説明                                             |
| ---------------- | -- | ------ | ---------------------------------------------- |
| `groupPk`        | ✅  | string |                                                |
| `id`             | ✅  | string | A UUID string identifying this Group Member.   |
| `organizationPk` | ✅  | string | A UUID string identifying this organization ID |

#### コード例

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

```bash
# API 呼び出し例 (Shell)
curl -X GET "https://api.maiagent.ai/api/v1/organizations/550e8400-e29b-41d4-a716-446655440000/groups/550e8400-e29b-41d4-a716-446655440000/group-members/550e8400-e29b-41d4-a716-446655440000/" \
  -H "Authorization: Api-Key YOUR_API_KEY"

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

{% endtab %}

{% tab title="JavaScript" %}

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

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

axios.get("https://api.maiagent.ai/api/v1/organizations/550e8400-e29b-41d4-a716-446655440000/groups/550e8400-e29b-41d4-a716-446655440000/group-members/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/organizations/550e8400-e29b-41d4-a716-446655440000/groups/550e8400-e29b-41d4-a716-446655440000/group-members/550e8400-e29b-41d4-a716-446655440000/"
headers = {
    "Authorization": "Api-Key YOUR_API_KEY"
}


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/organizations/550e8400-e29b-41d4-a716-446655440000/groups/550e8400-e29b-41d4-a716-446655440000/group-members/550e8400-e29b-41d4-a716-446655440000/", [
        'headers' => [
            'Authorization' => 'Api-Key YOUR_API_KEY'
        ]
    ]);
    
    $data = json_decode($response->getBody(), true);
    echo "レスポンスを正常に取得しました:\n";
    print_r($data);
} catch (Exception $e) {
    echo 'リクエストエラーが発生しました: ' . $e->getMessage();
}
?>
```

{% endtab %}
{% endtabs %}

#### レスポンス内容

**ステータスコード: 200**

**レスポンス構造の例**

```typescript
{
  "id": string (uuid)
  "member": {
  {
    "id": string (uuid)
    "name": string
    "displayName": string // Name set by the organization owner for this organization only; empty string when not set (``name`` then falls back to the account name).
    "accountName": string // Account name of the member (shared across organizations); shown when display name is cleared.
    "isScimManaged": boolean // True when the member is provisioned by SCIM; the identity provider manages the member and the organization name cannot be changed manually.
    "email": string
    "isActive": boolean
    "isOwner": boolean // メンバーが組織のオーナーかどうかを確認します（OWNER Group 経由）

キャッシュを使用して、同一リクエスト内での重複クエリを防ぎます
キャッシュの有効期間：メンバーインスタンスが存在する間、有効です

アノテーションの結果がある場合は優先して使用し、重複クエリを防ぎます
    "permissions": [ // Compute the permission tree once per (organization, custom-group set) per request.

The tree depends only on the member's organization (default groups, feature
flags, plan whitelist), the member's custom groups, and the global ``Config``,
so members sharing a group set get the same result. A large role's
``pagination=false`` listing otherwise recomputes it per row — one Redis
``Config`` fetch plus the permission walk each time (issue #8436; the largest
prod role has 3,837 members and a single group set). The memo lives in the
serializer context, so it never outlives the request. Rows without the eager
loaded ``_custom_groups_cache`` (single-object paths) keep computing directly.
      object
    ]
    "groups": [
      object
    ]
    "creditQuotaRequired"?: boolean // When True, member must have an active quota to consume credits (任意)
    "activeQuota": object // Return the most recent quota summary (active first), via prefetch to avoid N+1.
    "metadata": object // Organization-scoped member attributes, injected into LLM system prompt
    "availabilityStatus":  // Self-declared availability for auto-assignment. Paused members are skipped by the dispatch engine but can still be manually assigned or claim conversations. Not touched by SCIM provisioning.

* `available` - Available
* `paused` - Paused
    {
    }
    "createdAt": string (timestamp)
  }
  }
  "createdAt": string (timestamp)
}
```

**レスポンス値の例**

```json
{
  "id": "550e8400-e29b-41d4-a716-446655440000",
  "member": {
    "id": "550e8400-e29b-41d4-a716-446655440000",
    "name": "レスポンス文字列",
    "displayName": "レスポンス文字列",
    "accountName": "レスポンス文字列",
    "isScimManaged": false,
    "email": "レスポンス文字列",
    "isActive": false,
    "isOwner": false,
    "permissions": [
      {
        "id": "550e8400-e29b-41d4-a716-446655440000",
        "name": "レスポンス例の名前",
        "description": "レスポンス例の説明"
      }
    ],
    "groups": [
      {
        "id": "550e8400-e29b-41d4-a716-446655440000",
        "name": "レスポンス例の名前",
        "description": "レスポンス例の説明"
      }
    ],
    "creditQuotaRequired": false,
    "activeQuota": {
      "id": "550e8400-e29b-41d4-a716-446655440000",
      "name": "レスポンス例の名前",
      "description": "レスポンス例の説明"
    },
    "metadata": null,
    "availabilityStatus": {},
    "createdAt": "レスポンス文字列"
  },
  "createdAt": "レスポンス文字列"
}
```

***

### ロールの AI アシスタント一覧を取得 <a href="#organizations-groups-group-chatbots-list" id="organizations-groups-group-chatbots-list"></a>

GET `/api/v1/organizations/{organizationPk}/groups/{groupPk}/group-chatbots/`

#### パラメータ

| パラメータ名           | 必須 | 型       | 説明                                             |
| ---------------- | -- | ------- | ---------------------------------------------- |
| `groupPk`        | ✅  | string  |                                                |
| `organizationPk` | ✅  | string  | A UUID string identifying this organization ID |
| `page`           | ❌  | integer | A page number within the paginated result set. |
| `pageSize`       | ❌  | integer | Number of results to return per page.          |
| `query`          | ❌  | string  |                                                |
| `search`         | ❌  | string  |                                                |

#### コード例

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

```bash
# API 呼び出し例 (Shell)
curl -X GET "https://api.maiagent.ai/api/v1/organizations/550e8400-e29b-41d4-a716-446655440000/groups/550e8400-e29b-41d4-a716-446655440000/group-chatbots/?page=1&pageSize=1&query=example&search=example" \
  -H "Authorization: Api-Key YOUR_API_KEY"

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

{% endtab %}

{% tab title="JavaScript" %}

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

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

axios.get("https://api.maiagent.ai/api/v1/organizations/550e8400-e29b-41d4-a716-446655440000/groups/550e8400-e29b-41d4-a716-446655440000/group-chatbots/?page=1&pageSize=1&query=example&search=example", 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/organizations/550e8400-e29b-41d4-a716-446655440000/groups/550e8400-e29b-41d4-a716-446655440000/group-chatbots/?page=1&pageSize=1&query=example&search=example"
headers = {
    "Authorization": "Api-Key YOUR_API_KEY"
}


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/organizations/550e8400-e29b-41d4-a716-446655440000/groups/550e8400-e29b-41d4-a716-446655440000/group-chatbots/?page=1&pageSize=1&query=example&search=example", [
        'headers' => [
            'Authorization' => 'Api-Key YOUR_API_KEY'
        ]
    ]);
    
    $data = json_decode($response->getBody(), true);
    echo "レスポンスを正常に取得しました:\n";
    print_r($data);
} catch (Exception $e) {
    echo 'リクエストエラーが発生しました: ' . $e->getMessage();
}
?>
```

{% endtab %}
{% endtabs %}

#### レスポンス内容

**ステータスコード: 200**

**レスポンス構造の例**

```typescript
{
  "count": integer
  "next"?: string (uri) // 任意
  "previous"?: string (uri) // 任意
  "results": [
    {
      "id": string (uuid)
      "group": string (uuid)
      "chatbot": 
      {
        "id": string (uuid)
        "name": string // Chatbot name. In Agent mode it carries semantic meaning; in other modes it only distinguishes chatbots.
        "largeLanguageModel": string (uuid) // チャットボットが回答の生成に使用する大規模言語モデルです（組織が独自に設定した AI Gateway モデルを含みます）。作成時に省略できるのは、組織の AI アシスタントのデフォルト設定でデフォルトモデルが指定されている場合のみです
        "llm":  // 関連付けられたモデルの id、name、および提供終了情報です。FK から直接読み取り、組織がモデルを無効にしていても返します
        {
          "id": string (uuid)
          "name": string
          "retiresAt": string (date) // プロバイダーによる提供終了日です。日付に達すると、毎日のスケジュール処理がアシスタントを replacement に切り替え、このモデルを無効にします。null は提供終了が予定されていないことを示します
          "replacement":  // 提供終了後の移行先モデル（id と name）です。null は未指定を示し、提供終了日に自動移行は行われません
          {
            "id": string (uuid)
            "name": string
          }
        }
        "organizationEnforcedSettings": [ // 組織の AI アシスタントのデフォルト設定により、このアシスタントに強制適用される設定コードです（AI アシスタントのデフォルト設定 API のキーと同じです）。これらのフィールドは強制値を返し、異なる値で更新すると拒否されます（読み取り専用です。公式の組み込み Agent と MaiGPT では空です）
          string
        ]
        "embeddingModel"?: string (uuid) // テキストのベクトル化に使用する埋め込みモデルです。任意項目です (任意)
        "rerankerModel"?: string (uuid) // 再ランキングに使用するモデルです。任意項目です (任意)
        "instructions"?: string // Role instructions describing the chatbot's role and behavior. (任意)
        "knowledgeBases"?: [ // チャットボットがアクセスできるナレッジベースの一覧です (任意)
          {
            "id": string (uuid)
            "name": string
          }
        ]
        "databases"?: [ // チャットボットがアクセスできる SQL データベースの一覧です（Text-to-SQL 機能で使用します） (任意)
          {
            "id": string (uuid)
            "name": string
          }
        ]
        "updatedAt": string (timestamp)
        "organization"?: string (uuid) // チャットボットが所属する組織です。空の場合は個人用チャットボットです (任意)
        "replyMode"?:  // 応答モード：通常の応答またはストリーミング応答です

* `normal` - 通常
* `template` - テンプレート
* `hybrid` - ハイブリッド
* `agent` - エージェント (任意)
        {
        }
        "template"?: string // Template used by Template and Hybrid modes. (任意)
        "unanswerableTemplate"?: string // Template used by Template and Hybrid modes when the question cannot be answered. (任意)
        "totalWordsCount"?: integer (int64) // Accumulated total word count used. (任意)
        "outputMode"?:  // 出力モード：テキスト、テーブル、またはカスタム形式です

* `text` - テキスト
* `json_schema` - JSON Schema (任意)
        {
        }
        "rawOutputFormat"?: object // カスタム出力形式の JSON スキーマ定義です (任意)
        "groups"?: [ // チャットボットがアクセスできるグループの一覧です (任意)
          {
            "id": string (uuid)
            "name": string
          }
        ]
        "tools"?: [ // チャットボットが使用できるツールの一覧です (任意)
          {
            "id": string (uuid)
            "name": string
            "description": string
            "displayName": string
            "toolType": string
          }
        ]
        "skills"?: [ // チャットボットに関連付けられたスキルの一覧です (任意)
          {
            "id": string (uuid)
            "name": string
            "description": string
          }
        ]
        "connectors"?: [ // Connectors associated with this chatbot, gating per-contact OAuth authorization (任意)
          {
            "id": string (uuid)
            "name": string
          }
        ]
        "agentMode"?:  // エージェントモード：通常、SQL、またはワークフローモードです

* `normal` - 通常
* `canvas` - キャンバス
* `team` - チーム (任意)
        {
        }
        "numberOfRetrievedChunks"?: integer // 取得する参照チャンク数です。デフォルトは 12、最小値は 1 です (任意)
        "defaultLabelRelations"?: object // アシスタント単位のデフォルトのナレッジベースラベルフィルターです。形式は query_metadata.label_relations と同じで、null はフィルターなしを意味します。呼び出し元が query_metadata を指定しない場合にのみ、優先順位が最も低いフォールバックとして適用されます。 (任意)
        "useFullRetrievalRange"?: boolean // 有効にすると、LLM の top_k による切り詰めを無視し、リランカーの結果をすべて返します (任意)
        "enableEvaluation"?: boolean // 任意
        "enableInlineCitations"?: boolean // インライン引用を有効にし、[1][2] などの引用マーカーをレスポンスに挿入します。 (任意)
        "enableCodeInterpreter"?: boolean // 有効にすると、隔離されたコンテナでコードを実行する Code Interpreter ツールを提供します。 (任意)
        "enableBrowserTool"?: boolean // Web タスク用のブラウザー自動化ツールを有効にします (任意)
        "enableImageSearch"?: boolean // 関連付けられたナレッジベースのいずれかがマルチモーダル埋め込みモデルを使用している場合、image_search ツールを提供します。無効にするとツール自体が削除されます。 (任意)
        "enableClaudeStreamRetry"?: boolean // Claude のストリーミング呼び出しが最初のチャンクまたは途中で停止した場合、呼び出しを中断し、非ストリーミングモードで一度だけ再実行します。途中での再試行時にはリセット信号を送信し、クライアントがすでに表示した部分出力を破棄できるようにします。再試行ごとに、同じプロンプトに対して再度課金されます。 (任意)
        "customMaxLlmOutputTokens"?: integer // LLM の最大出力トークン数を指定します。最小値は 512 です (任意)
        "voiceConfig"?: { // 任意
        {
          "enabled"?: boolean // このチャットボットを音声エージェントとして使用できるかどうかを指定します。プラットフォームごとのスイッチではなく、すべての会話プラットフォーム（WebChat、SIP 電話、管理画面／マーケットプレイスの音声テスト）でこの設定を確認します。 (任意)
          "voiceAgentType"?: string (uuid) // 音声エージェントのモード種別です。 (任意)
          "sttProvider"?: string (uuid) // 音声認識（Speech-to-Text）のサービスプロバイダーです。 (任意)
          "sttConfig"?: object // STT の設定パラメーター（JSON）です。 (任意)
          "ttsProvider"?: string (uuid) // 音声合成（Text-to-Speech）のサービスプロバイダーです。 (任意)
          "ttsConfig"?: object // TTS の設定パラメーター（JSON）です。 (任意)
          "realtimeProvider"?: string (uuid) // リアルタイムのエンドツーエンド音声モデルのプロバイダーです。 (任意)
          "realtimeConfig"?: object // リアルタイム音声の設定パラメーター（JSON）です。 (任意)
          "realtimeInstructions"?: string // リアルタイム音声セッション専用のプロンプトです。空の場合はチャットボットの指示を使用します (任意)
          "turnHandling"?: object // 音声エージェントの発話交代と割り込みの設定です。 (任意)
          "enableVoiceReply"?: boolean // 無効にすると、音声エージェントはテキストのみで応答し、発話しません (任意)
        }
        }
        "thinkingConfig"?: object // 推論レベルです。null（モデルのデフォルト）または {"reasoning_effort": "off|minimal|low|medium|high|xhigh|max"} (任意)
        "enableToolSearching"?: boolean // 旧フィールドです。代わりに tool_loading_mode を使用してください。true の書き込みは tool_loading_mode=search、false は all に相当します。両方を指定した場合は tool_loading_mode が優先されます。読み取り時は、ツールの読み込み方式が全件読み込み以外かどうかを返します。 (任意)
        "toolLoadingMode"?:  // ツールの読み込み方式です。auto（そのターンで利用できるツール数とモデルに基づく自動選択）、all（全件読み込み）、search（動的検索）を指定します。新規アシスタントのデフォルトは auto です。未設定の既存アシスタントでは、以前のスイッチから換算した値（オン→search、オフ→all）を返します。

* `auto` - 自動
* `all` - 全件読み込み
* `search` - 動的検索 (任意)
        {
        }
        "maxAgentIterations"?: integer // AgentWorkflow の最大反復回数です（1–100、デフォルト: 20） (任意)
        "agentTimeoutSeconds"?: integer // AgentWorkflow 実行のタイムアウト秒数です（30–1200、デフォルト: 600） (任意)
        "agentTimeoutMessage"?: string // AgentWorkflow がタイムアウトした際にユーザーに表示するカスタムメッセージです（最大 500 文字）。空の場合はシステムのデフォルトを使用します。 (任意)
        "requireTextWithFlexCards"?: boolean // 有効にすると、ユーザー向けのテキストがなく Flex Message カードのみでターンが終了する場合に、LLM に一度だけ再リクエストし、先にテキストを書いてからカードを送信するよう指示します。再試行ごとに、同じプロンプトに対して再度課金されます。 (任意)
        "isMultimodalLlm": boolean // チャットボットの LLM がマルチモーダルに対応しているかどうかを示します（読み取り専用）
        "enableSizeBasedToolResultTruncation"?: boolean // 有効にすると、文字数のしきい値を超えるツール結果を会話履歴に書き込む際、先頭と末尾、および省略部分に含まれる識別子を保持します。ナレッジベース、SQL、会話検索の結果は、この設定にかかわらず 100 文字で切り詰められます。コードインタープリターの bash 標準出力や Web 検索結果など、大きなツール出力によるメモリの肥大化を抑えます。 (任意)
        "toolResultMaxChars"?: integer // サイズに基づいてツール結果を切り詰める文字数のしきい値です（500–50000）。enable_size_based_tool_result_truncation が True の場合のみ有効です。 (任意)
        "enableVectorMemory"?: boolean // 有効にすると、アーカイブされたメッセージをベクトル化し、事実抽出を行ってセマンティック検索に使用します（従来の動作）。無効にすると、アーカイブされたメッセージは破棄され、複数ターンのコンテキストには現在のチャット履歴ウィンドウのみを使用します。 (任意)
        "longTermMemoryTopK"?: integer // 長期メモリの検索ごとに取得するメモリノード数（ベクトル検索の similarity_top_k）です。デフォルトは 10、範囲は 1–50 です (任意)
        "enableCrossConversationSearch"?: boolean // 有効にすると、会話履歴ツールは振り返り期間内にある、同じ受信トレイ内のこの連絡先の別の会話も対象にします。無効の場合は現在の会話のみを対象にします。 (任意)
        "crossConversationLookbackDays"?: integer // 会話横断検索で遡る期間を、各会話の最後のメッセージからの日数で指定します（1–365 日）。空の場合は 90 日を使用します。enable_cross_conversation_search が True の場合のみ有効です。 (任意)
        "useGatewayFallback"?: boolean // 有効にすると、単一の LLM の代わりにフォールバックグループを使用します (任意)
        "gatewayFallbackGroup"?: string (uuid) // 任意
        "enableSearchMessagesTool"?: boolean // AI が現在の会話の過去のメッセージを検索できるようにします。 (任意)
        "enableGetMessageContextTool"?: boolean // AI が特定のメッセージの前後のメッセージを取得し、コンテキストとして使用できるようにします。 (任意)
        "enableReadAttachmentFullTextTool"?: boolean // AI がプレーンテキストの添付ファイルの全文を読めるようにします。AGENT モード専用です。 (任意)
        "enableParseAttachmentContentTool"?: boolean // AI が PDF、Office、音声などの添付ファイルを解析できるようにします。AGENT モード専用です。 (任意)
        "enableListAvailableParsersTool"?: boolean // AI が利用可能なパーサーとその機能を一覧表示できるようにします。AGENT モード専用です。 (任意)
        "enableGetDownloadLinkTool"?: boolean // AI が生成したコンテンツの共有可能なダウンロードリンクを作成できるようにします。AGENT モード専用です。 (任意)
        "isLocked": boolean // ロックされたインスタンスです。設定は公式版に従い、専用のナレッジベースのみを変更できます
        "sourceBuildInAgent": string (uuid) // レンタルによってインスタンス化された場合、公式の Build-in Agent のブループリントを指します
        "canUpdate": boolean // 現在のユーザーがこのリソースを更新できるかどうかを返します。
        "canDelete": boolean // 現在のユーザーがこのリソースを削除できるかどうかを返します。
        "team": 
        {
          "id": string (uuid)
          "name": string
        }
        "webChatIsActive"?: boolean // 任意の作成時専用設定です。Web ウィジェットチャネルを有効な状態で開始するかどうかを指定します。省略または null の場合、組織の新規チャットボットチャネルのデフォルトに従います（プラットフォーム管理者が有効にしていない限り無効です）。更新時は無視されます。既存のチャネルはチャネル設定から変更してください。 (任意)
        "apiIsActive"?: boolean // 任意の作成時専用設定です。API チャネルを有効な状態で開始するかどうかを指定します。省略または null の場合、組織の新規チャットボットチャネルのデフォルトに従います（プラットフォーム管理者が有効にしていない限り無効です）。更新時は無視されます。既存のチャネルはチャネル設定から変更してください。管理画面のチャネルは常に有効な状態で開始し、ここでは設定できません。 (任意)
        "fileWorkspaceMode"?:  // Work 内部会話のファイルワークスペースモードです。none、bound、user_mount を指定します。

* `none` - なし
* `bound` - 紐付けワークスペース
* `user_mount` - ユーザーマウント (任意)
        {
        }
        "fileWorkspaceFolder"?: string (uuid) // 紐付けるワークスペース（フォルダー ID）です。モードが bound の場合は必須で、それ以外の場合はクリアされます。 (任意)
        "fileWorkspaceStatus": object // 読み取り専用です。 {"folder": {"id", "name"} | null, "state": "ok" | "missing" | "builder_lost_edit" | null}
        "fileWorkspaceAvailable": boolean // 読み取り専用です。組織にファイルライブラリがあり、このエージェントでファイルワークスペースを設定できるかどうかを示します。
      }
      "canRead"?: boolean // 任意
      "canUpdate"?: boolean // 任意
      "canDelete"?: boolean // 任意
      "createdAt": string (timestamp)
    }
  ]
}
```

**レスポンス値の例**

```json
{
  "count": 123,
  "next": "http://api.example.org/accounts/?page=4",
  "previous": "http://api.example.org/accounts/?page=2",
  "results": [
    {
      "id": "550e8400-e29b-41d4-a716-446655440000",
      "group": "550e8400-e29b-41d4-a716-446655440000",
      "chatbot": {
        "id": "550e8400-e29b-41d4-a716-446655440000",
        "name": "レスポンス文字列",
        "largeLanguageModel": "550e8400-e29b-41d4-a716-446655440000",
        "llm": {
          "id": "550e8400-e29b-41d4-a716-446655440000",
          "name": "レスポンス文字列",
          "retiresAt": "レスポンス文字列",
          "replacement": {
            "id": "550e8400-e29b-41d4-a716-446655440000",
            "name": "レスポンス文字列"
          }
        },
        "organizationEnforcedSettings": [
          "レスポンス文字列"
        ],
        "embeddingModel": "550e8400-e29b-41d4-a716-446655440000",
        "rerankerModel": "550e8400-e29b-41d4-a716-446655440000",
        "instructions": "レスポンス文字列",
        "knowledgeBases": [
          {
            "id": "550e8400-e29b-41d4-a716-446655440000",
            "name": "レスポンス文字列"
          }
        ],
        "databases": [
          {
            "id": "550e8400-e29b-41d4-a716-446655440000",
            "name": "レスポンス文字列"
          }
        ],
        "updatedAt": "レスポンス文字列",
        "organization": "550e8400-e29b-41d4-a716-446655440000",
        "replyMode": {},
        "template": "レスポンス文字列",
        "unanswerableTemplate": "レスポンス文字列",
        "totalWordsCount": 456,
        "outputMode": {},
        "rawOutputFormat": null,
        "groups": [
          {
            "id": "550e8400-e29b-41d4-a716-446655440000",
            "name": "レスポンス文字列"
          }
        ],
        "tools": [
          {
            "id": "550e8400-e29b-41d4-a716-446655440000",
            "name": "レスポンス文字列",
            "description": "レスポンス文字列",
            "displayName": "レスポンス文字列",
            "toolType": "レスポンス文字列"
          }
        ],
        "skills": [
          {
            "id": "550e8400-e29b-41d4-a716-446655440000",
            "name": "レスポンス文字列",
            "description": "レスポンス文字列"
          }
        ],
        "connectors": [
          {
            "id": "550e8400-e29b-41d4-a716-446655440000",
            "name": "レスポンス文字列"
          }
        ],
        "agentMode": {},
        "numberOfRetrievedChunks": 456,
        "defaultLabelRelations": null,
        "useFullRetrievalRange": false,
        "enableEvaluation": false,
        "enableInlineCitations": false,
        "enableCodeInterpreter": false,
        "enableBrowserTool": false,
        "enableImageSearch": false,
        "enableClaudeStreamRetry": false,
        "customMaxLlmOutputTokens": 456,
        "voiceConfig": {
          "enabled": false,
          "voiceAgentType": "550e8400-e29b-41d4-a716-446655440000",
          "sttProvider": "550e8400-e29b-41d4-a716-446655440000",
          "sttConfig": null,
          "ttsProvider": "550e8400-e29b-41d4-a716-446655440000",
          "ttsConfig": null,
          "realtimeProvider": "550e8400-e29b-41d4-a716-446655440000",
          "realtimeConfig": null,
          "realtimeInstructions": "レスポンス文字列",
          "turnHandling": null,
          "enableVoiceReply": false
        },
        "thinkingConfig": null,
        "enableToolSearching": false,
        "toolLoadingMode": {},
        "maxAgentIterations": 456,
        "agentTimeoutSeconds": 456,
        "agentTimeoutMessage": "レスポンス文字列",
        "requireTextWithFlexCards": false,
        "isMultimodalLlm": false,
        "enableSizeBasedToolResultTruncation": false,
        "toolResultMaxChars": 456,
        "enableVectorMemory": false,
        "longTermMemoryTopK": 456,
        "enableCrossConversationSearch": false,
        "crossConversationLookbackDays": 456,
        "useGatewayFallback": false,
        "gatewayFallbackGroup": "550e8400-e29b-41d4-a716-446655440000",
        "enableSearchMessagesTool": false,
        "enableGetMessageContextTool": false,
        "enableReadAttachmentFullTextTool": false,
        "enableParseAttachmentContentTool": false,
        "enableListAvailableParsersTool": false,
        "enableGetDownloadLinkTool": false,
        "isLocked": false,
        "sourceBuildInAgent": "550e8400-e29b-41d4-a716-446655440000",
        "canUpdate": false,
        "canDelete": false,
        "team": {
          "id": "550e8400-e29b-41d4-a716-446655440000",
          "name": "レスポンス文字列"
        },
        "webChatIsActive": false,
        "apiIsActive": false,
        "fileWorkspaceMode": {},
        "fileWorkspaceFolder": "550e8400-e29b-41d4-a716-446655440000",
        "fileWorkspaceStatus": {
          "name": "example.pdf",
          "content": "base64encoded_content",
          "contentType": "application/pdf"
        },
        "fileWorkspaceAvailable": false
      },
      "canRead": false,
      "canUpdate": false,
      "canDelete": false,
      "createdAt": "レスポンス文字列"
    }
  ]
}
```

***

### ロールの受信トレイ一覧を取得 <a href="#organizations-groups-group-inboxes-list" id="organizations-groups-group-inboxes-list"></a>

GET `/api/v1/organizations/{organizationPk}/groups/{groupPk}/group-inboxes/`

#### パラメータ

| パラメータ名           | 必須 | 型       | 説明                                                                                                                                                                                                                                |
| ---------------- | -- | ------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `groupPk`        | ✅  | string  |                                                                                                                                                                                                                                   |
| `organizationPk` | ✅  | string  | A UUID string identifying this 組織 ID                                                                                                                                                                                              |
| `channelType`    | ❌  | string  | \`line\`: LINE ; \`telegram\`: Telegram ; \`teams\`: Teams ; \`web\`: Web ; \`messenger\`: Messenger ; \`instagram\`: Instagram ; \`email\`: Email ; \`whatsapp\`: WhatsApp ; \`slack\`: Slack ; \`team\_plus\`: Team+ ; \`lin... |
| `chatbot`        | ❌  | string  |                                                                                                                                                                                                                                   |
| `isActive`       | ❌  | boolean |                                                                                                                                                                                                                                   |
| `page`           | ❌  | integer | A page number within the paginated result set.                                                                                                                                                                                    |
| `pageSize`       | ❌  | integer | Number of results to return per page.                                                                                                                                                                                             |
| `query`          | ❌  | string  |                                                                                                                                                                                                                                   |
| `search`         | ❌  | string  |                                                                                                                                                                                                                                   |

#### コードサンプル

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

```bash
# API 呼び出しのサンプル (Shell)
curl -X GET "https://api.maiagent.ai/api/v1/organizations/550e8400-e29b-41d4-a716-446655440000/groups/550e8400-e29b-41d4-a716-446655440000/group-inboxes/?channelType=email&chatbot=550e8400-e29b-41d4-a716-446655440000&isActive=true&page=1&pageSize=1&query=example&search=example" \
  -H "Authorization: Api-Key YOUR_API_KEY"

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

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

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

axios.get("https://api.maiagent.ai/api/v1/organizations/550e8400-e29b-41d4-a716-446655440000/groups/550e8400-e29b-41d4-a716-446655440000/group-inboxes/?channelType=email&chatbot=550e8400-e29b-41d4-a716-446655440000&isActive=true&page=1&pageSize=1&query=example&search=example", config)
  .then(response => {
    console.log('レスポンスを正常に取得しました:');
    console.log(response.data);
  })
  .catch(error => {
    console.error('リクエストでエラーが発生しました:');
    console.error(error.response?.data || error.message);
  });
```

```python
import requests

url = "https://api.maiagent.ai/api/v1/organizations/550e8400-e29b-41d4-a716-446655440000/groups/550e8400-e29b-41d4-a716-446655440000/group-inboxes/?channelType=email&chatbot=550e8400-e29b-41d4-a716-446655440000&isActive=true&page=1&pageSize=1&query=example&search=example"
headers = {
    "Authorization": "Api-Key YOUR_API_KEY"
}


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

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

$client = new GuzzleHttp\Client();

try {
    $response = $client->get("https://api.maiagent.ai/api/v1/organizations/550e8400-e29b-41d4-a716-446655440000/groups/550e8400-e29b-41d4-a716-446655440000/group-inboxes/?channelType=email&chatbot=550e8400-e29b-41d4-a716-446655440000&isActive=true&page=1&pageSize=1&query=example&search=example", [
        'headers' => [
            'Authorization' => 'Api-Key YOUR_API_KEY'
        ]
    ]);
    
    $data = json_decode($response->getBody(), true);
    echo "レスポンスを正常に取得しました:\n";
    print_r($data);
} catch (Exception $e) {
    echo 'リクエストでエラーが発生しました: ' . $e->getMessage();
}
?>
```

#### レスポンス内容

**ステータスコード: 200**

**レスポンス構造の例**

```typescript
{
  "count": integer
  "next"?: string (uri) // 任意
  "previous"?: string (uri) // 任意
  "results": [
    {
      "id": string (uuid)
      "group": string (uuid)
      "inbox": 
      {
        "id": string (uuid)
        "channelType": string (enum: line, telegram, teams, web, messenger, instagram, email, whatsapp, slack, team_plus, line_works, viber) // * `line` - LINE
* `telegram` - Telegram
* `teams` - Teams
* `web` - Web
* `messenger` - Messenger
* `instagram` - Instagram
* `email` - Email
* `whatsapp` - WhatsApp
* `slack` - Slack
* `team_plus` - Team+
* `line_works` - LINE WORKS
* `viber` - Viber
        "name": string
        "unreadConversationsCount": integer
        "accessType": string
      }
      "canRead"?: boolean // 任意
      "canUpdate"?: boolean // 任意
      "canDelete"?: boolean // 任意
      "canViewConversations"?: boolean // Whether group members can browse all conversations of this inbox in the conversations page. Independent from can_read, which controls using the inbox for chatting. (任意)
      "createdAt": string (timestamp)
    }
  ]
}
```

**レスポンス値の例**

```json
{
  "count": 123,
  "next": "http://api.example.org/accounts/?page=4",
  "previous": "http://api.example.org/accounts/?page=2",
  "results": [
    {
      "id": "550e8400-e29b-41d4-a716-446655440000",
      "group": "550e8400-e29b-41d4-a716-446655440000",
      "inbox": {
        "id": "550e8400-e29b-41d4-a716-446655440000",
        "channelType": "line",
        "name": "レスポンス文字列",
        "unreadConversationsCount": 456,
        "accessType": "レスポンス文字列"
      },
      "canRead": false,
      "canUpdate": false,
      "canDelete": false,
      "canViewConversations": false,
      "createdAt": "レスポンス文字列"
    }
  ]
}
```

***

### ロールのナレッジベース一覧の取得 <a href="#organizations-groups-group-knowledge-bases-list" id="organizations-groups-group-knowledge-bases-list"></a>

GET `/api/v1/organizations/{organizationPk}/groups/{groupPk}/group-knowledge-bases/`

#### パラメータ

| パラメータ名           | 必須 | 型       | 説明                                             |
| ---------------- | -- | ------- | ---------------------------------------------- |
| `groupPk`        | ✅  | string  |                                                |
| `organizationPk` | ✅  | string  | A UUID string identifying this 組織 ID           |
| `page`           | ❌  | integer | A page number within the paginated result set. |
| `pageSize`       | ❌  | integer | Number of results to return per page.          |
| `query`          | ❌  | string  |                                                |
| `search`         | ❌  | string  |                                                |

#### コードサンプル

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

```bash
# API 呼び出しのサンプル (Shell)
curl -X GET "https://api.maiagent.ai/api/v1/organizations/550e8400-e29b-41d4-a716-446655440000/groups/550e8400-e29b-41d4-a716-446655440000/group-knowledge-bases/?page=1&pageSize=1&query=example&search=example" \
  -H "Authorization: Api-Key YOUR_API_KEY"

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

{% endtab %}

{% tab title="JavaScript" %}

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

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

axios.get("https://api.maiagent.ai/api/v1/organizations/550e8400-e29b-41d4-a716-446655440000/groups/550e8400-e29b-41d4-a716-446655440000/group-knowledge-bases/?page=1&pageSize=1&query=example&search=example", 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/organizations/550e8400-e29b-41d4-a716-446655440000/groups/550e8400-e29b-41d4-a716-446655440000/group-knowledge-bases/?page=1&pageSize=1&query=example&search=example"
headers = {
    "Authorization": "Api-Key YOUR_API_KEY"
}


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/organizations/550e8400-e29b-41d4-a716-446655440000/groups/550e8400-e29b-41d4-a716-446655440000/group-knowledge-bases/?page=1&pageSize=1&query=example&search=example", [
        'headers' => [
            'Authorization' => 'Api-Key YOUR_API_KEY'
        ]
    ]);
    
    $data = json_decode($response->getBody(), true);
    echo "レスポンスを正常に取得しました:\n";
    print_r($data);
} catch (Exception $e) {
    echo 'リクエストでエラーが発生しました: ' . $e->getMessage();
}
?>
```

{% endtab %}
{% endtabs %}

#### レスポンス内容

**ステータスコード: 200**

**レスポンス構造の例**

```typescript
{
  "count": integer
  "next"?: string (uri) // 任意
  "previous"?: string (uri) // 任意
  "results": [
    {
      "id": string (uuid)
      "group": string (uuid)
      "knowledgeBase": 
      {
        "id": string (uuid)
        "createdBy": 
        {
          "id": string (uuid)
          "name": string
        }
        "organization"?: string (uuid) // 任意
        "embeddingModel": string (uuid)
        "rerankerModel": string (uuid)
        "name": string
        "description"?: string // 任意
        "numberOfRetrievedChunks"?: integer // 取得する参照データの件数。デフォルトは 12、最小値は 1 (任意)
        "enableHyde"?: boolean // HyDE を有効にします。デフォルトは False (任意)
        "similarityCutoff"?: number (double) // 類似度のしきい値。デフォルトは 0.0、範囲は 0.0〜1.0 (任意)
        "enableRerank"?: boolean // リランキングを有効にするかどうか。デフォルトは True (任意)
        "enableRrf"?: boolean // Enable Reciprocal Rank Fusion for hybrid search. Disable this if using a custom Elasticsearch without enterprise license. (任意)
        "vectorDatabaseType"?:  // Type of vector database: elasticsearch or opensearch.

* `elasticsearch` - Elasticsearch
* `opensearch` - OpenSearch
* `oracle` - Oracle AI Database 26ai
* `synxdb` - SynxDB (任意)
        {
        }
        "vectorDatabaseUrl"?: string // Custom vector database endpoint URL or Oracle DSN. For Elasticsearch/OpenSearch: URL format (e.g., "https://host:9200"). For Oracle: DSN format (e.g., "host:1521/service_name"). (任意)
        "vectorDatabaseApiKey"?: string // API Key for Elasticsearch. Not used for OpenSearch. (任意)
        "opensearchUsername"?: string // Username for OpenSearch Basic Auth. (任意)
        "opensearchPassword"?: string // Password for OpenSearch Basic Auth. (任意)
        "oracleUser"?: string // Oracle database username. (任意)
        "oraclePassword"?: string // Oracle database password. (任意)
        "synxdbUser"?: string // SynxDB database username. (任意)
        "synxdbPassword"?: string // SynxDB database password. (任意)
        "labels": [
          {
            "id": string (uuid)
            "name": string
          }
        ]
        "chatbots"?: [ // 任意
          {
            "id": string (uuid)
            "name": string
          }
        ]
        "groups"?: [ // ナレッジベースにアクセスできるグループの一覧 (任意)
          {
            "id": string (uuid)
            "name": string
          }
        ]
        "filesCount": integer // Return count of KnowledgeBaseFile excluding processed files, conversation attachments, and soft-deleted.
        "vectorStorageSize": integer
        "chunksCount": integer
        "canUpdate": boolean // Return whether the current user can update this resource.
        "canDelete": boolean // Return whether the current user can delete this resource.
        "createdAt": string (timestamp)
        "updatedAt": string (timestamp)
      }
      "canRead"?: boolean // 任意
      "canUpdate"?: boolean // 任意
      "canDelete"?: boolean // 任意
      "createdAt": string (timestamp)
    }
  ]
}
```

**レスポンス値の例**

```json
{
  "count": 123,
  "next": "http://api.example.org/accounts/?page=4",
  "previous": "http://api.example.org/accounts/?page=2",
  "results": [
    {
      "id": "550e8400-e29b-41d4-a716-446655440000",
      "group": "550e8400-e29b-41d4-a716-446655440000",
      "knowledgeBase": {
        "id": "550e8400-e29b-41d4-a716-446655440000",
        "createdBy": {
          "id": "550e8400-e29b-41d4-a716-446655440000",
          "name": "レスポンス文字列"
        },
        "organization": "550e8400-e29b-41d4-a716-446655440000",
        "embeddingModel": "550e8400-e29b-41d4-a716-446655440000",
        "rerankerModel": "550e8400-e29b-41d4-a716-446655440000",
        "name": "レスポンス文字列",
        "description": "レスポンス文字列",
        "numberOfRetrievedChunks": 456,
        "enableHyde": false,
        "similarityCutoff": 456,
        "enableRerank": false,
        "enableRrf": false,
        "vectorDatabaseType": {},
        "vectorDatabaseUrl": "レスポンス文字列",
        "vectorDatabaseApiKey": "レスポンス文字列",
        "opensearchUsername": "レスポンス文字列",
        "opensearchPassword": "レスポンス文字列",
        "oracleUser": "レスポンス文字列",
        "oraclePassword": "レスポンス文字列",
        "synxdbUser": "レスポンス文字列",
        "synxdbPassword": "レスポンス文字列",
        "labels": [
          {
            "id": "550e8400-e29b-41d4-a716-446655440000",
            "name": "レスポンス文字列"
          }
        ],
        "chatbots": [
          {
            "id": "550e8400-e29b-41d4-a716-446655440000",
            "name": "レスポンス文字列"
          }
        ],
        "groups": [
          {
            "id": "550e8400-e29b-41d4-a716-446655440000",
            "name": "レスポンス文字列"
          }
        ],
        "filesCount": 456,
        "vectorStorageSize": 456,
        "chunksCount": 456,
        "canUpdate": false,
        "canDelete": false,
        "createdAt": "レスポンス文字列",
        "updatedAt": "レスポンス文字列"
      },
      "canRead": false,
      "canUpdate": false,
      "canDelete": false,
      "createdAt": "レスポンス文字列"
    }
  ]
}
```

***

### ロールのデータベース一覧の取得 <a href="#organizations-groups-group-databases-list" id="organizations-groups-group-databases-list"></a>

GET `/api/v1/organizations/{organizationPk}/groups/{groupPk}/group-databases/`

#### パラメータ

| パラメータ名           | 必須 | 型       | 説明                                             |
| ---------------- | -- | ------- | ---------------------------------------------- |
| `groupPk`        | ✅  | string  |                                                |
| `organizationPk` | ✅  | string  | A UUID string identifying this 組織 ID           |
| `page`           | ❌  | integer | A page number within the paginated result set. |
| `pageSize`       | ❌  | integer | Number of results to return per page.          |
| `query`          | ❌  | string  |                                                |
| `search`         | ❌  | string  |                                                |

#### コードサンプル

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

```bash
# API 呼び出しのサンプル (Shell)
curl -X GET "https://api.maiagent.ai/api/v1/organizations/550e8400-e29b-41d4-a716-446655440000/groups/550e8400-e29b-41d4-a716-446655440000/group-databases/?page=1&pageSize=1&query=example&search=example" \
  -H "Authorization: Api-Key YOUR_API_KEY"

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

{% endtab %}

{% tab title="JavaScript" %}

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

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

axios.get("https://api.maiagent.ai/api/v1/organizations/550e8400-e29b-41d4-a716-446655440000/groups/550e8400-e29b-41d4-a716-446655440000/group-databases/?page=1&pageSize=1&query=example&search=example", 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/organizations/550e8400-e29b-41d4-a716-446655440000/groups/550e8400-e29b-41d4-a716-446655440000/group-databases/?page=1&pageSize=1&query=example&search=example"
headers = {
    "Authorization": "Api-Key YOUR_API_KEY"
}


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/organizations/550e8400-e29b-41d4-a716-446655440000/groups/550e8400-e29b-41d4-a716-446655440000/group-databases/?page=1&pageSize=1&query=example&search=example", [
        'headers' => [
            'Authorization' => 'Api-Key YOUR_API_KEY'
        ]
    ]);
    
    $data = json_decode($response->getBody(), true);
    echo "レスポンスを正常に取得しました:\n";
    print_r($data);
} catch (Exception $e) {
    echo 'リクエストでエラーが発生しました: ' . $e->getMessage();
}
?>
```

{% endtab %}
{% endtabs %}

#### レスポンス内容

**ステータスコード: 200**

**レスポンス構造の例**

```typescript
{
  "count": integer
  "next"?: string (uri) // 任意
  "previous"?: string (uri) // 任意
  "results": [
    {
      "id": string (uuid)
      "group": string (uuid)
      "database": 
      {
        "id": string (uuid)
        "name": string // Display name for this database connection
        "description": string // Description of the database and its purpose
        "databaseType":  // Type of database: PostgreSQL, MySQL, MSSQL, Oracle, SynxDB, or MaiAgent

* `postgresql` - PostgreSQL
* `mysql` - MySQL
* `maiagent` - MaiAgent
* `oracle` - Oracle
* `mssql` - MSSQL
* `synxdb` - SynxDB
        {
        }
        "includeTables": object // Optional list of tables to include. Format: {"tables": ["table1", "table2"]}. For MaiAgent type, this is auto-populated from uploaded files.
        "isActive": boolean // When disabled, this database will not be used in Text-to-SQL queries
        "status": 
        {
        }
        "deletedAt": string (timestamp)
        "tables": [
          {
            "id": string (uuid)
            "tableName": string // Name of the table in the database
            "sheetName": string // Name of the source worksheet/sheet this table was created from. Empty for tables created before this field was added.
            "description"?: string // Description of the table and its data for better Text-to-SQL understanding (任意)
            "status": 
            {
            }
            "errorMessage": string // Error details if table creation or deletion failed
            "sourceFile": 
            {
              "id": string (uuid)
              "name": string
              "isFromKnowledgeBase": boolean // Determine if the source file originated from a knowledge base upload.

Returns True if the file was uploaded via knowledge base,
False if uploaded directly to the database.
            }
            "columns": [
              {
                "id": string (uuid)
                "columnName": string
                "columnType"?: string // Data type of the column (e.g., VARCHAR, INTEGER, TIMESTAMP) (任意)
                "description"?: string // Description of the column for better Text-to-SQL understanding (任意)
                "isPrimaryKey"?: boolean // 任意
                "isNullable"?: boolean // 任意
                "createdAt": string (timestamp)
                "updatedAt": string (timestamp)
              }
            ]
            "createdAt": string (timestamp)
            "updatedAt": string (timestamp)
          }
        ]
        "chatbots": [
          {
            "id": string (uuid)
            "name": string
          }
        ]
        "groups": [
          {
            "id": string (uuid)
            "name": string
          }
        ]
        "createdAt": string (timestamp)
        "updatedAt": string (timestamp)
      }
      "canRead"?: boolean // 任意
      "canUpdate"?: boolean // 任意
      "canDelete"?: boolean // 任意
      "createdAt": string (timestamp)
    }
  ]
}
```

**レスポンス値の例**

```json
{
  "count": 123,
  "next": "http://api.example.org/accounts/?page=4",
  "previous": "http://api.example.org/accounts/?page=2",
  "results": [
    {
      "id": "550e8400-e29b-41d4-a716-446655440000",
      "group": "550e8400-e29b-41d4-a716-446655440000",
      "database": {
        "id": "550e8400-e29b-41d4-a716-446655440000",
        "name": "レスポンス文字列",
        "description": "レスポンス文字列",
        "databaseType": {},
        "includeTables": null,
        "isActive": false,
        "status": {},
        "deletedAt": "レスポンス文字列",
        "tables": [
          {
            "id": "550e8400-e29b-41d4-a716-446655440000",
            "tableName": "レスポンス文字列",
            "sheetName": "レスポンス文字列",
            "description": "レスポンス文字列",
            "status": {},
            "errorMessage": "レスポンス文字列",
            "sourceFile": {
              "id": "550e8400-e29b-41d4-a716-446655440000",
              "name": "レスポンス文字列",
              "isFromKnowledgeBase": false
            },
            "columns": [
              {
                "id": "550e8400-e29b-41d4-a716-446655440000",
                "columnName": "レスポンス文字列",
                "columnType": "レスポンス文字列",
                "description": "レスポンス文字列",
                "isPrimaryKey": false,
                "isNullable": false,
                "createdAt": "レスポンス文字列",
                "updatedAt": "レスポンス文字列"
              }
            ],
            "createdAt": "レスポンス文字列",
            "updatedAt": "レスポンス文字列"
          }
        ],
        "chatbots": [
          {
            "id": "550e8400-e29b-41d4-a716-446655440000",
            "name": "レスポンス文字列"
          }
        ],
        "groups": [
          {
            "id": "550e8400-e29b-41d4-a716-446655440000",
            "name": "レスポンス文字列"
          }
        ],
        "createdAt": "レスポンス文字列",
        "updatedAt": "レスポンス文字列"
      },
      "canRead": false,
      "canUpdate": false,
      "canDelete": false,
      "createdAt": "レスポンス文字列"
    }
  ]
}
```

***

### ロールの更新 <a href="#organizations-groups-update" id="organizations-groups-update"></a>

PUT `/api/v1/organizations/{organizationPk}/groups/{id}/`

#### パラメータ

| パラメータ名           | 必須 | 型      | 説明                                    |
| ---------------- | -- | ------ | ------------------------------------- |
| `id`             | ✅  | string | A UUID string identifying this Group. |
| `organizationPk` | ✅  | string | A UUID string identifying this 組織 ID  |

#### リクエストボディ

**リクエストパラメータ**

| フィールド                    | 型              | 必須  | 説明                                                                                                                                                                                                          |
| ------------------------ | -------------- | --- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| name                     | string         | はい  |                                                                                                                                                                                                             |
| organization             | string (uuid)  | いいえ |                                                                                                                                                                                                             |
| permissions              | array\[string] | はい  |                                                                                                                                                                                                             |
| canCreateChatbot         | boolean        | いいえ |                                                                                                                                                                                                             |
| canCreateKnowledgeBase   | boolean        | いいえ |                                                                                                                                                                                                             |
| canCreateInbox           | boolean        | いいえ |                                                                                                                                                                                                             |
| canCreateDatabase        | boolean        | いいえ |                                                                                                                                                                                                             |
| canCreateTool            | boolean        | いいえ |                                                                                                                                                                                                             |
| canCreateAgentUiTool     | boolean        | いいえ |                                                                                                                                                                                                             |
| canCreateSkill           | boolean        | いいえ |                                                                                                                                                                                                             |
| maigptCanCodeInterpreter | boolean        | いいえ | Whether members of this role may use the code interpreter built-in tool in MaiGPT.                                                                                                                          |
| maigptCanRag             | boolean        | いいえ | Whether members of this role may use the knowledge base RAG built-in tool in MaiGPT.                                                                                                                        |
| maigptCanDeepResearch    | boolean        | いいえ | Whether members of this role may use Deep Research in MaiGPT. Deep Research reaches the public internet through its own built-in search, so a role that revokes the official web-search tools needs this... |
| maigptCanBrowserTool     | boolean        | いいえ | Whether members of this role may use the browser built-in tool in MaiGPT.                                                                                                                                   |
| maigptAllLlms            | boolean        | いいえ | Whether members of this role may use every organization-available LLM in MaiGPT. Off = only the bound LLMs; an empty binding then means none.                                                               |
| maigptAllTools           | boolean        | いいえ | Whether members of this role may call every official (global) tool in MaiGPT. Off = only the bound tools; an empty binding then means none.                                                                 |
| maigptAllConnectors      | boolean        | いいえ | Whether members of this role may call every official (global) MCP connector in MaiGPT. Off = only the bound connectors; an empty binding then means none.                                                   |
| maigptAllSkills          | boolean        | いいえ | Whether members of this role may use every official (global) skill in MaiGPT. Off = only the bound skills; an empty binding then means none.                                                                |
| usageStatisticsScope     | object         | いいえ | What this role's usage statistics permission shows: the whole organization, or only the AI assistants granted to the member's roles. A member with any organization-wide granting role sees the whole or... |
| allowedLlms              | array\[string] | いいえ |                                                                                                                                                                                                             |
| allowedTools             | array\[string] | いいえ |                                                                                                                                                                                                             |
| allowedConnectors        | array\[string] | いいえ |                                                                                                                                                                                                             |
| allowedSkills            | array\[string] | いいえ |                                                                                                                                                                                                             |

**リクエストスキーマの例**

```typescript
{
  "name": string
  "organization"?: string (uuid) // 任意
  "permissions": [
    string (uuid)
  ]
  "canCreateChatbot"?: boolean // 任意
  "canCreateKnowledgeBase"?: boolean // 任意
  "canCreateInbox"?: boolean // 任意
  "canCreateDatabase"?: boolean // 任意
  "canCreateTool"?: boolean // 任意
  "canCreateAgentUiTool"?: boolean // 任意
  "canCreateSkill"?: boolean // 任意
  "maigptCanCodeInterpreter"?: boolean // Whether members of this role may use the code interpreter built-in tool in MaiGPT. (任意)
  "maigptCanRag"?: boolean // Whether members of this role may use the knowledge base RAG built-in tool in MaiGPT. (任意)
  "maigptCanDeepResearch"?: boolean // Whether members of this role may use Deep Research in MaiGPT. Deep Research reaches the public internet through its own built-in search, so a role that revokes the official web-search tools needs this switch too. (任意)
  "maigptCanBrowserTool"?: boolean // Whether members of this role may use the browser built-in tool in MaiGPT. (任意)
  "maigptAllLlms"?: boolean // Whether members of this role may use every organization-available LLM in MaiGPT. Off = only the bound LLMs; an empty binding then means none. (任意)
  "maigptAllTools"?: boolean // Whether members of this role may call every official (global) tool in MaiGPT. Off = only the bound tools; an empty binding then means none. (任意)
  "maigptAllConnectors"?: boolean // Whether members of this role may call every official (global) MCP connector in MaiGPT. Off = only the bound connectors; an empty binding then means none. (任意)
  "maigptAllSkills"?: boolean // Whether members of this role may use every official (global) skill in MaiGPT. Off = only the bound skills; an empty binding then means none. (任意)
  "usageStatisticsScope"?:  // What this role's usage statistics permission shows: the whole organization, or only the AI assistants granted to the member's roles. A member with any organization-wide granting role sees the whole organization.

* `organization` - Organization-wide
* `accessible_chatbots` - Authorized AI assistants only (任意)
  {
  }
  "allowedLlms"?: [ // 任意
    string (uuid)
  ]
  "allowedTools"?: [ // 任意
    string (uuid)
  ]
  "allowedConnectors"?: [ // 任意
    string (uuid)
  ]
  "allowedSkills"?: [ // 任意
    string (uuid)
  ]
}
```

**リクエスト値の例**

```json
{
  "name": "名前の例",
  "organization": "550e8400-e29b-41d4-a716-446655440000",
  "permissions": [
    "550e8400-e29b-41d4-a716-446655440000"
  ],
  "canCreateChatbot": true,
  "canCreateKnowledgeBase": true,
  "canCreateInbox": true,
  "canCreateDatabase": true,
  "canCreateTool": true,
  "canCreateAgentUiTool": true,
  "canCreateSkill": true,
  "maigptCanCodeInterpreter": true,
  "maigptCanRag": true,
  "maigptCanDeepResearch": true,
  "maigptCanBrowserTool": true,
  "maigptAllLlms": true,
  "maigptAllTools": true,
  "maigptAllConnectors": true,
  "maigptAllSkills": true,
  "usageStatisticsScope": {},
  "allowedLlms": [
    "550e8400-e29b-41d4-a716-446655440000"
  ],
  "allowedTools": [
    "550e8400-e29b-41d4-a716-446655440000"
  ],
  "allowedConnectors": [
    "550e8400-e29b-41d4-a716-446655440000"
  ],
  "allowedSkills": [
    "550e8400-e29b-41d4-a716-446655440000"
  ]
}
```

#### コード例

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

```bash
# API 呼び出しの例 (Shell)
curl -X PUT "https://api.maiagent.ai/api/v1/organizations/550e8400-e29b-41d4-a716-446655440000/groups/550e8400-e29b-41d4-a716-446655440000/" \
  -H "Authorization: Api-Key YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "名前の例",
    "organization": "550e8400-e29b-41d4-a716-446655440000",
    "permissions": [
      "550e8400-e29b-41d4-a716-446655440000"
    ],
    "canCreateChatbot": true,
    "canCreateKnowledgeBase": true,
    "canCreateInbox": true,
    "canCreateDatabase": true,
    "canCreateTool": true,
    "canCreateAgentUiTool": true,
    "canCreateSkill": true,
    "maigptCanCodeInterpreter": true,
    "maigptCanRag": true,
    "maigptCanDeepResearch": true,
    "maigptCanBrowserTool": true,
    "maigptAllLlms": true,
    "maigptAllTools": true,
    "maigptAllConnectors": true,
    "maigptAllSkills": true,
    "usageStatisticsScope": {},
    "allowedLlms": [
      "550e8400-e29b-41d4-a716-446655440000"
    ],
    "allowedTools": [
      "550e8400-e29b-41d4-a716-446655440000"
    ],
    "allowedConnectors": [
      "550e8400-e29b-41d4-a716-446655440000"
    ],
    "allowedSkills": [
      "550e8400-e29b-41d4-a716-446655440000"
    ]
  }'

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

{% endtab %}

{% tab title="JavaScript" %}

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

// リクエストヘッダーを設定
const config = {
  headers: {
    'Authorization': 'Api-Key YOUR_API_KEY',
    'Content-Type': 'application/json'
  }
};

// リクエストボディ (payload)
const data = {
    "name": "名前の例",
    "organization": "550e8400-e29b-41d4-a716-446655440000",
    "permissions": [
      "550e8400-e29b-41d4-a716-446655440000"
    ],
    "canCreateChatbot": true,
    "canCreateKnowledgeBase": true,
    "canCreateInbox": true,
    "canCreateDatabase": true,
    "canCreateTool": true,
    "canCreateAgentUiTool": true,
    "canCreateSkill": true,
    "maigptCanCodeInterpreter": true,
    "maigptCanRag": true,
    "maigptCanDeepResearch": true,
    "maigptCanBrowserTool": true,
    "maigptAllLlms": true,
    "maigptAllTools": true,
    "maigptAllConnectors": true,
    "maigptAllSkills": true,
    "usageStatisticsScope": {},
    "allowedLlms": [
      "550e8400-e29b-41d4-a716-446655440000"
    ],
    "allowedTools": [
      "550e8400-e29b-41d4-a716-446655440000"
    ],
    "allowedConnectors": [
      "550e8400-e29b-41d4-a716-446655440000"
    ],
    "allowedSkills": [
      "550e8400-e29b-41d4-a716-446655440000"
    ]
  };

axios.put("https://api.maiagent.ai/api/v1/organizations/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/organizations/550e8400-e29b-41d4-a716-446655440000/groups/550e8400-e29b-41d4-a716-446655440000/"
headers = {
    "Authorization": "Api-Key YOUR_API_KEY",
    "Content-Type": "application/json"
}

# リクエストボディ (payload)
data = {
    "name": "名前の例",
    "organization": "550e8400-e29b-41d4-a716-446655440000",
    "permissions": [
        "550e8400-e29b-41d4-a716-446655440000"
    ],
    "canCreateChatbot": True,
    "canCreateKnowledgeBase": True,
    "canCreateInbox": True,
    "canCreateDatabase": True,
    "canCreateTool": True,
    "canCreateAgentUiTool": True,
    "canCreateSkill": True,
    "maigptCanCodeInterpreter": True,
    "maigptCanRag": True,
    "maigptCanDeepResearch": True,
    "maigptCanBrowserTool": True,
    "maigptAllLlms": True,
    "maigptAllTools": True,
    "maigptAllConnectors": True,
    "maigptAllSkills": True,
    "usageStatisticsScope": {},
    "allowedLlms": [
        "550e8400-e29b-41d4-a716-446655440000"
    ],
    "allowedTools": [
        "550e8400-e29b-41d4-a716-446655440000"
    ],
    "allowedConnectors": [
        "550e8400-e29b-41d4-a716-446655440000"
    ],
    "allowedSkills": [
        "550e8400-e29b-41d4-a716-446655440000"
    ]
}

response = requests.put(url, json=data, 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/organizations/550e8400-e29b-41d4-a716-446655440000/groups/550e8400-e29b-41d4-a716-446655440000/", [
        'headers' => [
            'Authorization' => 'Api-Key YOUR_API_KEY',
            'Content-Type' => 'application/json'
        ],
        'json' => [
            'name' => '名前の例',
            'organization' => '550e8400-e29b-41d4-a716-446655440000',
            'permissions' => [
                '550e8400-e29b-41d4-a716-446655440000'
            ],
            'canCreateChatbot' => true,
            'canCreateKnowledgeBase' => true,
            'canCreateInbox' => true,
            'canCreateDatabase' => true,
            'canCreateTool' => true,
            'canCreateAgentUiTool' => true,
            'canCreateSkill' => true,
            'maigptCanCodeInterpreter' => true,
            'maigptCanRag' => true,
            'maigptCanDeepResearch' => true,
            'maigptCanBrowserTool' => true,
            'maigptAllLlms' => true,
            'maigptAllTools' => true,
            'maigptAllConnectors' => true,
            'maigptAllSkills' => true,
            'usageStatisticsScope' => new \stdClass(),
            'allowedLlms' => [
                '550e8400-e29b-41d4-a716-446655440000'
            ],
            'allowedTools' => [
                '550e8400-e29b-41d4-a716-446655440000'
            ],
            'allowedConnectors' => [
                '550e8400-e29b-41d4-a716-446655440000'
            ],
            'allowedSkills' => [
                '550e8400-e29b-41d4-a716-446655440000'
            ]
        ]
    ]);
    
    $data = json_decode($response->getBody(), true);
    echo "レスポンスを正常に取得しました:\n";
    print_r($data);
} catch (Exception $e) {
    echo 'リクエストでエラーが発生しました: ' . $e->getMessage();
}
?>
```

{% endtab %}
{% endtabs %}

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

**ステータスコード: 200**

**レスポンススキーマの例**

```typescript
{
  "id": string (uuid)
  "name": string
  "type": 
  {
  }
  "permissions": [
    object
  ]
  "membersPreview": [
    string
  ]
  "membersCount": integer // 残りのメンバー数（リストに表示される 3 人を差し引いた数）を返します。フロントエンドの +N バッジ表示に使用します

リソースの count とは異なります：
- members_count: total - 3 を返します（+N バッジ用）。None は総数が <= 3 であることを示します
- chatbots_count/knowledge_bases_count/inboxes_count: 総数を返します
  "chatbotsCount": integer
  "chatbotsPreview": [
    string
  ]
  "knowledgeBasesCount": integer
  "knowledgeBasesPreview": [
    string
  ]
  "inboxesCount": integer
  "inboxesPreview": [
    string
  ]
  "databasesCount": integer
  "databasesPreview": [
    string
  ]
  "canCreateChatbot"?: boolean // 任意
  "canCreateKnowledgeBase"?: boolean // 任意
  "canCreateInbox"?: boolean // 任意
  "canCreateDatabase"?: boolean // 任意
  "canCreateTool"?: boolean // 任意
  "canCreateAgentUiTool"?: boolean // 任意
  "canCreateSkill"?: boolean // 任意
  "maigptCanCodeInterpreter"?: boolean // Whether members of this role may use the code interpreter built-in tool in MaiGPT. (任意)
  "maigptCanRag"?: boolean // Whether members of this role may use the knowledge base RAG built-in tool in MaiGPT. (任意)
  "maigptCanDeepResearch"?: boolean // Whether members of this role may use Deep Research in MaiGPT. Deep Research reaches the public internet through its own built-in search, so a role that revokes the official web-search tools needs this switch too. (任意)
  "maigptCanBrowserTool"?: boolean // Whether members of this role may use the browser built-in tool in MaiGPT. (任意)
  "maigptAllLlms"?: boolean // Whether members of this role may use every organization-available LLM in MaiGPT. Off = only the bound LLMs; an empty binding then means none. (任意)
  "maigptAllTools"?: boolean // Whether members of this role may call every official (global) tool in MaiGPT. Off = only the bound tools; an empty binding then means none. (任意)
  "maigptAllConnectors"?: boolean // Whether members of this role may call every official (global) MCP connector in MaiGPT. Off = only the bound connectors; an empty binding then means none. (任意)
  "maigptAllSkills"?: boolean // Whether members of this role may use every official (global) skill in MaiGPT. Off = only the bound skills; an empty binding then means none. (任意)
  "usageStatisticsScope"?:  // What this role's usage statistics permission shows: the whole organization, or only the AI assistants granted to the member's roles. A member with any organization-wide granting role sees the whole organization.

* `organization` - Organization-wide
* `accessible_chatbots` - Authorized AI assistants only (任意)
  {
  }
  "createdAt": string (timestamp)
}
```

**レスポンス値の例**

```json
{
  "id": "550e8400-e29b-41d4-a716-446655440000",
  "name": "レスポンス文字列",
  "type": {},
  "permissions": [
    {
      "id": "550e8400-e29b-41d4-a716-446655440000",
      "name": "レスポンス名の例",
      "description": "レスポンス説明の例"
    }
  ],
  "membersPreview": [
    "レスポンス文字列"
  ],
  "membersCount": 456,
  "chatbotsCount": 456,
  "chatbotsPreview": [
    "レスポンス文字列"
  ],
  "knowledgeBasesCount": 456,
  "knowledgeBasesPreview": [
    "レスポンス文字列"
  ],
  "inboxesCount": 456,
  "inboxesPreview": [
    "レスポンス文字列"
  ],
  "databasesCount": 456,
  "databasesPreview": [
    "レスポンス文字列"
  ],
  "canCreateChatbot": false,
  "canCreateKnowledgeBase": false,
  "canCreateInbox": false,
  "canCreateDatabase": false,
  "canCreateTool": false,
  "canCreateAgentUiTool": false,
  "canCreateSkill": false,
  "maigptCanCodeInterpreter": false,
  "maigptCanRag": false,
  "maigptCanDeepResearch": false,
  "maigptCanBrowserTool": false,
  "maigptAllLlms": false,
  "maigptAllTools": false,
  "maigptAllConnectors": false,
  "maigptAllSkills": false,
  "usageStatisticsScope": {},
  "createdAt": "レスポンス文字列"
}
```

***

### ロールの部分更新 <a href="#organizations-groups-partial-update" id="organizations-groups-partial-update"></a>

PATCH `/api/v1/organizations/{organizationPk}/groups/{id}/`

#### パラメータ

| パラメータ名           | 必須 | 型      | 説明                                    |
| ---------------- | -- | ------ | ------------------------------------- |
| `id`             | ✅  | string | A UUID string identifying this Group. |
| `organizationPk` | ✅  | string | A UUID string identifying this 組織 ID  |

#### リクエストボディ

**リクエストパラメータ**

| フィールド                    | 型              | 必須  | 説明                                                                                                                                                                                                          |
| ------------------------ | -------------- | --- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| name                     | string         | いいえ |                                                                                                                                                                                                             |
| organization             | string (uuid)  | いいえ |                                                                                                                                                                                                             |
| permissions              | array\[string] | いいえ |                                                                                                                                                                                                             |
| canCreateChatbot         | boolean        | いいえ |                                                                                                                                                                                                             |
| canCreateKnowledgeBase   | boolean        | いいえ |                                                                                                                                                                                                             |
| canCreateInbox           | boolean        | いいえ |                                                                                                                                                                                                             |
| canCreateDatabase        | boolean        | いいえ |                                                                                                                                                                                                             |
| canCreateTool            | boolean        | いいえ |                                                                                                                                                                                                             |
| canCreateAgentUiTool     | boolean        | いいえ |                                                                                                                                                                                                             |
| canCreateSkill           | boolean        | いいえ |                                                                                                                                                                                                             |
| maigptCanCodeInterpreter | boolean        | いいえ | Whether members of this role may use the code interpreter built-in tool in MaiGPT.                                                                                                                          |
| maigptCanRag             | boolean        | いいえ | Whether members of this role may use the knowledge base RAG built-in tool in MaiGPT.                                                                                                                        |
| maigptCanDeepResearch    | boolean        | いいえ | Whether members of this role may use Deep Research in MaiGPT. Deep Research reaches the public internet through its own built-in search, so a role that revokes the official web-search tools needs this... |
| maigptCanBrowserTool     | boolean        | いいえ | Whether members of this role may use the browser built-in tool in MaiGPT.                                                                                                                                   |
| maigptAllLlms            | boolean        | いいえ | Whether members of this role may use every organization-available LLM in MaiGPT. Off = only the bound LLMs; an empty binding then means none.                                                               |
| maigptAllTools           | boolean        | いいえ | Whether members of this role may call every official (global) tool in MaiGPT. Off = only the bound tools; an empty binding then means none.                                                                 |
| maigptAllConnectors      | boolean        | いいえ | Whether members of this role may call every official (global) MCP connector in MaiGPT. Off = only the bound connectors; an empty binding then means none.                                                   |
| maigptAllSkills          | boolean        | いいえ | Whether members of this role may use every official (global) skill in MaiGPT. Off = only the bound skills; an empty binding then means none.                                                                |
| usageStatisticsScope     | object         | いいえ | What this role's usage statistics permission shows: the whole organization, or only the AI assistants granted to the member's roles. A member with any organization-wide granting role sees the whole or... |
| allowedLlms              | array\[string] | いいえ |                                                                                                                                                                                                             |
| allowedTools             | array\[string] | いいえ |                                                                                                                                                                                                             |
| allowedConnectors        | array\[string] | いいえ |                                                                                                                                                                                                             |
| allowedSkills            | array\[string] | いいえ |                                                                                                                                                                                                             |

**リクエストスキーマの例**

```typescript
{
  "name"?: string // 任意
  "organization"?: string (uuid) // 任意
  "permissions"?: [ // 任意
    string (uuid)
  ]
  "canCreateChatbot"?: boolean // 任意
  "canCreateKnowledgeBase"?: boolean // 任意
  "canCreateInbox"?: boolean // 任意
  "canCreateDatabase"?: boolean // 任意
  "canCreateTool"?: boolean // 任意
  "canCreateAgentUiTool"?: boolean // 任意
  "canCreateSkill"?: boolean // 任意
  "maigptCanCodeInterpreter"?: boolean // Whether members of this role may use the code interpreter built-in tool in MaiGPT. (任意)
  "maigptCanRag"?: boolean // Whether members of this role may use the knowledge base RAG built-in tool in MaiGPT. (任意)
  "maigptCanDeepResearch"?: boolean // Whether members of this role may use Deep Research in MaiGPT. Deep Research reaches the public internet through its own built-in search, so a role that revokes the official web-search tools needs this switch too. (任意)
  "maigptCanBrowserTool"?: boolean // Whether members of this role may use the browser built-in tool in MaiGPT. (任意)
  "maigptAllLlms"?: boolean // Whether members of this role may use every organization-available LLM in MaiGPT. Off = only the bound LLMs; an empty binding then means none. (任意)
  "maigptAllTools"?: boolean // Whether members of this role may call every official (global) tool in MaiGPT. Off = only the bound tools; an empty binding then means none. (任意)
  "maigptAllConnectors"?: boolean // Whether members of this role may call every official (global) MCP connector in MaiGPT. Off = only the bound connectors; an empty binding then means none. (任意)
  "maigptAllSkills"?: boolean // Whether members of this role may use every official (global) skill in MaiGPT. Off = only the bound skills; an empty binding then means none. (任意)
  "usageStatisticsScope"?:  // What this role's usage statistics permission shows: the whole organization, or only the AI assistants granted to the member's roles. A member with any organization-wide granting role sees the whole organization.

* `organization` - Organization-wide
* `accessible_chatbots` - Authorized AI assistants only (任意)
  {
  }
  "allowedLlms"?: [ // 任意
    string (uuid)
  ]
  "allowedTools"?: [ // 任意
    string (uuid)
  ]
  "allowedConnectors"?: [ // 任意
    string (uuid)
  ]
  "allowedSkills"?: [ // 任意
    string (uuid)
  ]
}
```

**リクエスト値の例**

```json
{
  "name": "サンプル名",
  "organization": "550e8400-e29b-41d4-a716-446655440000",
  "permissions": [
    "550e8400-e29b-41d4-a716-446655440000"
  ],
  "canCreateChatbot": true,
  "canCreateKnowledgeBase": true,
  "canCreateInbox": true,
  "canCreateDatabase": true,
  "canCreateTool": true,
  "canCreateAgentUiTool": true,
  "canCreateSkill": true,
  "maigptCanCodeInterpreter": true,
  "maigptCanRag": true,
  "maigptCanDeepResearch": true,
  "maigptCanBrowserTool": true,
  "maigptAllLlms": true,
  "maigptAllTools": true,
  "maigptAllConnectors": true,
  "maigptAllSkills": true,
  "usageStatisticsScope": {},
  "allowedLlms": [
    "550e8400-e29b-41d4-a716-446655440000"
  ],
  "allowedTools": [
    "550e8400-e29b-41d4-a716-446655440000"
  ],
  "allowedConnectors": [
    "550e8400-e29b-41d4-a716-446655440000"
  ],
  "allowedSkills": [
    "550e8400-e29b-41d4-a716-446655440000"
  ]
}
```

#### コード例

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

```bash
# API 呼び出しの例 (Shell)
curl -X PATCH "https://api.maiagent.ai/api/v1/organizations/550e8400-e29b-41d4-a716-446655440000/groups/550e8400-e29b-41d4-a716-446655440000/" \
  -H "Authorization: Api-Key YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "サンプル名",
    "organization": "550e8400-e29b-41d4-a716-446655440000",
    "permissions": [
      "550e8400-e29b-41d4-a716-446655440000"
    ],
    "canCreateChatbot": true,
    "canCreateKnowledgeBase": true,
    "canCreateInbox": true,
    "canCreateDatabase": true,
    "canCreateTool": true,
    "canCreateAgentUiTool": true,
    "canCreateSkill": true,
    "maigptCanCodeInterpreter": true,
    "maigptCanRag": true,
    "maigptCanDeepResearch": true,
    "maigptCanBrowserTool": true,
    "maigptAllLlms": true,
    "maigptAllTools": true,
    "maigptAllConnectors": true,
    "maigptAllSkills": true,
    "usageStatisticsScope": {},
    "allowedLlms": [
      "550e8400-e29b-41d4-a716-446655440000"
    ],
    "allowedTools": [
      "550e8400-e29b-41d4-a716-446655440000"
    ],
    "allowedConnectors": [
      "550e8400-e29b-41d4-a716-446655440000"
    ],
    "allowedSkills": [
      "550e8400-e29b-41d4-a716-446655440000"
    ]
  }'

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

{% endtab %}

{% tab title="JavaScript" %}

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

// リクエストヘッダーを設定
const config = {
  headers: {
    'Authorization': 'Api-Key YOUR_API_KEY',
    'Content-Type': 'application/json'
  }
};

// リクエストボディ (payload)
const data = {
    "name": "サンプル名",
    "organization": "550e8400-e29b-41d4-a716-446655440000",
    "permissions": [
      "550e8400-e29b-41d4-a716-446655440000"
    ],
    "canCreateChatbot": true,
    "canCreateKnowledgeBase": true,
    "canCreateInbox": true,
    "canCreateDatabase": true,
    "canCreateTool": true,
    "canCreateAgentUiTool": true,
    "canCreateSkill": true,
    "maigptCanCodeInterpreter": true,
    "maigptCanRag": true,
    "maigptCanDeepResearch": true,
    "maigptCanBrowserTool": true,
    "maigptAllLlms": true,
    "maigptAllTools": true,
    "maigptAllConnectors": true,
    "maigptAllSkills": true,
    "usageStatisticsScope": {},
    "allowedLlms": [
      "550e8400-e29b-41d4-a716-446655440000"
    ],
    "allowedTools": [
      "550e8400-e29b-41d4-a716-446655440000"
    ],
    "allowedConnectors": [
      "550e8400-e29b-41d4-a716-446655440000"
    ],
    "allowedSkills": [
      "550e8400-e29b-41d4-a716-446655440000"
    ]
  };

axios.patch("https://api.maiagent.ai/api/v1/organizations/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/organizations/550e8400-e29b-41d4-a716-446655440000/groups/550e8400-e29b-41d4-a716-446655440000/"
headers = {
    "Authorization": "Api-Key YOUR_API_KEY",
    "Content-Type": "application/json"
}

# リクエストボディ (payload)
data = {
    "name": "サンプル名",
    "organization": "550e8400-e29b-41d4-a716-446655440000",
    "permissions": [
        "550e8400-e29b-41d4-a716-446655440000"
    ],
    "canCreateChatbot": True,
    "canCreateKnowledgeBase": True,
    "canCreateInbox": True,
    "canCreateDatabase": True,
    "canCreateTool": True,
    "canCreateAgentUiTool": True,
    "canCreateSkill": True,
    "maigptCanCodeInterpreter": True,
    "maigptCanRag": True,
    "maigptCanDeepResearch": True,
    "maigptCanBrowserTool": True,
    "maigptAllLlms": True,
    "maigptAllTools": True,
    "maigptAllConnectors": True,
    "maigptAllSkills": True,
    "usageStatisticsScope": {},
    "allowedLlms": [
        "550e8400-e29b-41d4-a716-446655440000"
    ],
    "allowedTools": [
        "550e8400-e29b-41d4-a716-446655440000"
    ],
    "allowedConnectors": [
        "550e8400-e29b-41d4-a716-446655440000"
    ],
    "allowedSkills": [
        "550e8400-e29b-41d4-a716-446655440000"
    ]
}

response = requests.patch(url, json=data, 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/organizations/550e8400-e29b-41d4-a716-446655440000/groups/550e8400-e29b-41d4-a716-446655440000/", [
        'headers' => [
            'Authorization' => 'Api-Key YOUR_API_KEY',
            'Content-Type' => 'application/json'
        ],
        'json' => [
            'name' => 'サンプル名',
            'organization' => '550e8400-e29b-41d4-a716-446655440000',
            'permissions' => [
                '550e8400-e29b-41d4-a716-446655440000'
            ],
            'canCreateChatbot' => true,
            'canCreateKnowledgeBase' => true,
            'canCreateInbox' => true,
            'canCreateDatabase' => true,
            'canCreateTool' => true,
            'canCreateAgentUiTool' => true,
            'canCreateSkill' => true,
            'maigptCanCodeInterpreter' => true,
            'maigptCanRag' => true,
            'maigptCanDeepResearch' => true,
            'maigptCanBrowserTool' => true,
            'maigptAllLlms' => true,
            'maigptAllTools' => true,
            'maigptAllConnectors' => true,
            'maigptAllSkills' => true,
            'usageStatisticsScope' => new \stdClass(),
            'allowedLlms' => [
                '550e8400-e29b-41d4-a716-446655440000'
            ],
            'allowedTools' => [
                '550e8400-e29b-41d4-a716-446655440000'
            ],
            'allowedConnectors' => [
                '550e8400-e29b-41d4-a716-446655440000'
            ],
            'allowedSkills' => [
                '550e8400-e29b-41d4-a716-446655440000'
            ]
        ]
    ]);
    
    $data = json_decode($response->getBody(), true);
    echo "レスポンスを正常に取得しました:\n";
    print_r($data);
} catch (Exception $e) {
    echo 'リクエストでエラーが発生しました: ' . $e->getMessage();
}
?>
```

{% endtab %}
{% endtabs %}

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

**ステータスコード: 200**

**レスポンススキーマの例**

```typescript
{
  "id": string (uuid)
  "name": string
  "type": 
  {
  }
  "permissions": [
    object
  ]
  "membersPreview": [
    string
  ]
  "membersCount": integer // 残りのメンバー数を返します（一覧に表示される 3 人を除いた数）。フロントエンドの +N バッジ表示に使用されます。

リソースの count とは異なります：
- members_count: total - 3 を返します（+N バッジ用）。None は合計が 3 以下であることを示します
- chatbots_count/knowledge_bases_count/inboxes_count: 合計数を返します
  "chatbotsCount": integer
  "chatbotsPreview": [
    string
  ]
  "knowledgeBasesCount": integer
  "knowledgeBasesPreview": [
    string
  ]
  "inboxesCount": integer
  "inboxesPreview": [
    string
  ]
  "databasesCount": integer
  "databasesPreview": [
    string
  ]
  "canCreateChatbot"?: boolean // 任意
  "canCreateKnowledgeBase"?: boolean // 任意
  "canCreateInbox"?: boolean // 任意
  "canCreateDatabase"?: boolean // 任意
  "canCreateTool"?: boolean // 任意
  "canCreateAgentUiTool"?: boolean // 任意
  "canCreateSkill"?: boolean // 任意
  "maigptCanCodeInterpreter"?: boolean // Whether members of this role may use the code interpreter built-in tool in MaiGPT. (任意)
  "maigptCanRag"?: boolean // Whether members of this role may use the knowledge base RAG built-in tool in MaiGPT. (任意)
  "maigptCanDeepResearch"?: boolean // Whether members of this role may use Deep Research in MaiGPT. Deep Research reaches the public internet through its own built-in search, so a role that revokes the official web-search tools needs this switch too. (任意)
  "maigptCanBrowserTool"?: boolean // Whether members of this role may use the browser built-in tool in MaiGPT. (任意)
  "maigptAllLlms"?: boolean // Whether members of this role may use every organization-available LLM in MaiGPT. Off = only the bound LLMs; an empty binding then means none. (任意)
  "maigptAllTools"?: boolean // Whether members of this role may call every official (global) tool in MaiGPT. Off = only the bound tools; an empty binding then means none. (任意)
  "maigptAllConnectors"?: boolean // Whether members of this role may call every official (global) MCP connector in MaiGPT. Off = only the bound connectors; an empty binding then means none. (任意)
  "maigptAllSkills"?: boolean // Whether members of this role may use every official (global) skill in MaiGPT. Off = only the bound skills; an empty binding then means none. (任意)
  "usageStatisticsScope"?:  // What this role's usage statistics permission shows: the whole organization, or only the AI assistants granted to the member's roles. A member with any organization-wide granting role sees the whole organization.

* `organization` - Organization-wide
* `accessible_chatbots` - Authorized AI assistants only (任意)
  {
  }
  "createdAt": string (timestamp)
}
```

**レスポンス値の例**

```json
{
  "id": "550e8400-e29b-41d4-a716-446655440000",
  "name": "レスポンス文字列",
  "type": {},
  "permissions": [
    {
      "id": "550e8400-e29b-41d4-a716-446655440000",
      "name": "レスポンス例の名前",
      "description": "レスポンス例の説明"
    }
  ],
  "membersPreview": [
    "レスポンス文字列"
  ],
  "membersCount": 456,
  "chatbotsCount": 456,
  "chatbotsPreview": [
    "レスポンス文字列"
  ],
  "knowledgeBasesCount": 456,
  "knowledgeBasesPreview": [
    "レスポンス文字列"
  ],
  "inboxesCount": 456,
  "inboxesPreview": [
    "レスポンス文字列"
  ],
  "databasesCount": 456,
  "databasesPreview": [
    "レスポンス文字列"
  ],
  "canCreateChatbot": false,
  "canCreateKnowledgeBase": false,
  "canCreateInbox": false,
  "canCreateDatabase": false,
  "canCreateTool": false,
  "canCreateAgentUiTool": false,
  "canCreateSkill": false,
  "maigptCanCodeInterpreter": false,
  "maigptCanRag": false,
  "maigptCanDeepResearch": false,
  "maigptCanBrowserTool": false,
  "maigptAllLlms": false,
  "maigptAllTools": false,
  "maigptAllConnectors": false,
  "maigptAllSkills": false,
  "usageStatisticsScope": {},
  "createdAt": "レスポンス文字列"
}
```

***

### ロールの削除 <a href="#organizations-groups-destroy" id="organizations-groups-destroy"></a>

DELETE `/api/v1/organizations/{organizationPk}/groups/{id}/`

#### パラメーター

| パラメーター名          | 必須 | 型      | 説明                                    |
| ---------------- | -- | ------ | ------------------------------------- |
| `id`             | ✅  | string | A UUID string identifying this Group. |
| `organizationPk` | ✅  | string | A UUID string identifying this 組織 ID  |

#### コード例

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

```bash
# API 呼び出し例 (Shell)
curl -X DELETE "https://api.maiagent.ai/api/v1/organizations/550e8400-e29b-41d4-a716-446655440000/groups/550e8400-e29b-41d4-a716-446655440000/" \
  -H "Authorization: Api-Key YOUR_API_KEY"

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

{% endtab %}

{% tab title="JavaScript" %}

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

// リクエストヘッダーを設定
const config = {
  headers: {
    'Authorization': 'Api-Key YOUR_API_KEY'
  }
};

// リクエストペイロード
const data = null;

axios.delete("https://api.maiagent.ai/api/v1/organizations/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/organizations/550e8400-e29b-41d4-a716-446655440000/groups/550e8400-e29b-41d4-a716-446655440000/"
headers = {
    "Authorization": "Api-Key YOUR_API_KEY"
}


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/organizations/550e8400-e29b-41d4-a716-446655440000/groups/550e8400-e29b-41d4-a716-446655440000/", [
        'headers' => [
            'Authorization' => 'Api-Key YOUR_API_KEY'
        ]
    ]);
    
    $data = json_decode($response->getBody(), true);
    echo "レスポンスを正常に取得しました:\n";
    print_r($data);
} catch (Exception $e) {
    echo 'リクエストでエラーが発生しました: ' . $e->getMessage();
}
?>
```

{% endtab %}
{% endtabs %}

#### レスポンス

| ステータスコード | 説明               |
| -------- | ---------------- |
| 204      | No response body |

***

### ロールからメンバーを削除 <a href="#organizations-groups-group-members-destroy" id="organizations-groups-group-members-destroy"></a>

DELETE `/api/v1/organizations/{organizationPk}/groups/{groupPk}/group-members/{id}/`

#### パラメーター

| パラメーター名          | 必須 | 型      | 説明                                           |
| ---------------- | -- | ------ | -------------------------------------------- |
| `groupPk`        | ✅  | string |                                              |
| `id`             | ✅  | string | A UUID string identifying this Group Member. |
| `organizationPk` | ✅  | string | A UUID string identifying this 組織 ID         |

#### コード例

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

```bash
# API 呼び出し例 (Shell)
curl -X DELETE "https://api.maiagent.ai/api/v1/organizations/550e8400-e29b-41d4-a716-446655440000/groups/550e8400-e29b-41d4-a716-446655440000/group-members/550e8400-e29b-41d4-a716-446655440000/" \
  -H "Authorization: Api-Key YOUR_API_KEY"

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

{% endtab %}

{% tab title="JavaScript" %}

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

// リクエストヘッダーを設定
const config = {
  headers: {
    'Authorization': 'Api-Key YOUR_API_KEY'
  }
};

// リクエストペイロード
const data = null;

axios.delete("https://api.maiagent.ai/api/v1/organizations/550e8400-e29b-41d4-a716-446655440000/groups/550e8400-e29b-41d4-a716-446655440000/group-members/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/organizations/550e8400-e29b-41d4-a716-446655440000/groups/550e8400-e29b-41d4-a716-446655440000/group-members/550e8400-e29b-41d4-a716-446655440000/"
headers = {
    "Authorization": "Api-Key YOUR_API_KEY"
}


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/organizations/550e8400-e29b-41d4-a716-446655440000/groups/550e8400-e29b-41d4-a716-446655440000/group-members/550e8400-e29b-41d4-a716-446655440000/", [
        'headers' => [
            'Authorization' => 'Api-Key YOUR_API_KEY'
        ]
    ]);
    
    $data = json_decode($response->getBody(), true);
    echo "レスポンスを正常に取得しました:\n";
    print_r($data);
} catch (Exception $e) {
    echo 'リクエストでエラーが発生しました: ' . $e->getMessage();
}
?>
```

{% endtab %}
{% endtabs %}

#### レスポンス

| ステータスコード | 説明               |
| -------- | ---------------- |
| 204      | No response body |

***

### ロールから AI アシスタントを削除 <a href="#organizations-groups-group-chatbots-destroy" id="organizations-groups-group-chatbots-destroy"></a>

DELETE `/api/v1/organizations/{organizationPk}/groups/{groupPk}/group-chatbots/{id}/`

#### パラメーター

| パラメーター名          | 必須 | 型      | 説明                                            |
| ---------------- | -- | ------ | --------------------------------------------- |
| `groupPk`        | ✅  | string |                                               |
| `id`             | ✅  | string | A UUID string identifying this Group Chatbot. |
| `organizationPk` | ✅  | string | A UUID string identifying this 組織 ID          |

#### コード例

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

```bash
# API 呼び出し例 (Shell)
curl -X DELETE "https://api.maiagent.ai/api/v1/organizations/550e8400-e29b-41d4-a716-446655440000/groups/550e8400-e29b-41d4-a716-446655440000/group-chatbots/550e8400-e29b-41d4-a716-446655440000/" \
  -H "Authorization: Api-Key YOUR_API_KEY"

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

{% endtab %}

{% tab title="JavaScript" %}

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

// リクエストヘッダーを設定
const config = {
  headers: {
    'Authorization': 'Api-Key YOUR_API_KEY'
  }
};

// リクエストペイロード
const data = null;

axios.delete("https://api.maiagent.ai/api/v1/organizations/550e8400-e29b-41d4-a716-446655440000/groups/550e8400-e29b-41d4-a716-446655440000/group-chatbots/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/organizations/550e8400-e29b-41d4-a716-446655440000/groups/550e8400-e29b-41d4-a716-446655440000/group-chatbots/550e8400-e29b-41d4-a716-446655440000/"
headers = {
    "Authorization": "Api-Key YOUR_API_KEY"
}


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/organizations/550e8400-e29b-41d4-a716-446655440000/groups/550e8400-e29b-41d4-a716-446655440000/group-chatbots/550e8400-e29b-41d4-a716-446655440000/", [
        'headers' => [
            'Authorization' => 'Api-Key YOUR_API_KEY'
        ]
    ]);
    
    $data = json_decode($response->getBody(), true);
    echo "レスポンスを正常に取得しました:\n";
    print_r($data);
} catch (Exception $e) {
    echo 'リクエストでエラーが発生しました: ' . $e->getMessage();
}
?>
```

{% endtab %}
{% endtabs %}

#### レスポンス

| ステータスコード | 説明               |
| -------- | ---------------- |
| 204      | No response body |

***

### ロールから受信トレイを削除 <a href="#organizations-groups-group-inboxes-destroy" id="organizations-groups-group-inboxes-destroy"></a>

DELETE `/api/v1/organizations/{organizationPk}/groups/{groupPk}/group-inboxes/{id}/`

#### パラメーター

| パラメーター名          | 必須 | 型      | 説明                                          |
| ---------------- | -- | ------ | ------------------------------------------- |
| `groupPk`        | ✅  | string |                                             |
| `id`             | ✅  | string | A UUID string identifying this Group Inbox. |
| `organizationPk` | ✅  | string | A UUID string identifying this 組織 ID        |

#### コード例

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

```bash
# API 呼び出し例 (Shell)
curl -X DELETE "https://api.maiagent.ai/api/v1/organizations/550e8400-e29b-41d4-a716-446655440000/groups/550e8400-e29b-41d4-a716-446655440000/group-inboxes/550e8400-e29b-41d4-a716-446655440000/" \
  -H "Authorization: Api-Key YOUR_API_KEY"

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

{% endtab %}

{% tab title="JavaScript" %}

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

// リクエストヘッダーを設定
const config = {
  headers: {
    'Authorization': 'Api-Key YOUR_API_KEY'
  }
};

// リクエストペイロード
const data = null;

axios.delete("https://api.maiagent.ai/api/v1/organizations/550e8400-e29b-41d4-a716-446655440000/groups/550e8400-e29b-41d4-a716-446655440000/group-inboxes/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/organizations/550e8400-e29b-41d4-a716-446655440000/groups/550e8400-e29b-41d4-a716-446655440000/group-inboxes/550e8400-e29b-41d4-a716-446655440000/"
headers = {
    "Authorization": "Api-Key YOUR_API_KEY"
}


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/organizations/550e8400-e29b-41d4-a716-446655440000/groups/550e8400-e29b-41d4-a716-446655440000/group-inboxes/550e8400-e29b-41d4-a716-446655440000/", [
        'headers' => [
            'Authorization' => 'Api-Key YOUR_API_KEY'
        ]
    ]);
    
    $data = json_decode($response->getBody(), true);
    echo "レスポンスを正常に取得しました:\n";
    print_r($data);
} catch (Exception $e) {
    echo 'リクエストでエラーが発生しました: ' . $e->getMessage();
}
?>
```

{% endtab %}
{% endtabs %}

#### レスポンス

| ステータスコード | 説明               |
| -------- | ---------------- |
| 204      | No response body |

***

### ロールからナレッジベースを削除 <a href="#organizations-groups-group-knowledge-bases-destroy" id="organizations-groups-group-knowledge-bases-destroy"></a>

DELETE `/api/v1/organizations/{organizationPk}/groups/{groupPk}/group-knowledge-bases/{id}/`

#### パラメータ

| パラメータ名           | 必須 | 型      | 説明                                                  |
| ---------------- | -- | ------ | --------------------------------------------------- |
| `groupPk`        | ✅  | string |                                                     |
| `id`             | ✅  | string | A UUID string identifying this Group KnowledgeBase. |
| `organizationPk` | ✅  | string | A UUID string identifying this 組織 ID                |

#### コード例

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

```bash
# API 呼び出し例 (Shell)
curl -X DELETE "https://api.maiagent.ai/api/v1/organizations/550e8400-e29b-41d4-a716-446655440000/groups/550e8400-e29b-41d4-a716-446655440000/group-knowledge-bases/550e8400-e29b-41d4-a716-446655440000/" \
  -H "Authorization: Api-Key YOUR_API_KEY"

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

{% endtab %}

{% tab title="JavaScript" %}

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

// リクエストヘッダーを設定
const config = {
  headers: {
    'Authorization': 'Api-Key YOUR_API_KEY'
  }
};

// リクエスト内容 (payload)
const data = null;

axios.delete("https://api.maiagent.ai/api/v1/organizations/550e8400-e29b-41d4-a716-446655440000/groups/550e8400-e29b-41d4-a716-446655440000/group-knowledge-bases/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/organizations/550e8400-e29b-41d4-a716-446655440000/groups/550e8400-e29b-41d4-a716-446655440000/group-knowledge-bases/550e8400-e29b-41d4-a716-446655440000/"
headers = {
    "Authorization": "Api-Key YOUR_API_KEY"
}


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/organizations/550e8400-e29b-41d4-a716-446655440000/groups/550e8400-e29b-41d4-a716-446655440000/group-knowledge-bases/550e8400-e29b-41d4-a716-446655440000/", [
        'headers' => [
            'Authorization' => 'Api-Key YOUR_API_KEY'
        ]
    ]);
    
    $data = json_decode($response->getBody(), true);
    echo "レスポンスを正常に取得しました:\n";
    print_r($data);
} catch (Exception $e) {
    echo 'リクエストでエラーが発生しました: ' . $e->getMessage();
}
?>
```

{% endtab %}
{% endtabs %}

#### レスポンス

| ステータスコード | 説明               |
| -------- | ---------------- |
| 204      | No response body |

***

### ロールからデータベースを削除 <a href="#organizations-groups-group-databases-destroy" id="organizations-groups-group-databases-destroy"></a>

DELETE `/api/v1/organizations/{organizationPk}/groups/{groupPk}/group-databases/{id}/`

#### パラメータ

| パラメータ名           | 必須 | 型      | 説明                                             |
| ---------------- | -- | ------ | ---------------------------------------------- |
| `groupPk`        | ✅  | string |                                                |
| `id`             | ✅  | string | A UUID string identifying this Group Database. |
| `organizationPk` | ✅  | string | A UUID string identifying this 組織 ID           |

#### コード例

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

```bash
# API 呼び出し例 (Shell)
curl -X DELETE "https://api.maiagent.ai/api/v1/organizations/550e8400-e29b-41d4-a716-446655440000/groups/550e8400-e29b-41d4-a716-446655440000/group-databases/550e8400-e29b-41d4-a716-446655440000/" \
  -H "Authorization: Api-Key YOUR_API_KEY"

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

{% endtab %}

{% tab title="JavaScript" %}

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

// リクエストヘッダーを設定
const config = {
  headers: {
    'Authorization': 'Api-Key YOUR_API_KEY'
  }
};

// リクエスト内容 (payload)
const data = null;

axios.delete("https://api.maiagent.ai/api/v1/organizations/550e8400-e29b-41d4-a716-446655440000/groups/550e8400-e29b-41d4-a716-446655440000/group-databases/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/organizations/550e8400-e29b-41d4-a716-446655440000/groups/550e8400-e29b-41d4-a716-446655440000/group-databases/550e8400-e29b-41d4-a716-446655440000/"
headers = {
    "Authorization": "Api-Key YOUR_API_KEY"
}


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/organizations/550e8400-e29b-41d4-a716-446655440000/groups/550e8400-e29b-41d4-a716-446655440000/group-databases/550e8400-e29b-41d4-a716-446655440000/", [
        'headers' => [
            'Authorization' => 'Api-Key YOUR_API_KEY'
        ]
    ]);
    
    $data = json_decode($response->getBody(), true);
    echo "レスポンスを正常に取得しました:\n";
    print_r($data);
} catch (Exception $e) {
    echo 'リクエストでエラーが発生しました: ' . $e->getMessage();
}
?>
```

{% endtab %}
{% endtabs %}

#### レスポンス

| ステータスコード | 説明               |
| -------- | ---------------- |
| 204      | No response body |

***


---

# 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/jue-se-he-quan-xian.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.
