> 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/api-doc-ja/api-reference/dui-hua-widget.md).

# 会話 Widget

### Web Chat の作成 <a href="#web-chat" id="web-chat"></a>

POST `/api/v1/web-chats/`

#### リクエスト内容

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

| フィールド                                           | 型                                          | 必須  | 説明                                                    |
| ----------------------------------------------- | ------------------------------------------ | --- | ----------------------------------------------------- |
| avatar                                          | string (uri)                               | いいえ |                                                       |
| logo                                            | string (uri)                               | いいえ |                                                       |
| description                                     | string                                     | いいえ |                                                       |
| cover                                           | string (uri)                               | いいえ |                                                       |
| backUrl                                         | string                                     | いいえ |                                                       |
| isActive                                        | boolean                                    | いいえ |                                                       |
| theme                                           | object                                     | はい  |                                                       |
| theme.primaryColor                              | string                                     | いいえ |                                                       |
| theme.navbarTextColor                           | string                                     | いいえ |                                                       |
| theme.conversationBackgroundColor               | string                                     | いいえ |                                                       |
| theme.chatbotMessageTextColor                   | string                                     | いいえ |                                                       |
| theme.userMessageTextColor                      | string                                     | いいえ |                                                       |
| theme.chatbotMessageBackgroundColor             | string                                     | いいえ |                                                       |
| theme.userMessageBackgroundColor                | string                                     | いいえ |                                                       |
| theme.chatbotMessageBackgroundShadowEnabled     | boolean                                    | いいえ |                                                       |
| theme.userMessageBackgroundShadowEnabled        | boolean                                    | いいえ |                                                       |
| theme.chatbotMessageGradientEnabled             | boolean                                    | いいえ |                                                       |
| theme.userMessageGradientEnabled                | boolean                                    | いいえ |                                                       |
| darkTheme                                       | object                                     | はい  |                                                       |
| darkTheme.primaryColor                          | string                                     | いいえ |                                                       |
| darkTheme.navbarTextColor                       | string                                     | いいえ |                                                       |
| darkTheme.conversationBackgroundColor           | string                                     | いいえ |                                                       |
| darkTheme.chatbotMessageTextColor               | string                                     | いいえ |                                                       |
| darkTheme.userMessageTextColor                  | string                                     | いいえ |                                                       |
| darkTheme.chatbotMessageBackgroundColor         | string                                     | いいえ |                                                       |
| darkTheme.userMessageBackgroundColor            | string                                     | いいえ |                                                       |
| darkTheme.chatbotMessageBackgroundShadowEnabled | boolean                                    | いいえ |                                                       |
| darkTheme.userMessageBackgroundShadowEnabled    | boolean                                    | いいえ |                                                       |
| darkTheme.chatbotMessageGradientEnabled         | boolean                                    | いいえ |                                                       |
| darkTheme.userMessageGradientEnabled            | boolean                                    | いいえ |                                                       |
| enableFileUpload                                | boolean                                    | いいえ |                                                       |
| enableDisplayCitations                          | boolean                                    | いいえ |                                                       |
| toolDisplayMode                                 | string (enum: full, compact, hidden)       | いいえ | `full`: Full ; `compact`: Compact ; `hidden`: Hidden; |
| enableDisplayThinking                           | boolean                                    | いいえ |                                                       |
| enableUserThinkingControl                       | boolean                                    | いいえ |                                                       |
| enableDisplayQueryMetadata                      | boolean                                    | いいえ |                                                       |
| enableShareConversation                         | boolean                                    | いいえ |                                                       |
| enableLocation                                  | boolean                                    | いいえ |                                                       |
| enableShowPoweredBy                             | boolean                                    | いいえ |                                                       |
| poweredByLogo                                   | string (uri)                               | いいえ |                                                       |
| enableAnonymous                                 | boolean                                    | いいえ |                                                       |
| enableDisplayPreviousConversation               | boolean                                    | いいえ |                                                       |
| enableDisplayConversationHistory                | boolean                                    | いいえ |                                                       |
| enableConversationTimer                         | boolean                                    | いいえ |                                                       |
| conversationTimerDuration                       | integer                                    | いいえ | タイマーのタイムアウト時間。範囲は 3〜60 分です                            |
| enableAutoNewConversationOnTimeout              | boolean                                    | いいえ |                                                       |
| enableThemeModeToggle                           | boolean                                    | いいえ |                                                       |
| enableDisplayFontSizeSwitch                     | boolean                                    | いいえ |                                                       |
| defaultThemeMode                                | object                                     | いいえ |                                                       |
| enableDownloadCitations                         | boolean                                    | いいえ |                                                       |
| customDomain                                    | object (3 個のプロパティ: id, domain, status を含む) | いいえ |                                                       |
| customDomain.domain                             | string                                     | はい  |                                                       |
| enableDisplayChatbotAvatar                      | boolean                                    | いいえ |                                                       |
| enableDisplayChatbotName                        | boolean                                    | いいえ |                                                       |
| enableVoiceAgent                                | boolean                                    | いいえ | WebChat で音声エージェント機能の利用を許可するかどうか                       |
| buttonIcon                                      | string (uri)                               | いいえ |                                                       |

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

```typescript
{
  "avatar"?: string (uri) // 任意
  "logo"?: string (uri) // 任意
  "description"?: string // 任意
  "cover"?: string (uri) // 任意
  "backUrl"?: string // 任意
  "isActive"?: boolean // 任意
  "theme": {
  {
    "primaryColor"?: string // 任意
    "navbarTextColor"?: string // 任意
    "conversationBackgroundColor"?: string // 任意
    "chatbotMessageTextColor"?: string // 任意
    "userMessageTextColor"?: string // 任意
    "chatbotMessageBackgroundColor"?: string // 任意
    "userMessageBackgroundColor"?: string // 任意
    "chatbotMessageBackgroundShadowEnabled"?: boolean // 任意
    "userMessageBackgroundShadowEnabled"?: boolean // 任意
    "chatbotMessageGradientEnabled"?: boolean // 任意
    "userMessageGradientEnabled"?: boolean // 任意
  }
  }
  "darkTheme": {
  {
    "primaryColor"?: string // 任意
    "navbarTextColor"?: string // 任意
    "conversationBackgroundColor"?: string // 任意
    "chatbotMessageTextColor"?: string // 任意
    "userMessageTextColor"?: string // 任意
    "chatbotMessageBackgroundColor"?: string // 任意
    "userMessageBackgroundColor"?: string // 任意
    "chatbotMessageBackgroundShadowEnabled"?: boolean // 任意
    "userMessageBackgroundShadowEnabled"?: boolean // 任意
    "chatbotMessageGradientEnabled"?: boolean // 任意
    "userMessageGradientEnabled"?: boolean // 任意
  }
  }
  "enableFileUpload"?: boolean // 任意
  "enableDisplayCitations"?: boolean // 任意
  "toolDisplayMode"?: string (enum: full, compact, hidden) // * `full` - Full
* `compact` - Compact
* `hidden` - Hidden (任意)
  "enableDisplayThinking"?: boolean // 任意
  "enableUserThinkingControl"?: boolean // 任意
  "enableDisplayQueryMetadata"?: boolean // 任意
  "enableShareConversation"?: boolean // 任意
  "enableLocation"?: boolean // 任意
  "enableShowPoweredBy"?: boolean // 任意
  "poweredByLogo"?: string (uri) // 任意
  "enableAnonymous"?: boolean // 任意
  "enableDisplayPreviousConversation"?: boolean // 任意
  "enableDisplayConversationHistory"?: boolean // 任意
  "enableConversationTimer"?: boolean // 任意
  "conversationTimerDuration"?: integer // タイマーのタイムアウト時間。範囲は 3〜60 分です (任意)
  "enableAutoNewConversationOnTimeout"?: boolean // 任意
  "enableThemeModeToggle"?: boolean // 任意
  "enableDisplayFontSizeSwitch"?: boolean // 任意
  "defaultThemeMode"?:  // 任意
  {
  }
  "enableDownloadCitations"?: boolean // 任意
  "customDomain"?:  // 任意
  {
    "domain": string
  }
  "enableDisplayChatbotAvatar"?: boolean // 任意
  "enableDisplayChatbotName"?: boolean // 任意
  "enableVoiceAgent"?: boolean // WebChat で音声エージェント機能の利用を許可するかどうか (任意)
  "buttonIcon"?: string (uri) // 任意
}
```

**リクエストの例**

```json
{
  "avatar": "https://example.com/file.jpg",
  "logo": "https://example.com/file.jpg",
  "description": "サンプル文字列",
  "cover": "https://example.com/file.jpg",
  "backUrl": "サンプル文字列",
  "isActive": true,
  "theme": {
    "primaryColor": "サンプル文字列",
    "navbarTextColor": "サンプル文字列",
    "conversationBackgroundColor": "サンプル文字列",
    "chatbotMessageTextColor": "サンプル文字列",
    "userMessageTextColor": "サンプル文字列",
    "chatbotMessageBackgroundColor": "サンプル文字列",
    "userMessageBackgroundColor": "サンプル文字列",
    "chatbotMessageBackgroundShadowEnabled": true,
    "userMessageBackgroundShadowEnabled": true,
    "chatbotMessageGradientEnabled": true,
    "userMessageGradientEnabled": true
  },
  "darkTheme": {
    "primaryColor": "サンプル文字列",
    "navbarTextColor": "サンプル文字列",
    "conversationBackgroundColor": "サンプル文字列",
    "chatbotMessageTextColor": "サンプル文字列",
    "userMessageTextColor": "サンプル文字列",
    "chatbotMessageBackgroundColor": "サンプル文字列",
    "userMessageBackgroundColor": "サンプル文字列",
    "chatbotMessageBackgroundShadowEnabled": true,
    "userMessageBackgroundShadowEnabled": true,
    "chatbotMessageGradientEnabled": true,
    "userMessageGradientEnabled": true
  },
  "enableFileUpload": true,
  "enableDisplayCitations": true,
  "toolDisplayMode": "full",
  "enableDisplayThinking": true,
  "enableUserThinkingControl": true,
  "enableDisplayQueryMetadata": true,
  "enableShareConversation": true,
  "enableLocation": true,
  "enableShowPoweredBy": true,
  "poweredByLogo": "https://example.com/file.jpg",
  "enableAnonymous": true,
  "enableDisplayPreviousConversation": true,
  "enableDisplayConversationHistory": true,
  "enableConversationTimer": true,
  "conversationTimerDuration": 123,
  "enableAutoNewConversationOnTimeout": true,
  "enableThemeModeToggle": true,
  "enableDisplayFontSizeSwitch": true,
  "defaultThemeMode": {},
  "enableDownloadCitations": true,
  "customDomain": {
    "domain": "サンプル文字列"
  },
  "enableDisplayChatbotAvatar": true,
  "enableDisplayChatbotName": true,
  "enableVoiceAgent": true,
  "buttonIcon": "https://example.com/file.jpg"
}
```

#### コード例

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

```bash
# API 呼び出しの例 (Shell)
curl -X POST "https://api.maiagent.ai/api/v1/web-chats/" \
  -H "Authorization: Api-Key YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "avatar": "https://example.com/file.jpg",
    "logo": "https://example.com/file.jpg",
    "description": "サンプル文字列",
    "cover": "https://example.com/file.jpg",
    "backUrl": "サンプル文字列",
    "isActive": true,
    "theme": {
      "primaryColor": "サンプル文字列",
      "navbarTextColor": "サンプル文字列",
      "conversationBackgroundColor": "サンプル文字列",
      "chatbotMessageTextColor": "サンプル文字列",
      "userMessageTextColor": "サンプル文字列",
      "chatbotMessageBackgroundColor": "サンプル文字列",
      "userMessageBackgroundColor": "サンプル文字列",
      "chatbotMessageBackgroundShadowEnabled": true,
      "userMessageBackgroundShadowEnabled": true,
      "chatbotMessageGradientEnabled": true,
      "userMessageGradientEnabled": true
    },
    "darkTheme": {
      "primaryColor": "サンプル文字列",
      "navbarTextColor": "サンプル文字列",
      "conversationBackgroundColor": "サンプル文字列",
      "chatbotMessageTextColor": "サンプル文字列",
      "userMessageTextColor": "サンプル文字列",
      "chatbotMessageBackgroundColor": "サンプル文字列",
      "userMessageBackgroundColor": "サンプル文字列",
      "chatbotMessageBackgroundShadowEnabled": true,
      "userMessageBackgroundShadowEnabled": true,
      "chatbotMessageGradientEnabled": true,
      "userMessageGradientEnabled": true
    },
    "enableFileUpload": true,
    "enableDisplayCitations": true,
    "toolDisplayMode": "full",
    "enableDisplayThinking": true,
    "enableUserThinkingControl": true,
    "enableDisplayQueryMetadata": true,
    "enableShareConversation": true,
    "enableLocation": true,
    "enableShowPoweredBy": true,
    "poweredByLogo": "https://example.com/file.jpg",
    "enableAnonymous": true,
    "enableDisplayPreviousConversation": true,
    "enableDisplayConversationHistory": true,
    "enableConversationTimer": true,
    "conversationTimerDuration": 123,
    "enableAutoNewConversationOnTimeout": true,
    "enableThemeModeToggle": true,
    "enableDisplayFontSizeSwitch": true,
    "defaultThemeMode": {},
    "enableDownloadCitations": true,
    "customDomain": {
      "domain": "サンプル文字列"
    },
    "enableDisplayChatbotAvatar": true,
    "enableDisplayChatbotName": true,
    "enableVoiceAgent": true,
    "buttonIcon": "https://example.com/file.jpg"
  }'

# 実行前に 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 = {
    "avatar": "https://example.com/file.jpg",
    "logo": "https://example.com/file.jpg",
    "description": "サンプル文字列",
    "cover": "https://example.com/file.jpg",
    "backUrl": "サンプル文字列",
    "isActive": true,
    "theme": {
      "primaryColor": "サンプル文字列",
      "navbarTextColor": "サンプル文字列",
      "conversationBackgroundColor": "サンプル文字列",
      "chatbotMessageTextColor": "サンプル文字列",
      "userMessageTextColor": "サンプル文字列",
      "chatbotMessageBackgroundColor": "サンプル文字列",
      "userMessageBackgroundColor": "サンプル文字列",
      "chatbotMessageBackgroundShadowEnabled": true,
      "userMessageBackgroundShadowEnabled": true,
      "chatbotMessageGradientEnabled": true,
      "userMessageGradientEnabled": true
    },
    "darkTheme": {
      "primaryColor": "サンプル文字列",
      "navbarTextColor": "サンプル文字列",
      "conversationBackgroundColor": "サンプル文字列",
      "chatbotMessageTextColor": "サンプル文字列",
      "userMessageTextColor": "サンプル文字列",
      "chatbotMessageBackgroundColor": "サンプル文字列",
      "userMessageBackgroundColor": "サンプル文字列",
      "chatbotMessageBackgroundShadowEnabled": true,
      "userMessageBackgroundShadowEnabled": true,
      "chatbotMessageGradientEnabled": true,
      "userMessageGradientEnabled": true
    },
    "enableFileUpload": true,
    "enableDisplayCitations": true,
    "toolDisplayMode": "full",
    "enableDisplayThinking": true,
    "enableUserThinkingControl": true,
    "enableDisplayQueryMetadata": true,
    "enableShareConversation": true,
    "enableLocation": true,
    "enableShowPoweredBy": true,
    "poweredByLogo": "https://example.com/file.jpg",
    "enableAnonymous": true,
    "enableDisplayPreviousConversation": true,
    "enableDisplayConversationHistory": true,
    "enableConversationTimer": true,
    "conversationTimerDuration": 123,
    "enableAutoNewConversationOnTimeout": true,
    "enableThemeModeToggle": true,
    "enableDisplayFontSizeSwitch": true,
    "defaultThemeMode": {},
    "enableDownloadCitations": true,
    "customDomain": {
      "domain": "サンプル文字列"
    },
    "enableDisplayChatbotAvatar": true,
    "enableDisplayChatbotName": true,
    "enableVoiceAgent": true,
    "buttonIcon": "https://example.com/file.jpg"
  };

axios.post("https://api.maiagent.ai/api/v1/web-chats/", 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/web-chats/"
headers = {
    "Authorization": "Api-Key YOUR_API_KEY",
    "Content-Type": "application/json"
}

# リクエスト内容 (payload)
data = {
      "avatar": "https://example.com/file.jpg",
      "logo": "https://example.com/file.jpg",
      "description": "サンプル文字列",
      "cover": "https://example.com/file.jpg",
      "backUrl": "サンプル文字列",
      "isActive": true,
      "theme": {
        "primaryColor": "サンプル文字列",
        "navbarTextColor": "サンプル文字列",
        "conversationBackgroundColor": "サンプル文字列",
        "chatbotMessageTextColor": "サンプル文字列",
        "userMessageTextColor": "サンプル文字列",
        "chatbotMessageBackgroundColor": "サンプル文字列",
        "userMessageBackgroundColor": "サンプル文字列",
        "chatbotMessageBackgroundShadowEnabled": true,
        "userMessageBackgroundShadowEnabled": true,
        "chatbotMessageGradientEnabled": true,
        "userMessageGradientEnabled": true
      },
      "darkTheme": {
        "primaryColor": "サンプル文字列",
        "navbarTextColor": "サンプル文字列",
        "conversationBackgroundColor": "サンプル文字列",
        "chatbotMessageTextColor": "サンプル文字列",
        "userMessageTextColor": "サンプル文字列",
        "chatbotMessageBackgroundColor": "サンプル文字列",
        "userMessageBackgroundColor": "サンプル文字列",
        "chatbotMessageBackgroundShadowEnabled": true,
        "userMessageBackgroundShadowEnabled": true,
        "chatbotMessageGradientEnabled": true,
        "userMessageGradientEnabled": true
      },
      "enableFileUpload": true,
      "enableDisplayCitations": true,
      "toolDisplayMode": "full",
      "enableDisplayThinking": true,
      "enableUserThinkingControl": true,
      "enableDisplayQueryMetadata": true,
      "enableShareConversation": true,
      "enableLocation": true,
      "enableShowPoweredBy": true,
      "poweredByLogo": "https://example.com/file.jpg",
      "enableAnonymous": true,
      "enableDisplayPreviousConversation": true,
      "enableDisplayConversationHistory": true,
      "enableConversationTimer": true,
      "conversationTimerDuration": 123,
      "enableAutoNewConversationOnTimeout": true,
      "enableThemeModeToggle": true,
      "enableDisplayFontSizeSwitch": true,
      "defaultThemeMode": {},
      "enableDownloadCitations": true,
      "customDomain": {
        "domain": "サンプル文字列"
      },
      "enableDisplayChatbotAvatar": true,
      "enableDisplayChatbotName": true,
      "enableVoiceAgent": true,
      "buttonIcon": "https://example.com/file.jpg"
    }

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/web-chats/", [
        'headers' => [
            'Authorization' => 'Api-Key YOUR_API_KEY',
            'Content-Type' => 'application/json'
        ],
        'json' => {
            "avatar": "https://example.com/file.jpg",
            "logo": "https://example.com/file.jpg",
            "description": "サンプル文字列",
            "cover": "https://example.com/file.jpg",
            "backUrl": "サンプル文字列",
            "isActive": true,
            "theme": {
                "primaryColor": "サンプル文字列",
                "navbarTextColor": "サンプル文字列",
                "conversationBackgroundColor": "サンプル文字列",
                "chatbotMessageTextColor": "サンプル文字列",
                "userMessageTextColor": "サンプル文字列",
                "chatbotMessageBackgroundColor": "サンプル文字列",
                "userMessageBackgroundColor": "サンプル文字列",
                "chatbotMessageBackgroundShadowEnabled": true,
                "userMessageBackgroundShadowEnabled": true,
                "chatbotMessageGradientEnabled": true,
                "userMessageGradientEnabled": true
            },
            "darkTheme": {
                "primaryColor": "サンプル文字列",
                "navbarTextColor": "サンプル文字列",
                "conversationBackgroundColor": "サンプル文字列",
                "chatbotMessageTextColor": "サンプル文字列",
                "userMessageTextColor": "サンプル文字列",
                "chatbotMessageBackgroundColor": "サンプル文字列",
                "userMessageBackgroundColor": "サンプル文字列",
                "chatbotMessageBackgroundShadowEnabled": true,
                "userMessageBackgroundShadowEnabled": true,
                "chatbotMessageGradientEnabled": true,
                "userMessageGradientEnabled": true
            },
            "enableFileUpload": true,
            "enableDisplayCitations": true,
            "toolDisplayMode": "full",
            "enableDisplayThinking": true,
            "enableUserThinkingControl": true,
            "enableDisplayQueryMetadata": true,
            "enableShareConversation": true,
            "enableLocation": true,
            "enableShowPoweredBy": true,
            "poweredByLogo": "https://example.com/file.jpg",
            "enableAnonymous": true,
            "enableDisplayPreviousConversation": true,
            "enableDisplayConversationHistory": true,
            "enableConversationTimer": true,
            "conversationTimerDuration": 123,
            "enableAutoNewConversationOnTimeout": true,
            "enableThemeModeToggle": true,
            "enableDisplayFontSizeSwitch": true,
            "defaultThemeMode": {},
            "enableDownloadCitations": true,
            "customDomain": {
                "domain": "サンプル文字列"
            },
            "enableDisplayChatbotAvatar": true,
            "enableDisplayChatbotName": true,
            "enableVoiceAgent": true,
            "buttonIcon": "https://example.com/file.jpg"
        }
    ]);
    
    $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
  "avatar"?: string (uri) // 任意
  "logo"?: string (uri) // 任意
  "description"?: string // 任意
  "cover"?: string (uri) // 任意
  "backUrl"?: string // 任意
  "isActive"?: boolean // 任意
  "enableSpeech": boolean
  "displayConversationStarters": [
    string
  ]
  "theme": {
  {
    "primaryColor"?: string // 任意
    "navbarTextColor"?: string // 任意
    "conversationBackgroundColor"?: string // 任意
    "chatbotMessageTextColor"?: string // 任意
    "userMessageTextColor"?: string // 任意
    "chatbotMessageBackgroundColor"?: string // 任意
    "userMessageBackgroundColor"?: string // 任意
    "chatbotMessageBackgroundShadowEnabled"?: boolean // 任意
    "userMessageBackgroundShadowEnabled"?: boolean // 任意
    "chatbotMessageGradientEnabled"?: boolean // 任意
    "userMessageGradientEnabled"?: boolean // 任意
  }
  }
  "darkTheme": {
  {
    "primaryColor"?: string // 任意
    "navbarTextColor"?: string // 任意
    "conversationBackgroundColor"?: string // 任意
    "chatbotMessageTextColor"?: string // 任意
    "userMessageTextColor"?: string // 任意
    "chatbotMessageBackgroundColor"?: string // 任意
    "userMessageBackgroundColor"?: string // 任意
    "chatbotMessageBackgroundShadowEnabled"?: boolean // 任意
    "userMessageBackgroundShadowEnabled"?: boolean // 任意
    "chatbotMessageGradientEnabled"?: boolean // 任意
    "userMessageGradientEnabled"?: boolean // 任意
  }
  }
  "enableFileUpload"?: boolean // 任意
  "enableDisplayCitations"?: boolean // 任意
  "toolDisplayMode"?: string (enum: full, compact, hidden) // * `full` - Full
* `compact` - Compact
* `hidden` - Hidden (任意)
  "enableDisplayThinking"?: boolean // 任意
  "enableUserThinkingControl"?: boolean // 任意
  "enableDisplayQueryMetadata"?: boolean // 任意
  "enableShareConversation"?: boolean // 任意
  "enableLocation"?: boolean // 任意
  "enableShowPoweredBy"?: boolean // 任意
  "poweredByLogo"?: string (uri) // 任意
  "enableAnonymous"?: boolean // 任意
  "enableDisplayPreviousConversation"?: boolean // 任意
  "enableDisplayConversationHistory"?: boolean // 任意
  "enableConversationTimer"?: boolean // 任意
  "conversationTimerDuration"?: integer // タイマーのタイムアウト時間。範囲は 3〜60 分です (任意)
  "enableAutoNewConversationOnTimeout"?: boolean // 任意
  "accessType": 
  {
  }
  "enableThemeModeToggle"?: boolean // 任意
  "enableDisplayFontSizeSwitch"?: boolean // 任意
  "defaultThemeMode"?:  // 任意
  {
  }
  "enableDownloadCitations"?: boolean // 任意
  "customDomain"?:  // 任意
  {
    "id": string (uuid)
    "domain": string
    "status": 
    {
    }
  }
  "enableDisplayChatbotAvatar"?: boolean // 任意
  "enableDisplayChatbotName"?: boolean // 任意
  "enableVoiceAgent"?: boolean // WebChat で音声エージェント機能の利用を許可するかどうか (任意)
  "buttonIcon"?: string (uri) // 任意
  "inbox": object
}
```

**レスポンスの例**

```json
{
  "id": "550e8400-e29b-41d4-a716-446655440000",
  "name": "レスポンス文字列",
  "avatar": "https://example.com/file.jpg",
  "logo": "https://example.com/file.jpg",
  "description": "レスポンス文字列",
  "cover": "https://example.com/file.jpg",
  "backUrl": "レスポンス文字列",
  "isActive": false,
  "enableSpeech": false,
  "displayConversationStarters": [
    "レスポンス文字列"
  ],
  "theme": {
    "primaryColor": "レスポンス文字列",
    "navbarTextColor": "レスポンス文字列",
    "conversationBackgroundColor": "レスポンス文字列",
    "chatbotMessageTextColor": "レスポンス文字列",
    "userMessageTextColor": "レスポンス文字列",
    "chatbotMessageBackgroundColor": "レスポンス文字列",
    "userMessageBackgroundColor": "レスポンス文字列",
    "chatbotMessageBackgroundShadowEnabled": false,
    "userMessageBackgroundShadowEnabled": false,
    "chatbotMessageGradientEnabled": false,
    "userMessageGradientEnabled": false
  },
  "darkTheme": {
    "primaryColor": "レスポンス文字列",
    "navbarTextColor": "レスポンス文字列",
    "conversationBackgroundColor": "レスポンス文字列",
    "chatbotMessageTextColor": "レスポンス文字列",
    "userMessageTextColor": "レスポンス文字列",
    "chatbotMessageBackgroundColor": "レスポンス文字列",
    "userMessageBackgroundColor": "レスポンス文字列",
    "chatbotMessageBackgroundShadowEnabled": false,
    "userMessageBackgroundShadowEnabled": false,
    "chatbotMessageGradientEnabled": false,
    "userMessageGradientEnabled": false
  },
  "enableFileUpload": false,
  "enableDisplayCitations": false,
  "toolDisplayMode": "full",
  "enableDisplayThinking": false,
  "enableUserThinkingControl": false,
  "enableDisplayQueryMetadata": false,
  "enableShareConversation": false,
  "enableLocation": false,
  "enableShowPoweredBy": false,
  "poweredByLogo": "https://example.com/file.jpg",
  "enableAnonymous": false,
  "enableDisplayPreviousConversation": false,
  "enableDisplayConversationHistory": false,
  "enableConversationTimer": false,
  "conversationTimerDuration": 456,
  "enableAutoNewConversationOnTimeout": false,
  "accessType": {},
  "enableThemeModeToggle": false,
  "enableDisplayFontSizeSwitch": false,
  "defaultThemeMode": {},
  "enableDownloadCitations": false,
  "customDomain": {
    "id": "550e8400-e29b-41d4-a716-446655440000",
    "domain": "レスポンス文字列",
    "status": {}
  },
  "enableDisplayChatbotAvatar": false,
  "enableDisplayChatbotName": false,
  "enableVoiceAgent": false,
  "buttonIcon": "https://example.com/file.jpg",
  "inbox": {
    "id": "550e8400-e29b-41d4-a716-446655440000",
    "name": "レスポンス例の名前",
    "description": "レスポンス例の説明"
  }
}
```

***

### Web Chat の作成 <a href="#web-chat" id="web-chat"></a>

POST `/api/web-chats/`

#### リクエスト内容

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

| フィールド                                           | 型                                          | 必須  | 説明                                                    |
| ----------------------------------------------- | ------------------------------------------ | --- | ----------------------------------------------------- |
| avatar                                          | string (uri)                               | いいえ |                                                       |
| logo                                            | string (uri)                               | いいえ |                                                       |
| description                                     | string                                     | いいえ |                                                       |
| cover                                           | string (uri)                               | いいえ |                                                       |
| backUrl                                         | string                                     | いいえ |                                                       |
| isActive                                        | boolean                                    | いいえ |                                                       |
| theme                                           | object                                     | はい  |                                                       |
| theme.primaryColor                              | string                                     | いいえ |                                                       |
| theme.navbarTextColor                           | string                                     | いいえ |                                                       |
| theme.conversationBackgroundColor               | string                                     | いいえ |                                                       |
| theme.chatbotMessageTextColor                   | string                                     | いいえ |                                                       |
| theme.userMessageTextColor                      | string                                     | いいえ |                                                       |
| theme.chatbotMessageBackgroundColor             | string                                     | いいえ |                                                       |
| theme.userMessageBackgroundColor                | string                                     | いいえ |                                                       |
| theme.chatbotMessageBackgroundShadowEnabled     | boolean                                    | いいえ |                                                       |
| theme.userMessageBackgroundShadowEnabled        | boolean                                    | いいえ |                                                       |
| theme.chatbotMessageGradientEnabled             | boolean                                    | いいえ |                                                       |
| theme.userMessageGradientEnabled                | boolean                                    | いいえ |                                                       |
| darkTheme                                       | object                                     | はい  |                                                       |
| darkTheme.primaryColor                          | string                                     | いいえ |                                                       |
| darkTheme.navbarTextColor                       | string                                     | いいえ |                                                       |
| darkTheme.conversationBackgroundColor           | string                                     | いいえ |                                                       |
| darkTheme.chatbotMessageTextColor               | string                                     | いいえ |                                                       |
| darkTheme.userMessageTextColor                  | string                                     | いいえ |                                                       |
| darkTheme.chatbotMessageBackgroundColor         | string                                     | いいえ |                                                       |
| darkTheme.userMessageBackgroundColor            | string                                     | いいえ |                                                       |
| darkTheme.chatbotMessageBackgroundShadowEnabled | boolean                                    | いいえ |                                                       |
| darkTheme.userMessageBackgroundShadowEnabled    | boolean                                    | いいえ |                                                       |
| darkTheme.chatbotMessageGradientEnabled         | boolean                                    | いいえ |                                                       |
| darkTheme.userMessageGradientEnabled            | boolean                                    | いいえ |                                                       |
| enableFileUpload                                | boolean                                    | いいえ |                                                       |
| enableDisplayCitations                          | boolean                                    | いいえ |                                                       |
| toolDisplayMode                                 | string (enum: full, compact, hidden)       | いいえ | `full`: Full ; `compact`: Compact ; `hidden`: Hidden; |
| enableDisplayThinking                           | boolean                                    | いいえ |                                                       |
| enableUserThinkingControl                       | boolean                                    | いいえ |                                                       |
| enableDisplayQueryMetadata                      | boolean                                    | いいえ |                                                       |
| enableShareConversation                         | boolean                                    | いいえ |                                                       |
| enableLocation                                  | boolean                                    | いいえ |                                                       |
| enableShowPoweredBy                             | boolean                                    | いいえ |                                                       |
| poweredByLogo                                   | string (uri)                               | いいえ |                                                       |
| enableAnonymous                                 | boolean                                    | いいえ |                                                       |
| enableDisplayPreviousConversation               | boolean                                    | いいえ |                                                       |
| enableDisplayConversationHistory                | boolean                                    | いいえ |                                                       |
| enableConversationTimer                         | boolean                                    | いいえ |                                                       |
| conversationTimerDuration                       | integer                                    | いいえ | タイマーのタイムアウト時間。範囲は 3〜60 分です                            |
| enableAutoNewConversationOnTimeout              | boolean                                    | いいえ |                                                       |
| enableThemeModeToggle                           | boolean                                    | いいえ |                                                       |
| enableDisplayFontSizeSwitch                     | boolean                                    | いいえ |                                                       |
| defaultThemeMode                                | object                                     | いいえ |                                                       |
| enableDownloadCitations                         | boolean                                    | いいえ |                                                       |
| customDomain                                    | object (3 個のプロパティ: id, domain, status を含む) | いいえ |                                                       |
| customDomain.domain                             | string                                     | はい  |                                                       |
| enableDisplayChatbotAvatar                      | boolean                                    | いいえ |                                                       |
| enableDisplayChatbotName                        | boolean                                    | いいえ |                                                       |
| enableVoiceAgent                                | boolean                                    | いいえ | WebChat で音声エージェント機能の利用を許可するかどうか                       |
| buttonIcon                                      | string (uri)                               | いいえ |                                                       |

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

```typescript
{
  "avatar"?: string (uri) // 任意
  "logo"?: string (uri) // 任意
  "description"?: string // 任意
  "cover"?: string (uri) // 任意
  "backUrl"?: string // 任意
  "isActive"?: boolean // 任意
  "theme": {
  {
    "primaryColor"?: string // 任意
    "navbarTextColor"?: string // 任意
    "conversationBackgroundColor"?: string // 任意
    "chatbotMessageTextColor"?: string // 任意
    "userMessageTextColor"?: string // 任意
    "chatbotMessageBackgroundColor"?: string // 任意
    "userMessageBackgroundColor"?: string // 任意
    "chatbotMessageBackgroundShadowEnabled"?: boolean // 任意
    "userMessageBackgroundShadowEnabled"?: boolean // 任意
    "chatbotMessageGradientEnabled"?: boolean // 任意
    "userMessageGradientEnabled"?: boolean // 任意
  }
  }
  "darkTheme": {
  {
    "primaryColor"?: string // 任意
    "navbarTextColor"?: string // 任意
    "conversationBackgroundColor"?: string // 任意
    "chatbotMessageTextColor"?: string // 任意
    "userMessageTextColor"?: string // 任意
    "chatbotMessageBackgroundColor"?: string // 任意
    "userMessageBackgroundColor"?: string // 任意
    "chatbotMessageBackgroundShadowEnabled"?: boolean // 任意
    "userMessageBackgroundShadowEnabled"?: boolean // 任意
    "chatbotMessageGradientEnabled"?: boolean // 任意
    "userMessageGradientEnabled"?: boolean // 任意
  }
  }
  "enableFileUpload"?: boolean // 任意
  "enableDisplayCitations"?: boolean // 任意
  "toolDisplayMode"?: string (enum: full, compact, hidden) // * `full` - Full
* `compact` - Compact
* `hidden` - Hidden (任意)
  "enableDisplayThinking"?: boolean // 任意
  "enableUserThinkingControl"?: boolean // 任意
  "enableDisplayQueryMetadata"?: boolean // 任意
  "enableShareConversation"?: boolean // 任意
  "enableLocation"?: boolean // 任意
  "enableShowPoweredBy"?: boolean // 任意
  "poweredByLogo"?: string (uri) // 任意
  "enableAnonymous"?: boolean // 任意
  "enableDisplayPreviousConversation"?: boolean // 任意
  "enableDisplayConversationHistory"?: boolean // 任意
  "enableConversationTimer"?: boolean // 任意
  "conversationTimerDuration"?: integer // タイマーのタイムアウト時間。範囲は 3〜60 分です (任意)
  "enableAutoNewConversationOnTimeout"?: boolean // 任意
  "enableThemeModeToggle"?: boolean // 任意
  "enableDisplayFontSizeSwitch"?: boolean // 任意
  "defaultThemeMode"?:  // 任意
  {
  }
  "enableDownloadCitations"?: boolean // 任意
  "customDomain"?:  // 任意
  {
    "domain": string
  }
  "enableDisplayChatbotAvatar"?: boolean // 任意
  "enableDisplayChatbotName"?: boolean // 任意
  "enableVoiceAgent"?: boolean // WebChat で音声エージェント機能の利用を許可するかどうか (任意)
  "buttonIcon"?: string (uri) // 任意
}
```

**リクエストの例**

```json
{
  "avatar": "https://example.com/file.jpg",
  "logo": "https://example.com/file.jpg",
  "description": "サンプル文字列",
  "cover": "https://example.com/file.jpg",
  "backUrl": "サンプル文字列",
  "isActive": true,
  "theme": {
    "primaryColor": "サンプル文字列",
    "navbarTextColor": "サンプル文字列",
    "conversationBackgroundColor": "サンプル文字列",
    "chatbotMessageTextColor": "サンプル文字列",
    "userMessageTextColor": "サンプル文字列",
    "chatbotMessageBackgroundColor": "サンプル文字列",
    "userMessageBackgroundColor": "サンプル文字列",
    "chatbotMessageBackgroundShadowEnabled": true,
    "userMessageBackgroundShadowEnabled": true,
    "chatbotMessageGradientEnabled": true,
    "userMessageGradientEnabled": true
  },
  "darkTheme": {
    "primaryColor": "サンプル文字列",
    "navbarTextColor": "サンプル文字列",
    "conversationBackgroundColor": "サンプル文字列",
    "chatbotMessageTextColor": "サンプル文字列",
    "userMessageTextColor": "サンプル文字列",
    "chatbotMessageBackgroundColor": "サンプル文字列",
    "userMessageBackgroundColor": "サンプル文字列",
    "chatbotMessageBackgroundShadowEnabled": true,
    "userMessageBackgroundShadowEnabled": true,
    "chatbotMessageGradientEnabled": true,
    "userMessageGradientEnabled": true
  },
  "enableFileUpload": true,
  "enableDisplayCitations": true,
  "toolDisplayMode": "full",
  "enableDisplayThinking": true,
  "enableUserThinkingControl": true,
  "enableDisplayQueryMetadata": true,
  "enableShareConversation": true,
  "enableLocation": true,
  "enableShowPoweredBy": true,
  "poweredByLogo": "https://example.com/file.jpg",
  "enableAnonymous": true,
  "enableDisplayPreviousConversation": true,
  "enableDisplayConversationHistory": true,
  "enableConversationTimer": true,
  "conversationTimerDuration": 123,
  "enableAutoNewConversationOnTimeout": true,
  "enableThemeModeToggle": true,
  "enableDisplayFontSizeSwitch": true,
  "defaultThemeMode": {},
  "enableDownloadCitations": true,
  "customDomain": {
    "domain": "サンプル文字列"
  },
  "enableDisplayChatbotAvatar": true,
  "enableDisplayChatbotName": true,
  "enableVoiceAgent": true,
  "buttonIcon": "https://example.com/file.jpg"
}
```

#### コード例

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

```bash
# API 呼び出しの例 (Shell)
curl -X POST "https://api.maiagent.ai/api/web-chats/" \
  -H "Authorization: Api-Key YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "avatar": "https://example.com/file.jpg",
    "logo": "https://example.com/file.jpg",
    "description": "サンプル文字列",
    "cover": "https://example.com/file.jpg",
    "backUrl": "サンプル文字列",
    "isActive": true,
    "theme": {
      "primaryColor": "サンプル文字列",
      "navbarTextColor": "サンプル文字列",
      "conversationBackgroundColor": "サンプル文字列",
      "chatbotMessageTextColor": "サンプル文字列",
      "userMessageTextColor": "サンプル文字列",
      "chatbotMessageBackgroundColor": "サンプル文字列",
      "userMessageBackgroundColor": "サンプル文字列",
      "chatbotMessageBackgroundShadowEnabled": true,
      "userMessageBackgroundShadowEnabled": true,
      "chatbotMessageGradientEnabled": true,
      "userMessageGradientEnabled": true
    },
    "darkTheme": {
      "primaryColor": "サンプル文字列",
      "navbarTextColor": "サンプル文字列",
      "conversationBackgroundColor": "サンプル文字列",
      "chatbotMessageTextColor": "サンプル文字列",
      "userMessageTextColor": "サンプル文字列",
      "chatbotMessageBackgroundColor": "サンプル文字列",
      "userMessageBackgroundColor": "サンプル文字列",
      "chatbotMessageBackgroundShadowEnabled": true,
      "userMessageBackgroundShadowEnabled": true,
      "chatbotMessageGradientEnabled": true,
      "userMessageGradientEnabled": true
    },
    "enableFileUpload": true,
    "enableDisplayCitations": true,
    "toolDisplayMode": "full",
    "enableDisplayThinking": true,
    "enableUserThinkingControl": true,
    "enableDisplayQueryMetadata": true,
    "enableShareConversation": true,
    "enableLocation": true,
    "enableShowPoweredBy": true,
    "poweredByLogo": "https://example.com/file.jpg",
    "enableAnonymous": true,
    "enableDisplayPreviousConversation": true,
    "enableDisplayConversationHistory": true,
    "enableConversationTimer": true,
    "conversationTimerDuration": 123,
    "enableAutoNewConversationOnTimeout": true,
    "enableThemeModeToggle": true,
    "enableDisplayFontSizeSwitch": true,
    "defaultThemeMode": {},
    "enableDownloadCitations": true,
    "customDomain": {
      "domain": "サンプル文字列"
    },
    "enableDisplayChatbotAvatar": true,
    "enableDisplayChatbotName": true,
    "enableVoiceAgent": true,
    "buttonIcon": "https://example.com/file.jpg"
  }'

# 実行前に 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 = {
    "avatar": "https://example.com/file.jpg",
    "logo": "https://example.com/file.jpg",
    "description": "サンプル文字列",
    "cover": "https://example.com/file.jpg",
    "backUrl": "サンプル文字列",
    "isActive": true,
    "theme": {
      "primaryColor": "サンプル文字列",
      "navbarTextColor": "サンプル文字列",
      "conversationBackgroundColor": "サンプル文字列",
      "chatbotMessageTextColor": "サンプル文字列",
      "userMessageTextColor": "サンプル文字列",
      "chatbotMessageBackgroundColor": "サンプル文字列",
      "userMessageBackgroundColor": "サンプル文字列",
      "chatbotMessageBackgroundShadowEnabled": true,
      "userMessageBackgroundShadowEnabled": true,
      "chatbotMessageGradientEnabled": true,
      "userMessageGradientEnabled": true
    },
    "darkTheme": {
      "primaryColor": "サンプル文字列",
      "navbarTextColor": "サンプル文字列",
      "conversationBackgroundColor": "サンプル文字列",
      "chatbotMessageTextColor": "サンプル文字列",
      "userMessageTextColor": "サンプル文字列",
      "chatbotMessageBackgroundColor": "サンプル文字列",
      "userMessageBackgroundColor": "サンプル文字列",
      "chatbotMessageBackgroundShadowEnabled": true,
      "userMessageBackgroundShadowEnabled": true,
      "chatbotMessageGradientEnabled": true,
      "userMessageGradientEnabled": true
    },
    "enableFileUpload": true,
    "enableDisplayCitations": true,
    "toolDisplayMode": "full",
    "enableDisplayThinking": true,
    "enableUserThinkingControl": true,
    "enableDisplayQueryMetadata": true,
    "enableShareConversation": true,
    "enableLocation": true,
    "enableShowPoweredBy": true,
    "poweredByLogo": "https://example.com/file.jpg",
    "enableAnonymous": true,
    "enableDisplayPreviousConversation": true,
    "enableDisplayConversationHistory": true,
    "enableConversationTimer": true,
    "conversationTimerDuration": 123,
    "enableAutoNewConversationOnTimeout": true,
    "enableThemeModeToggle": true,
    "enableDisplayFontSizeSwitch": true,
    "defaultThemeMode": {},
    "enableDownloadCitations": true,
    "customDomain": {
      "domain": "サンプル文字列"
    },
    "enableDisplayChatbotAvatar": true,
    "enableDisplayChatbotName": true,
    "enableVoiceAgent": true,
    "buttonIcon": "https://example.com/file.jpg"
  };

axios.post("https://api.maiagent.ai/api/web-chats/", 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/web-chats/"
headers = {
    "Authorization": "Api-Key YOUR_API_KEY",
    "Content-Type": "application/json"
}

# リクエスト内容 (payload)
data = {
      "avatar": "https://example.com/file.jpg",
      "logo": "https://example.com/file.jpg",
      "description": "サンプル文字列",
      "cover": "https://example.com/file.jpg",
      "backUrl": "サンプル文字列",
      "isActive": true,
      "theme": {
        "primaryColor": "サンプル文字列",
        "navbarTextColor": "サンプル文字列",
        "conversationBackgroundColor": "サンプル文字列",
        "chatbotMessageTextColor": "サンプル文字列",
        "userMessageTextColor": "サンプル文字列",
        "chatbotMessageBackgroundColor": "サンプル文字列",
        "userMessageBackgroundColor": "サンプル文字列",
        "chatbotMessageBackgroundShadowEnabled": true,
        "userMessageBackgroundShadowEnabled": true,
        "chatbotMessageGradientEnabled": true,
        "userMessageGradientEnabled": true
      },
      "darkTheme": {
        "primaryColor": "サンプル文字列",
        "navbarTextColor": "サンプル文字列",
        "conversationBackgroundColor": "サンプル文字列",
        "chatbotMessageTextColor": "サンプル文字列",
        "userMessageTextColor": "サンプル文字列",
        "chatbotMessageBackgroundColor": "サンプル文字列",
        "userMessageBackgroundColor": "サンプル文字列",
        "chatbotMessageBackgroundShadowEnabled": true,
        "userMessageBackgroundShadowEnabled": true,
        "chatbotMessageGradientEnabled": true,
        "userMessageGradientEnabled": true
      },
      "enableFileUpload": true,
      "enableDisplayCitations": true,
      "toolDisplayMode": "full",
      "enableDisplayThinking": true,
      "enableUserThinkingControl": true,
      "enableDisplayQueryMetadata": true,
      "enableShareConversation": true,
      "enableLocation": true,
      "enableShowPoweredBy": true,
      "poweredByLogo": "https://example.com/file.jpg",
      "enableAnonymous": true,
      "enableDisplayPreviousConversation": true,
      "enableDisplayConversationHistory": true,
      "enableConversationTimer": true,
      "conversationTimerDuration": 123,
      "enableAutoNewConversationOnTimeout": true,
      "enableThemeModeToggle": true,
      "enableDisplayFontSizeSwitch": true,
      "defaultThemeMode": {},
      "enableDownloadCitations": true,
      "customDomain": {
        "domain": "サンプル文字列"
      },
      "enableDisplayChatbotAvatar": true,
      "enableDisplayChatbotName": true,
      "enableVoiceAgent": true,
      "buttonIcon": "https://example.com/file.jpg"
    }

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/web-chats/", [
        'headers' => [
            'Authorization' => 'Api-Key YOUR_API_KEY',
            'Content-Type' => 'application/json'
        ],
        'json' => {
            "avatar": "https://example.com/file.jpg",
            "logo": "https://example.com/file.jpg",
            "description": "サンプル文字列",
            "cover": "https://example.com/file.jpg",
            "backUrl": "サンプル文字列",
            "isActive": true,
            "theme": {
                "primaryColor": "サンプル文字列",
                "navbarTextColor": "サンプル文字列",
                "conversationBackgroundColor": "サンプル文字列",
                "chatbotMessageTextColor": "サンプル文字列",
                "userMessageTextColor": "サンプル文字列",
                "chatbotMessageBackgroundColor": "サンプル文字列",
                "userMessageBackgroundColor": "サンプル文字列",
                "chatbotMessageBackgroundShadowEnabled": true,
                "userMessageBackgroundShadowEnabled": true,
                "chatbotMessageGradientEnabled": true,
                "userMessageGradientEnabled": true
            },
            "darkTheme": {
                "primaryColor": "サンプル文字列",
                "navbarTextColor": "サンプル文字列",
                "conversationBackgroundColor": "サンプル文字列",
                "chatbotMessageTextColor": "サンプル文字列",
                "userMessageTextColor": "サンプル文字列",
                "chatbotMessageBackgroundColor": "サンプル文字列",
                "userMessageBackgroundColor": "サンプル文字列",
                "chatbotMessageBackgroundShadowEnabled": true,
                "userMessageBackgroundShadowEnabled": true,
                "chatbotMessageGradientEnabled": true,
                "userMessageGradientEnabled": true
            },
            "enableFileUpload": true,
            "enableDisplayCitations": true,
            "toolDisplayMode": "full",
            "enableDisplayThinking": true,
            "enableUserThinkingControl": true,
            "enableDisplayQueryMetadata": true,
            "enableShareConversation": true,
            "enableLocation": true,
            "enableShowPoweredBy": true,
            "poweredByLogo": "https://example.com/file.jpg",
            "enableAnonymous": true,
            "enableDisplayPreviousConversation": true,
            "enableDisplayConversationHistory": true,
            "enableConversationTimer": true,
            "conversationTimerDuration": 123,
            "enableAutoNewConversationOnTimeout": true,
            "enableThemeModeToggle": true,
            "enableDisplayFontSizeSwitch": true,
            "defaultThemeMode": {},
            "enableDownloadCitations": true,
            "customDomain": {
                "domain": "サンプル文字列"
            },
            "enableDisplayChatbotAvatar": true,
            "enableDisplayChatbotName": true,
            "enableVoiceAgent": true,
            "buttonIcon": "https://example.com/file.jpg"
        }
    ]);
    
    $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
  "avatar"?: string (uri) // 任意
  "logo"?: string (uri) // 任意
  "description"?: string // 任意
  "cover"?: string (uri) // 任意
  "backUrl"?: string // 任意
  "isActive"?: boolean // 任意
  "enableSpeech": boolean
  "displayConversationStarters": [
    string
  ]
  "theme": {
  {
    "primaryColor"?: string // 任意
    "navbarTextColor"?: string // 任意
    "conversationBackgroundColor"?: string // 任意
    "chatbotMessageTextColor"?: string // 任意
    "userMessageTextColor"?: string // 任意
    "chatbotMessageBackgroundColor"?: string // 任意
    "userMessageBackgroundColor"?: string // 任意
    "chatbotMessageBackgroundShadowEnabled"?: boolean // 任意
    "userMessageBackgroundShadowEnabled"?: boolean // 任意
    "chatbotMessageGradientEnabled"?: boolean // 任意
    "userMessageGradientEnabled"?: boolean // 任意
  }
  }
  "darkTheme": {
  {
    "primaryColor"?: string // 任意
    "navbarTextColor"?: string // 任意
    "conversationBackgroundColor"?: string // 任意
    "chatbotMessageTextColor"?: string // 任意
    "userMessageTextColor"?: string // 任意
    "chatbotMessageBackgroundColor"?: string // 任意
    "userMessageBackgroundColor"?: string // 任意
    "chatbotMessageBackgroundShadowEnabled"?: boolean // 任意
    "userMessageBackgroundShadowEnabled"?: boolean // 任意
    "chatbotMessageGradientEnabled"?: boolean // 任意
    "userMessageGradientEnabled"?: boolean // 任意
  }
  }
  "enableFileUpload"?: boolean // 任意
  "enableDisplayCitations"?: boolean // 任意
  "toolDisplayMode"?: string (enum: full, compact, hidden) // * `full` - Full
* `compact` - Compact
* `hidden` - Hidden (任意)
  "enableDisplayThinking"?: boolean // 任意
  "enableUserThinkingControl"?: boolean // 任意
  "enableDisplayQueryMetadata"?: boolean // 任意
  "enableShareConversation"?: boolean // 任意
  "enableLocation"?: boolean // 任意
  "enableShowPoweredBy"?: boolean // 任意
  "poweredByLogo"?: string (uri) // 任意
  "enableAnonymous"?: boolean // 任意
  "enableDisplayPreviousConversation"?: boolean // 任意
  "enableDisplayConversationHistory"?: boolean // 任意
  "enableConversationTimer"?: boolean // 任意
  "conversationTimerDuration"?: integer // タイマーのタイムアウト時間。範囲は 3〜60 分です (任意)
  "enableAutoNewConversationOnTimeout"?: boolean // 任意
  "accessType": 
  {
  }
  "enableThemeModeToggle"?: boolean // 任意
  "enableDisplayFontSizeSwitch"?: boolean // 任意
  "defaultThemeMode"?:  // 任意
  {
  }
  "enableDownloadCitations"?: boolean // 任意
  "customDomain"?:  // 任意
  {
    "id": string (uuid)
    "domain": string
    "status": 
    {
    }
  }
  "enableDisplayChatbotAvatar"?: boolean // 任意
  "enableDisplayChatbotName"?: boolean // 任意
  "enableVoiceAgent"?: boolean // WebChat で音声エージェント機能の利用を許可するかどうか (任意)
  "buttonIcon"?: string (uri) // 任意
  "inbox": object
}
```

**レスポンスの例**

```json
{
  "id": "550e8400-e29b-41d4-a716-446655440000",
  "name": "レスポンス文字列",
  "avatar": "https://example.com/file.jpg",
  "logo": "https://example.com/file.jpg",
  "description": "レスポンス文字列",
  "cover": "https://example.com/file.jpg",
  "backUrl": "レスポンス文字列",
  "isActive": false,
  "enableSpeech": false,
  "displayConversationStarters": [
    "レスポンス文字列"
  ],
  "theme": {
    "primaryColor": "レスポンス文字列",
    "navbarTextColor": "レスポンス文字列",
    "conversationBackgroundColor": "レスポンス文字列",
    "chatbotMessageTextColor": "レスポンス文字列",
    "userMessageTextColor": "レスポンス文字列",
    "chatbotMessageBackgroundColor": "レスポンス文字列",
    "userMessageBackgroundColor": "レスポンス文字列",
    "chatbotMessageBackgroundShadowEnabled": false,
    "userMessageBackgroundShadowEnabled": false,
    "chatbotMessageGradientEnabled": false,
    "userMessageGradientEnabled": false
  },
  "darkTheme": {
    "primaryColor": "レスポンス文字列",
    "navbarTextColor": "レスポンス文字列",
    "conversationBackgroundColor": "レスポンス文字列",
    "chatbotMessageTextColor": "レスポンス文字列",
    "userMessageTextColor": "レスポンス文字列",
    "chatbotMessageBackgroundColor": "レスポンス文字列",
    "userMessageBackgroundColor": "レスポンス文字列",
    "chatbotMessageBackgroundShadowEnabled": false,
    "userMessageBackgroundShadowEnabled": false,
    "chatbotMessageGradientEnabled": false,
    "userMessageGradientEnabled": false
  },
  "enableFileUpload": false,
  "enableDisplayCitations": false,
  "toolDisplayMode": "full",
  "enableDisplayThinking": false,
  "enableUserThinkingControl": false,
  "enableDisplayQueryMetadata": false,
  "enableShareConversation": false,
  "enableLocation": false,
  "enableShowPoweredBy": false,
  "poweredByLogo": "https://example.com/file.jpg",
  "enableAnonymous": false,
  "enableDisplayPreviousConversation": false,
  "enableDisplayConversationHistory": false,
  "enableConversationTimer": false,
  "conversationTimerDuration": 456,
  "enableAutoNewConversationOnTimeout": false,
  "accessType": {},
  "enableThemeModeToggle": false,
  "enableDisplayFontSizeSwitch": false,
  "defaultThemeMode": {},
  "enableDownloadCitations": false,
  "customDomain": {
    "id": "550e8400-e29b-41d4-a716-446655440000",
    "domain": "レスポンス文字列",
    "status": {}
  },
  "enableDisplayChatbotAvatar": false,
  "enableDisplayChatbotName": false,
  "enableVoiceAgent": false,
  "buttonIcon": "https://example.com/file.jpg",
  "inbox": {
    "id": "550e8400-e29b-41d4-a716-446655440000",
    "name": "レスポンス例の名前",
    "description": "レスポンス例の説明"
  }
}
```

***

### Web Chat の一覧取得 <a href="#web-chat" id="web-chat"></a>

GET `/api/v1/web-chats/`

#### コード例

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

```bash
# API 呼び出しの例 (Shell)
curl -X GET "https://api.maiagent.ai/api/v1/web-chats/" \
  -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/web-chats/", 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/web-chats/"
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/web-chats/", [
        '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)
    "avatar"?: string (uri) // 任意
    "name": string
  }
]
```

**レスポンスの例**

```json
[
  {
    "id": "550e8400-e29b-41d4-a716-446655440000",
    "avatar": "https://example.com/file.jpg",
    "name": "レスポンス文字列"
  }
]
```

***

### Web Chat の一覧取得 <a href="#web-chat" id="web-chat"></a>

GET `/api/web-chats/`

#### コード例

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

```bash
# API 呼び出しの例 (Shell)
curl -X GET "https://api.maiagent.ai/api/web-chats/" \
  -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/web-chats/", 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/web-chats/"
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/web-chats/", [
        '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)
    "avatar"?: string (uri) // 任意
    "name": string
  }
]
```

**レスポンスの例**

```json
[
  {
    "id": "550e8400-e29b-41d4-a716-446655440000",
    "avatar": "https://example.com/file.jpg",
    "name": "レスポンス文字列"
  }
]
```

***

### 特定の Web Chat の取得 <a href="#web-chat" id="web-chat"></a>

GET `/api/v1/web-chats/{id}/`

#### パラメータ

| パラメータ名 | 必須 | 型      | 説明                                       |
| ------ | -- | ------ | ---------------------------------------- |
| `id`   | ✅  | string | A UUID string identifying this web chat. |

#### コード例

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

```bash
# API 呼び出しの例 (Shell)
curl -X GET "https://api.maiagent.ai/api/v1/web-chats/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/web-chats/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/web-chats/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/web-chats/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
  "avatar"?: string (uri) // 任意
  "logo"?: string (uri) // 任意
  "description"?: string // 任意
  "cover"?: string (uri) // 任意
  "backUrl"?: string // 任意
  "isActive"?: boolean // 任意
  "enableSpeech": boolean
  "displayConversationStarters": [
    string
  ]
  "theme": {
  {
    "primaryColor"?: string // 任意
    "navbarTextColor"?: string // 任意
    "conversationBackgroundColor"?: string // 任意
    "chatbotMessageTextColor"?: string // 任意
    "userMessageTextColor"?: string // 任意
    "chatbotMessageBackgroundColor"?: string // 任意
    "userMessageBackgroundColor"?: string // 任意
    "chatbotMessageBackgroundShadowEnabled"?: boolean // 任意
    "userMessageBackgroundShadowEnabled"?: boolean // 任意
    "chatbotMessageGradientEnabled"?: boolean // 任意
    "userMessageGradientEnabled"?: boolean // 任意
  }
  }
  "darkTheme": {
  {
    "primaryColor"?: string // 任意
    "navbarTextColor"?: string // 任意
    "conversationBackgroundColor"?: string // 任意
    "chatbotMessageTextColor"?: string // 任意
    "userMessageTextColor"?: string // 任意
    "chatbotMessageBackgroundColor"?: string // 任意
    "userMessageBackgroundColor"?: string // 任意
    "chatbotMessageBackgroundShadowEnabled"?: boolean // 任意
    "userMessageBackgroundShadowEnabled"?: boolean // 任意
    "chatbotMessageGradientEnabled"?: boolean // 任意
    "userMessageGradientEnabled"?: boolean // 任意
  }
  }
  "enableFileUpload"?: boolean // 任意
  "enableDisplayCitations"?: boolean // 任意
  "toolDisplayMode"?: string (enum: full, compact, hidden) // * `full` - Full
* `compact` - Compact
* `hidden` - Hidden (任意)
  "enableDisplayThinking"?: boolean // 任意
  "enableUserThinkingControl"?: boolean // 任意
  "enableDisplayQueryMetadata"?: boolean // 任意
  "enableShareConversation"?: boolean // 任意
  "enableLocation"?: boolean // 任意
  "enableShowPoweredBy"?: boolean // 任意
  "poweredByLogo"?: string (uri) // 任意
  "enableAnonymous"?: boolean // 任意
  "enableDisplayPreviousConversation"?: boolean // 任意
  "enableDisplayConversationHistory"?: boolean // 任意
  "enableConversationTimer"?: boolean // 任意
  "conversationTimerDuration"?: integer // タイマーのタイムアウト時間。範囲は 3〜60 分です (任意)
  "enableAutoNewConversationOnTimeout"?: boolean // 任意
  "accessType": 
  {
  }
  "enableThemeModeToggle"?: boolean // 任意
  "enableDisplayFontSizeSwitch"?: boolean // 任意
  "defaultThemeMode"?:  // 任意
  {
  }
  "enableDownloadCitations"?: boolean // 任意
  "customDomain"?:  // 任意
  {
    "id": string (uuid)
    "domain": string
    "status": 
    {
    }
  }
  "enableDisplayChatbotAvatar"?: boolean // 任意
  "enableDisplayChatbotName"?: boolean // 任意
  "enableVoiceAgent"?: boolean // WebChat で音声エージェント機能の利用を許可するかどうか (任意)
  "buttonIcon"?: string (uri) // 任意
  "inbox": object
}
```

**レスポンスの例**

```json
{
  "id": "123e4567-e89b-12d3-a456-426614174000",
  "name": "テスト doc",
  "avatar": "https://example.com/static/images/default-chatbot-avatar.png",
  "logo": null,
  "description": "",
  "cover": null,
  "backUrl": "",
  "isActive": true,
  "enableSpeech": false,
  "displayGreeting": null,
  "displayConversationStarters": [],
  "theme": {
    "primaryColor": "#3854d8",
    "dialogColor": "#ddeaf6",
    "navbarTextColor": "#ffffff"
  },
  "enableFileUpload": true,
  "enableDisplayCitations": true,
  "enableShareConversation": false,
  "enableLocation": false,
  "enableShowPoweredBy": true,
  "poweredByLogo": null,
  "accessType": "web",
  "inbox": {
    "id": "550e8400-e29b-41d4-a716-446655440000",
    "name": "テスト doc",
    "signAuth": {
      "id": "6ba7b810-9dad-11d1-80b4-00c04fd430c8",
      "signSource": {
        "id": "7c9e6679-7425-40de-944b-e07fc1f90ae7",
        "accessType": "keycloak"
      },
      "signParams": {
        "keycloak": {
          "url": "example.com",
          "realm": "example",
          "clientId": "example"
        }
      }
    }
  }
}
```

***

### 特定の Web Chat の取得 <a href="#web-chat" id="web-chat"></a>

GET `/api/web-chats/{id}/`

#### パラメータ

| パラメータ名 | 必須 | 型      | 説明                                       |
| ------ | -- | ------ | ---------------------------------------- |
| `id`   | ✅  | string | A UUID string identifying this web chat. |

#### コード例

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

```bash
# API 呼び出しの例 (Shell)
curl -X GET "https://api.maiagent.ai/api/web-chats/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/web-chats/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/web-chats/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/web-chats/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
  "avatar"?: string (uri) // 任意
  "logo"?: string (uri) // 任意
  "description"?: string // 任意
  "cover"?: string (uri) // 任意
  "backUrl"?: string // 任意
  "isActive"?: boolean // 任意
  "enableSpeech": boolean
  "displayConversationStarters": [
    string
  ]
  "theme": {
  {
    "primaryColor"?: string // 任意
    "navbarTextColor"?: string // 任意
    "conversationBackgroundColor"?: string // 任意
    "chatbotMessageTextColor"?: string // 任意
    "userMessageTextColor"?: string // 任意
    "chatbotMessageBackgroundColor"?: string // 任意
    "userMessageBackgroundColor"?: string // 任意
    "chatbotMessageBackgroundShadowEnabled"?: boolean // 任意
    "userMessageBackgroundShadowEnabled"?: boolean // 任意
    "chatbotMessageGradientEnabled"?: boolean // 任意
    "userMessageGradientEnabled"?: boolean // 任意
  }
  }
  "darkTheme": {
  {
    "primaryColor"?: string // 任意
    "navbarTextColor"?: string // 任意
    "conversationBackgroundColor"?: string // 任意
    "chatbotMessageTextColor"?: string // 任意
    "userMessageTextColor"?: string // 任意
    "chatbotMessageBackgroundColor"?: string // 任意
    "userMessageBackgroundColor"?: string // 任意
    "chatbotMessageBackgroundShadowEnabled"?: boolean // 任意
    "userMessageBackgroundShadowEnabled"?: boolean // 任意
    "chatbotMessageGradientEnabled"?: boolean // 任意
    "userMessageGradientEnabled"?: boolean // 任意
  }
  }
  "enableFileUpload"?: boolean // 任意
  "enableDisplayCitations"?: boolean // 任意
  "toolDisplayMode"?: string (enum: full, compact, hidden) // * `full` - Full
* `compact` - Compact
* `hidden` - Hidden (任意)
  "enableDisplayThinking"?: boolean // 任意
  "enableUserThinkingControl"?: boolean // 任意
  "enableDisplayQueryMetadata"?: boolean // 任意
  "enableShareConversation"?: boolean // 任意
  "enableLocation"?: boolean // 任意
  "enableShowPoweredBy"?: boolean // 任意
  "poweredByLogo"?: string (uri) // 任意
  "enableAnonymous"?: boolean // 任意
  "enableDisplayPreviousConversation"?: boolean // 任意
  "enableDisplayConversationHistory"?: boolean // 任意
  "enableConversationTimer"?: boolean // 任意
  "conversationTimerDuration"?: integer // タイマーのタイムアウト時間。範囲は 3〜60 分です (任意)
  "enableAutoNewConversationOnTimeout"?: boolean // 任意
  "accessType": 
  {
  }
  "enableThemeModeToggle"?: boolean // 任意
  "enableDisplayFontSizeSwitch"?: boolean // 任意
  "defaultThemeMode"?:  // 任意
  {
  }
  "enableDownloadCitations"?: boolean // 任意
  "customDomain"?:  // 任意
  {
    "id": string (uuid)
    "domain": string
    "status": 
    {
    }
  }
  "enableDisplayChatbotAvatar"?: boolean // 任意
  "enableDisplayChatbotName"?: boolean // 任意
  "enableVoiceAgent"?: boolean // WebChat で音声エージェント機能の利用を許可するかどうか (任意)
  "buttonIcon"?: string (uri) // 任意
  "inbox": object
}
```

**レスポンスの例**

```json
{
  "id": "123e4567-e89b-12d3-a456-426614174000",
  "name": "テスト doc",
  "avatar": "https://example.com/static/images/default-chatbot-avatar.png",
  "logo": null,
  "description": "",
  "cover": null,
  "backUrl": "",
  "isActive": true,
  "enableSpeech": false,
  "displayGreeting": null,
  "displayConversationStarters": [],
  "theme": {
    "primaryColor": "#3854d8",
    "dialogColor": "#ddeaf6",
    "navbarTextColor": "#ffffff"
  },
  "enableFileUpload": true,
  "enableDisplayCitations": true,
  "enableShareConversation": false,
  "enableLocation": false,
  "enableShowPoweredBy": true,
  "poweredByLogo": null,
  "accessType": "web",
  "inbox": {
    "id": "550e8400-e29b-41d4-a716-446655440000",
    "name": "テスト doc",
    "signAuth": {
      "id": "6ba7b810-9dad-11d1-80b4-00c04fd430c8",
      "signSource": {
        "id": "7c9e6679-7425-40de-944b-e07fc1f90ae7",
        "accessType": "keycloak"
      },
      "signParams": {
        "keycloak": {
          "url": "example.com",
          "realm": "example",
          "clientId": "example"
        }
      }
    }
  }
}
```

***

### Web Chat の更新 <a href="#web-chat" id="web-chat"></a>

PUT `/api/v1/web-chats/{id}/`

#### パラメータ

| パラメータ名 | 必須 | 型      | 説明                                       |
| ------ | -- | ------ | ---------------------------------------- |
| `id`   | ✅  | string | A UUID string identifying this web chat. |

#### リクエスト内容

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

| フィールド                                           | 型                                          | 必須  | 説明                                                    |
| ----------------------------------------------- | ------------------------------------------ | --- | ----------------------------------------------------- |
| avatar                                          | string (uri)                               | いいえ |                                                       |
| logo                                            | string (uri)                               | いいえ |                                                       |
| description                                     | string                                     | いいえ |                                                       |
| cover                                           | string (uri)                               | いいえ |                                                       |
| backUrl                                         | string                                     | いいえ |                                                       |
| isActive                                        | boolean                                    | いいえ |                                                       |
| theme                                           | object                                     | はい  |                                                       |
| theme.primaryColor                              | string                                     | いいえ |                                                       |
| theme.navbarTextColor                           | string                                     | いいえ |                                                       |
| theme.conversationBackgroundColor               | string                                     | いいえ |                                                       |
| theme.chatbotMessageTextColor                   | string                                     | いいえ |                                                       |
| theme.userMessageTextColor                      | string                                     | いいえ |                                                       |
| theme.chatbotMessageBackgroundColor             | string                                     | いいえ |                                                       |
| theme.userMessageBackgroundColor                | string                                     | いいえ |                                                       |
| theme.chatbotMessageBackgroundShadowEnabled     | boolean                                    | いいえ |                                                       |
| theme.userMessageBackgroundShadowEnabled        | boolean                                    | いいえ |                                                       |
| theme.chatbotMessageGradientEnabled             | boolean                                    | いいえ |                                                       |
| theme.userMessageGradientEnabled                | boolean                                    | いいえ |                                                       |
| darkTheme                                       | object                                     | はい  |                                                       |
| darkTheme.primaryColor                          | string                                     | いいえ |                                                       |
| darkTheme.navbarTextColor                       | string                                     | いいえ |                                                       |
| darkTheme.conversationBackgroundColor           | string                                     | いいえ |                                                       |
| darkTheme.chatbotMessageTextColor               | string                                     | いいえ |                                                       |
| darkTheme.userMessageTextColor                  | string                                     | いいえ |                                                       |
| darkTheme.chatbotMessageBackgroundColor         | string                                     | いいえ |                                                       |
| darkTheme.userMessageBackgroundColor            | string                                     | いいえ |                                                       |
| darkTheme.chatbotMessageBackgroundShadowEnabled | boolean                                    | いいえ |                                                       |
| darkTheme.userMessageBackgroundShadowEnabled    | boolean                                    | いいえ |                                                       |
| darkTheme.chatbotMessageGradientEnabled         | boolean                                    | いいえ |                                                       |
| darkTheme.userMessageGradientEnabled            | boolean                                    | いいえ |                                                       |
| enableFileUpload                                | boolean                                    | いいえ |                                                       |
| enableDisplayCitations                          | boolean                                    | いいえ |                                                       |
| toolDisplayMode                                 | string (enum: full, compact, hidden)       | いいえ | `full`: Full ; `compact`: Compact ; `hidden`: Hidden; |
| enableDisplayThinking                           | boolean                                    | いいえ |                                                       |
| enableUserThinkingControl                       | boolean                                    | いいえ |                                                       |
| enableDisplayQueryMetadata                      | boolean                                    | いいえ |                                                       |
| enableShareConversation                         | boolean                                    | いいえ |                                                       |
| enableLocation                                  | boolean                                    | いいえ |                                                       |
| enableShowPoweredBy                             | boolean                                    | いいえ |                                                       |
| poweredByLogo                                   | string (uri)                               | いいえ |                                                       |
| enableAnonymous                                 | boolean                                    | いいえ |                                                       |
| enableDisplayPreviousConversation               | boolean                                    | いいえ |                                                       |
| enableDisplayConversationHistory                | boolean                                    | いいえ |                                                       |
| enableConversationTimer                         | boolean                                    | いいえ |                                                       |
| conversationTimerDuration                       | integer                                    | いいえ | タイマーのタイムアウト時間。範囲は 3〜60 分です                            |
| enableAutoNewConversationOnTimeout              | boolean                                    | いいえ |                                                       |
| enableThemeModeToggle                           | boolean                                    | いいえ |                                                       |
| enableDisplayFontSizeSwitch                     | boolean                                    | いいえ |                                                       |
| defaultThemeMode                                | object                                     | いいえ |                                                       |
| enableDownloadCitations                         | boolean                                    | いいえ |                                                       |
| customDomain                                    | object (3 個のプロパティ: id, domain, status を含む) | いいえ |                                                       |
| customDomain.domain                             | string                                     | はい  |                                                       |
| enableDisplayChatbotAvatar                      | boolean                                    | いいえ |                                                       |
| enableDisplayChatbotName                        | boolean                                    | いいえ |                                                       |
| enableVoiceAgent                                | boolean                                    | いいえ | WebChat で音声エージェント機能の利用を許可するかどうか                       |
| buttonIcon                                      | string (uri)                               | いいえ |                                                       |

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

```typescript
{
  "avatar"?: string (uri) // 任意
  "logo"?: string (uri) // 任意
  "description"?: string // 任意
  "cover"?: string (uri) // 任意
  "backUrl"?: string // 任意
  "isActive"?: boolean // 任意
  "theme": {
  {
    "primaryColor"?: string // 任意
    "navbarTextColor"?: string // 任意
    "conversationBackgroundColor"?: string // 任意
    "chatbotMessageTextColor"?: string // 任意
    "userMessageTextColor"?: string // 任意
    "chatbotMessageBackgroundColor"?: string // 任意
    "userMessageBackgroundColor"?: string // 任意
    "chatbotMessageBackgroundShadowEnabled"?: boolean // 任意
    "userMessageBackgroundShadowEnabled"?: boolean // 任意
    "chatbotMessageGradientEnabled"?: boolean // 任意
    "userMessageGradientEnabled"?: boolean // 任意
  }
  }
  "darkTheme": {
  {
    "primaryColor"?: string // 任意
    "navbarTextColor"?: string // 任意
    "conversationBackgroundColor"?: string // 任意
    "chatbotMessageTextColor"?: string // 任意
    "userMessageTextColor"?: string // 任意
    "chatbotMessageBackgroundColor"?: string // 任意
    "userMessageBackgroundColor"?: string // 任意
    "chatbotMessageBackgroundShadowEnabled"?: boolean // 任意
    "userMessageBackgroundShadowEnabled"?: boolean // 任意
    "chatbotMessageGradientEnabled"?: boolean // 任意
    "userMessageGradientEnabled"?: boolean // 任意
  }
  }
  "enableFileUpload"?: boolean // 任意
  "enableDisplayCitations"?: boolean // 任意
  "toolDisplayMode"?: string (enum: full, compact, hidden) // * `full` - Full
* `compact` - Compact
* `hidden` - Hidden (任意)
  "enableDisplayThinking"?: boolean // 任意
  "enableUserThinkingControl"?: boolean // 任意
  "enableDisplayQueryMetadata"?: boolean // 任意
  "enableShareConversation"?: boolean // 任意
  "enableLocation"?: boolean // 任意
  "enableShowPoweredBy"?: boolean // 任意
  "poweredByLogo"?: string (uri) // 任意
  "enableAnonymous"?: boolean // 任意
  "enableDisplayPreviousConversation"?: boolean // 任意
  "enableDisplayConversationHistory"?: boolean // 任意
  "enableConversationTimer"?: boolean // 任意
  "conversationTimerDuration"?: integer // タイマーのタイムアウト時間。範囲は 3〜60 分です (任意)
  "enableAutoNewConversationOnTimeout"?: boolean // 任意
  "enableThemeModeToggle"?: boolean // 任意
  "enableDisplayFontSizeSwitch"?: boolean // 任意
  "defaultThemeMode"?:  // 任意
  {
  }
  "enableDownloadCitations"?: boolean // 任意
  "customDomain"?:  // 任意
  {
    "domain": string
  }
  "enableDisplayChatbotAvatar"?: boolean // 任意
  "enableDisplayChatbotName"?: boolean // 任意
  "enableVoiceAgent"?: boolean // WebChat で音声エージェント機能の利用を許可するかどうか (任意)
  "buttonIcon"?: string (uri) // 任意
}
```

**リクエストの例**

```json
{
  "avatar": "https://example.com/file.jpg",
  "logo": "https://example.com/file.jpg",
  "description": "サンプル文字列",
  "cover": "https://example.com/file.jpg",
  "backUrl": "サンプル文字列",
  "isActive": true,
  "theme": {
    "primaryColor": "サンプル文字列",
    "navbarTextColor": "サンプル文字列",
    "conversationBackgroundColor": "サンプル文字列",
    "chatbotMessageTextColor": "サンプル文字列",
    "userMessageTextColor": "サンプル文字列",
    "chatbotMessageBackgroundColor": "サンプル文字列",
    "userMessageBackgroundColor": "サンプル文字列",
    "chatbotMessageBackgroundShadowEnabled": true,
    "userMessageBackgroundShadowEnabled": true,
    "chatbotMessageGradientEnabled": true,
    "userMessageGradientEnabled": true
  },
  "darkTheme": {
    "primaryColor": "サンプル文字列",
    "navbarTextColor": "サンプル文字列",
    "conversationBackgroundColor": "サンプル文字列",
    "chatbotMessageTextColor": "サンプル文字列",
    "userMessageTextColor": "サンプル文字列",
    "chatbotMessageBackgroundColor": "サンプル文字列",
    "userMessageBackgroundColor": "サンプル文字列",
    "chatbotMessageBackgroundShadowEnabled": true,
    "userMessageBackgroundShadowEnabled": true,
    "chatbotMessageGradientEnabled": true,
    "userMessageGradientEnabled": true
  },
  "enableFileUpload": true,
  "enableDisplayCitations": true,
  "toolDisplayMode": "full",
  "enableDisplayThinking": true,
  "enableUserThinkingControl": true,
  "enableDisplayQueryMetadata": true,
  "enableShareConversation": true,
  "enableLocation": true,
  "enableShowPoweredBy": true,
  "poweredByLogo": "https://example.com/file.jpg",
  "enableAnonymous": true,
  "enableDisplayPreviousConversation": true,
  "enableDisplayConversationHistory": true,
  "enableConversationTimer": true,
  "conversationTimerDuration": 123,
  "enableAutoNewConversationOnTimeout": true,
  "enableThemeModeToggle": true,
  "enableDisplayFontSizeSwitch": true,
  "defaultThemeMode": {},
  "enableDownloadCitations": true,
  "customDomain": {
    "domain": "サンプル文字列"
  },
  "enableDisplayChatbotAvatar": true,
  "enableDisplayChatbotName": true,
  "enableVoiceAgent": true,
  "buttonIcon": "https://example.com/file.jpg"
}
```

#### コード例

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

```bash
# API 呼び出しの例 (Shell)
curl -X PUT "https://api.maiagent.ai/api/v1/web-chats/550e8400-e29b-41d4-a716-446655440000/" \
  -H "Authorization: Api-Key YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "avatar": "https://example.com/file.jpg",
    "logo": "https://example.com/file.jpg",
    "description": "サンプル文字列",
    "cover": "https://example.com/file.jpg",
    "backUrl": "サンプル文字列",
    "isActive": true,
    "theme": {
      "primaryColor": "サンプル文字列",
      "navbarTextColor": "サンプル文字列",
      "conversationBackgroundColor": "サンプル文字列",
      "chatbotMessageTextColor": "サンプル文字列",
      "userMessageTextColor": "サンプル文字列",
      "chatbotMessageBackgroundColor": "サンプル文字列",
      "userMessageBackgroundColor": "サンプル文字列",
      "chatbotMessageBackgroundShadowEnabled": true,
      "userMessageBackgroundShadowEnabled": true,
      "chatbotMessageGradientEnabled": true,
      "userMessageGradientEnabled": true
    },
    "darkTheme": {
      "primaryColor": "サンプル文字列",
      "navbarTextColor": "サンプル文字列",
      "conversationBackgroundColor": "サンプル文字列",
      "chatbotMessageTextColor": "サンプル文字列",
      "userMessageTextColor": "サンプル文字列",
      "chatbotMessageBackgroundColor": "サンプル文字列",
      "userMessageBackgroundColor": "サンプル文字列",
      "chatbotMessageBackgroundShadowEnabled": true,
      "userMessageBackgroundShadowEnabled": true,
      "chatbotMessageGradientEnabled": true,
      "userMessageGradientEnabled": true
    },
    "enableFileUpload": true,
    "enableDisplayCitations": true,
    "toolDisplayMode": "full",
    "enableDisplayThinking": true,
    "enableUserThinkingControl": true,
    "enableDisplayQueryMetadata": true,
    "enableShareConversation": true,
    "enableLocation": true,
    "enableShowPoweredBy": true,
    "poweredByLogo": "https://example.com/file.jpg",
    "enableAnonymous": true,
    "enableDisplayPreviousConversation": true,
    "enableDisplayConversationHistory": true,
    "enableConversationTimer": true,
    "conversationTimerDuration": 123,
    "enableAutoNewConversationOnTimeout": true,
    "enableThemeModeToggle": true,
    "enableDisplayFontSizeSwitch": true,
    "defaultThemeMode": {},
    "enableDownloadCitations": true,
    "customDomain": {
      "domain": "サンプル文字列"
    },
    "enableDisplayChatbotAvatar": true,
    "enableDisplayChatbotName": true,
    "enableVoiceAgent": true,
    "buttonIcon": "https://example.com/file.jpg"
  }'

# 実行前に 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 = {
    "avatar": "https://example.com/file.jpg",
    "logo": "https://example.com/file.jpg",
    "description": "サンプル文字列",
    "cover": "https://example.com/file.jpg",
    "backUrl": "サンプル文字列",
    "isActive": true,
    "theme": {
      "primaryColor": "サンプル文字列",
      "navbarTextColor": "サンプル文字列",
      "conversationBackgroundColor": "サンプル文字列",
      "chatbotMessageTextColor": "サンプル文字列",
      "userMessageTextColor": "サンプル文字列",
      "chatbotMessageBackgroundColor": "サンプル文字列",
      "userMessageBackgroundColor": "サンプル文字列",
      "chatbotMessageBackgroundShadowEnabled": true,
      "userMessageBackgroundShadowEnabled": true,
      "chatbotMessageGradientEnabled": true,
      "userMessageGradientEnabled": true
    },
    "darkTheme": {
      "primaryColor": "サンプル文字列",
      "navbarTextColor": "サンプル文字列",
      "conversationBackgroundColor": "サンプル文字列",
      "chatbotMessageTextColor": "サンプル文字列",
      "userMessageTextColor": "サンプル文字列",
      "chatbotMessageBackgroundColor": "サンプル文字列",
      "userMessageBackgroundColor": "サンプル文字列",
      "chatbotMessageBackgroundShadowEnabled": true,
      "userMessageBackgroundShadowEnabled": true,
      "chatbotMessageGradientEnabled": true,
      "userMessageGradientEnabled": true
    },
    "enableFileUpload": true,
    "enableDisplayCitations": true,
    "toolDisplayMode": "full",
    "enableDisplayThinking": true,
    "enableUserThinkingControl": true,
    "enableDisplayQueryMetadata": true,
    "enableShareConversation": true,
    "enableLocation": true,
    "enableShowPoweredBy": true,
    "poweredByLogo": "https://example.com/file.jpg",
    "enableAnonymous": true,
    "enableDisplayPreviousConversation": true,
    "enableDisplayConversationHistory": true,
    "enableConversationTimer": true,
    "conversationTimerDuration": 123,
    "enableAutoNewConversationOnTimeout": true,
    "enableThemeModeToggle": true,
    "enableDisplayFontSizeSwitch": true,
    "defaultThemeMode": {},
    "enableDownloadCitations": true,
    "customDomain": {
      "domain": "サンプル文字列"
    },
    "enableDisplayChatbotAvatar": true,
    "enableDisplayChatbotName": true,
    "enableVoiceAgent": true,
    "buttonIcon": "https://example.com/file.jpg"
  };

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

# リクエスト内容 (payload)
data = {
      "avatar": "https://example.com/file.jpg",
      "logo": "https://example.com/file.jpg",
      "description": "サンプル文字列",
      "cover": "https://example.com/file.jpg",
      "backUrl": "サンプル文字列",
      "isActive": true,
      "theme": {
        "primaryColor": "サンプル文字列",
        "navbarTextColor": "サンプル文字列",
        "conversationBackgroundColor": "サンプル文字列",
        "chatbotMessageTextColor": "サンプル文字列",
        "userMessageTextColor": "サンプル文字列",
        "chatbotMessageBackgroundColor": "サンプル文字列",
        "userMessageBackgroundColor": "サンプル文字列",
        "chatbotMessageBackgroundShadowEnabled": true,
        "userMessageBackgroundShadowEnabled": true,
        "chatbotMessageGradientEnabled": true,
        "userMessageGradientEnabled": true
      },
      "darkTheme": {
        "primaryColor": "サンプル文字列",
        "navbarTextColor": "サンプル文字列",
        "conversationBackgroundColor": "サンプル文字列",
        "chatbotMessageTextColor": "サンプル文字列",
        "userMessageTextColor": "サンプル文字列",
        "chatbotMessageBackgroundColor": "サンプル文字列",
        "userMessageBackgroundColor": "サンプル文字列",
        "chatbotMessageBackgroundShadowEnabled": true,
        "userMessageBackgroundShadowEnabled": true,
        "chatbotMessageGradientEnabled": true,
        "userMessageGradientEnabled": true
      },
      "enableFileUpload": true,
      "enableDisplayCitations": true,
      "toolDisplayMode": "full",
      "enableDisplayThinking": true,
      "enableUserThinkingControl": true,
      "enableDisplayQueryMetadata": true,
      "enableShareConversation": true,
      "enableLocation": true,
      "enableShowPoweredBy": true,
      "poweredByLogo": "https://example.com/file.jpg",
      "enableAnonymous": true,
      "enableDisplayPreviousConversation": true,
      "enableDisplayConversationHistory": true,
      "enableConversationTimer": true,
      "conversationTimerDuration": 123,
      "enableAutoNewConversationOnTimeout": true,
      "enableThemeModeToggle": true,
      "enableDisplayFontSizeSwitch": true,
      "defaultThemeMode": {},
      "enableDownloadCitations": true,
      "customDomain": {
        "domain": "サンプル文字列"
      },
      "enableDisplayChatbotAvatar": true,
      "enableDisplayChatbotName": true,
      "enableVoiceAgent": true,
      "buttonIcon": "https://example.com/file.jpg"
    }

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/web-chats/550e8400-e29b-41d4-a716-446655440000/", [
        'headers' => [
            'Authorization' => 'Api-Key YOUR_API_KEY',
            'Content-Type' => 'application/json'
        ],
        'json' => {
            "avatar": "https://example.com/file.jpg",
            "logo": "https://example.com/file.jpg",
            "description": "サンプル文字列",
            "cover": "https://example.com/file.jpg",
            "backUrl": "サンプル文字列",
            "isActive": true,
            "theme": {
                "primaryColor": "サンプル文字列",
                "navbarTextColor": "サンプル文字列",
                "conversationBackgroundColor": "サンプル文字列",
                "chatbotMessageTextColor": "サンプル文字列",
                "userMessageTextColor": "サンプル文字列",
                "chatbotMessageBackgroundColor": "サンプル文字列",
                "userMessageBackgroundColor": "サンプル文字列",
                "chatbotMessageBackgroundShadowEnabled": true,
                "userMessageBackgroundShadowEnabled": true,
                "chatbotMessageGradientEnabled": true,
                "userMessageGradientEnabled": true
            },
            "darkTheme": {
                "primaryColor": "サンプル文字列",
                "navbarTextColor": "サンプル文字列",
                "conversationBackgroundColor": "サンプル文字列",
                "chatbotMessageTextColor": "サンプル文字列",
                "userMessageTextColor": "サンプル文字列",
                "chatbotMessageBackgroundColor": "サンプル文字列",
                "userMessageBackgroundColor": "サンプル文字列",
                "chatbotMessageBackgroundShadowEnabled": true,
                "userMessageBackgroundShadowEnabled": true,
                "chatbotMessageGradientEnabled": true,
                "userMessageGradientEnabled": true
            },
            "enableFileUpload": true,
            "enableDisplayCitations": true,
            "toolDisplayMode": "full",
            "enableDisplayThinking": true,
            "enableUserThinkingControl": true,
            "enableDisplayQueryMetadata": true,
            "enableShareConversation": true,
            "enableLocation": true,
            "enableShowPoweredBy": true,
            "poweredByLogo": "https://example.com/file.jpg",
            "enableAnonymous": true,
            "enableDisplayPreviousConversation": true,
            "enableDisplayConversationHistory": true,
            "enableConversationTimer": true,
            "conversationTimerDuration": 123,
            "enableAutoNewConversationOnTimeout": true,
            "enableThemeModeToggle": true,
            "enableDisplayFontSizeSwitch": true,
            "defaultThemeMode": {},
            "enableDownloadCitations": true,
            "customDomain": {
                "domain": "サンプル文字列"
            },
            "enableDisplayChatbotAvatar": true,
            "enableDisplayChatbotName": true,
            "enableVoiceAgent": true,
            "buttonIcon": "https://example.com/file.jpg"
        }
    ]);
    
    $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
  "avatar"?: string (uri) // 任意
  "logo"?: string (uri) // 任意
  "description"?: string // 任意
  "cover"?: string (uri) // 任意
  "backUrl"?: string // 任意
  "isActive"?: boolean // 任意
  "enableSpeech": boolean
  "displayConversationStarters": [
    string
  ]
  "theme": {
  {
    "primaryColor"?: string // 任意
    "navbarTextColor"?: string // 任意
    "conversationBackgroundColor"?: string // 任意
    "chatbotMessageTextColor"?: string // 任意
    "userMessageTextColor"?: string // 任意
    "chatbotMessageBackgroundColor"?: string // 任意
    "userMessageBackgroundColor"?: string // 任意
    "chatbotMessageBackgroundShadowEnabled"?: boolean // 任意
    "userMessageBackgroundShadowEnabled"?: boolean // 任意
    "chatbotMessageGradientEnabled"?: boolean // 任意
    "userMessageGradientEnabled"?: boolean // 任意
  }
  }
  "darkTheme": {
  {
    "primaryColor"?: string // 任意
    "navbarTextColor"?: string // 任意
    "conversationBackgroundColor"?: string // 任意
    "chatbotMessageTextColor"?: string // 任意
    "userMessageTextColor"?: string // 任意
    "chatbotMessageBackgroundColor"?: string // 任意
    "userMessageBackgroundColor"?: string // 任意
    "chatbotMessageBackgroundShadowEnabled"?: boolean // 任意
    "userMessageBackgroundShadowEnabled"?: boolean // 任意
    "chatbotMessageGradientEnabled"?: boolean // 任意
    "userMessageGradientEnabled"?: boolean // 任意
  }
  }
  "enableFileUpload"?: boolean // 任意
  "enableDisplayCitations"?: boolean // 任意
  "toolDisplayMode"?: string (enum: full, compact, hidden) // * `full` - Full
* `compact` - Compact
* `hidden` - Hidden (任意)
  "enableDisplayThinking"?: boolean // 任意
  "enableUserThinkingControl"?: boolean // 任意
  "enableDisplayQueryMetadata"?: boolean // 任意
  "enableShareConversation"?: boolean // 任意
  "enableLocation"?: boolean // 任意
  "enableShowPoweredBy"?: boolean // 任意
  "poweredByLogo"?: string (uri) // 任意
  "enableAnonymous"?: boolean // 任意
  "enableDisplayPreviousConversation"?: boolean // 任意
  "enableDisplayConversationHistory"?: boolean // 任意
  "enableConversationTimer"?: boolean // 任意
  "conversationTimerDuration"?: integer // タイマーのタイムアウト時間。範囲は 3〜60 分です (任意)
  "enableAutoNewConversationOnTimeout"?: boolean // 任意
  "accessType": 
  {
  }
  "enableThemeModeToggle"?: boolean // 任意
  "enableDisplayFontSizeSwitch"?: boolean // 任意
  "defaultThemeMode"?:  // 任意
  {
  }
  "enableDownloadCitations"?: boolean // 任意
  "customDomain"?:  // 任意
  {
    "id": string (uuid)
    "domain": string
    "status": 
    {
    }
  }
  "enableDisplayChatbotAvatar"?: boolean // 任意
  "enableDisplayChatbotName"?: boolean // 任意
  "enableVoiceAgent"?: boolean // WebChat で音声エージェント機能の利用を許可するかどうか (任意)
  "buttonIcon"?: string (uri) // 任意
  "inbox": object
}
```

**レスポンスの例**

```json
{
  "id": "550e8400-e29b-41d4-a716-446655440000",
  "name": "レスポンス文字列",
  "avatar": "https://example.com/file.jpg",
  "logo": "https://example.com/file.jpg",
  "description": "レスポンス文字列",
  "cover": "https://example.com/file.jpg",
  "backUrl": "レスポンス文字列",
  "isActive": false,
  "enableSpeech": false,
  "displayConversationStarters": [
    "レスポンス文字列"
  ],
  "theme": {
    "primaryColor": "レスポンス文字列",
    "navbarTextColor": "レスポンス文字列",
    "conversationBackgroundColor": "レスポンス文字列",
    "chatbotMessageTextColor": "レスポンス文字列",
    "userMessageTextColor": "レスポンス文字列",
    "chatbotMessageBackgroundColor": "レスポンス文字列",
    "userMessageBackgroundColor": "レスポンス文字列",
    "chatbotMessageBackgroundShadowEnabled": false,
    "userMessageBackgroundShadowEnabled": false,
    "chatbotMessageGradientEnabled": false,
    "userMessageGradientEnabled": false
  },
  "darkTheme": {
    "primaryColor": "レスポンス文字列",
    "navbarTextColor": "レスポンス文字列",
    "conversationBackgroundColor": "レスポンス文字列",
    "chatbotMessageTextColor": "レスポンス文字列",
    "userMessageTextColor": "レスポンス文字列",
    "chatbotMessageBackgroundColor": "レスポンス文字列",
    "userMessageBackgroundColor": "レスポンス文字列",
    "chatbotMessageBackgroundShadowEnabled": false,
    "userMessageBackgroundShadowEnabled": false,
    "chatbotMessageGradientEnabled": false,
    "userMessageGradientEnabled": false
  },
  "enableFileUpload": false,
  "enableDisplayCitations": false,
  "toolDisplayMode": "full",
  "enableDisplayThinking": false,
  "enableUserThinkingControl": false,
  "enableDisplayQueryMetadata": false,
  "enableShareConversation": false,
  "enableLocation": false,
  "enableShowPoweredBy": false,
  "poweredByLogo": "https://example.com/file.jpg",
  "enableAnonymous": false,
  "enableDisplayPreviousConversation": false,
  "enableDisplayConversationHistory": false,
  "enableConversationTimer": false,
  "conversationTimerDuration": 456,
  "enableAutoNewConversationOnTimeout": false,
  "accessType": {},
  "enableThemeModeToggle": false,
  "enableDisplayFontSizeSwitch": false,
  "defaultThemeMode": {},
  "enableDownloadCitations": false,
  "customDomain": {
    "id": "550e8400-e29b-41d4-a716-446655440000",
    "domain": "レスポンス文字列",
    "status": {}
  },
  "enableDisplayChatbotAvatar": false,
  "enableDisplayChatbotName": false,
  "enableVoiceAgent": false,
  "buttonIcon": "https://example.com/file.jpg",
  "inbox": {
    "id": "550e8400-e29b-41d4-a716-446655440000",
    "name": "レスポンス例の名前",
    "description": "レスポンス例の説明"
  }
}
```

***

### Web Chat の更新 <a href="#web-chat" id="web-chat"></a>

PUT `/api/web-chats/{id}/`

#### パラメータ

| パラメータ名 | 必須 | 型      | 説明                                       |
| ------ | -- | ------ | ---------------------------------------- |
| `id`   | ✅  | string | A UUID string identifying this web chat. |

#### リクエスト内容

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

| フィールド                                           | 型                                          | 必須  | 説明                                                    |
| ----------------------------------------------- | ------------------------------------------ | --- | ----------------------------------------------------- |
| avatar                                          | string (uri)                               | いいえ |                                                       |
| logo                                            | string (uri)                               | いいえ |                                                       |
| description                                     | string                                     | いいえ |                                                       |
| cover                                           | string (uri)                               | いいえ |                                                       |
| backUrl                                         | string                                     | いいえ |                                                       |
| isActive                                        | boolean                                    | いいえ |                                                       |
| theme                                           | object                                     | はい  |                                                       |
| theme.primaryColor                              | string                                     | いいえ |                                                       |
| theme.navbarTextColor                           | string                                     | いいえ |                                                       |
| theme.conversationBackgroundColor               | string                                     | いいえ |                                                       |
| theme.chatbotMessageTextColor                   | string                                     | いいえ |                                                       |
| theme.userMessageTextColor                      | string                                     | いいえ |                                                       |
| theme.chatbotMessageBackgroundColor             | string                                     | いいえ |                                                       |
| theme.userMessageBackgroundColor                | string                                     | いいえ |                                                       |
| theme.chatbotMessageBackgroundShadowEnabled     | boolean                                    | いいえ |                                                       |
| theme.userMessageBackgroundShadowEnabled        | boolean                                    | いいえ |                                                       |
| theme.chatbotMessageGradientEnabled             | boolean                                    | いいえ |                                                       |
| theme.userMessageGradientEnabled                | boolean                                    | いいえ |                                                       |
| darkTheme                                       | object                                     | はい  |                                                       |
| darkTheme.primaryColor                          | string                                     | いいえ |                                                       |
| darkTheme.navbarTextColor                       | string                                     | いいえ |                                                       |
| darkTheme.conversationBackgroundColor           | string                                     | いいえ |                                                       |
| darkTheme.chatbotMessageTextColor               | string                                     | いいえ |                                                       |
| darkTheme.userMessageTextColor                  | string                                     | いいえ |                                                       |
| darkTheme.chatbotMessageBackgroundColor         | string                                     | いいえ |                                                       |
| darkTheme.userMessageBackgroundColor            | string                                     | いいえ |                                                       |
| darkTheme.chatbotMessageBackgroundShadowEnabled | boolean                                    | いいえ |                                                       |
| darkTheme.userMessageBackgroundShadowEnabled    | boolean                                    | いいえ |                                                       |
| darkTheme.chatbotMessageGradientEnabled         | boolean                                    | いいえ |                                                       |
| darkTheme.userMessageGradientEnabled            | boolean                                    | いいえ |                                                       |
| enableFileUpload                                | boolean                                    | いいえ |                                                       |
| enableDisplayCitations                          | boolean                                    | いいえ |                                                       |
| toolDisplayMode                                 | string (enum: full, compact, hidden)       | いいえ | `full`: Full ; `compact`: Compact ; `hidden`: Hidden; |
| enableDisplayThinking                           | boolean                                    | いいえ |                                                       |
| enableUserThinkingControl                       | boolean                                    | いいえ |                                                       |
| enableDisplayQueryMetadata                      | boolean                                    | いいえ |                                                       |
| enableShareConversation                         | boolean                                    | いいえ |                                                       |
| enableLocation                                  | boolean                                    | いいえ |                                                       |
| enableShowPoweredBy                             | boolean                                    | いいえ |                                                       |
| poweredByLogo                                   | string (uri)                               | いいえ |                                                       |
| enableAnonymous                                 | boolean                                    | いいえ |                                                       |
| enableDisplayPreviousConversation               | boolean                                    | いいえ |                                                       |
| enableDisplayConversationHistory                | boolean                                    | いいえ |                                                       |
| enableConversationTimer                         | boolean                                    | いいえ |                                                       |
| conversationTimerDuration                       | integer                                    | いいえ | タイマーのタイムアウト時間。範囲は 3〜60 分です                            |
| enableAutoNewConversationOnTimeout              | boolean                                    | いいえ |                                                       |
| enableThemeModeToggle                           | boolean                                    | いいえ |                                                       |
| enableDisplayFontSizeSwitch                     | boolean                                    | いいえ |                                                       |
| defaultThemeMode                                | object                                     | いいえ |                                                       |
| enableDownloadCitations                         | boolean                                    | いいえ |                                                       |
| customDomain                                    | object (3 個のプロパティ: id, domain, status を含む) | いいえ |                                                       |
| customDomain.domain                             | string                                     | はい  |                                                       |
| enableDisplayChatbotAvatar                      | boolean                                    | いいえ |                                                       |
| enableDisplayChatbotName                        | boolean                                    | いいえ |                                                       |
| enableVoiceAgent                                | boolean                                    | いいえ | WebChat で音声エージェント機能の利用を許可するかどうか                       |
| buttonIcon                                      | string (uri)                               | いいえ |                                                       |

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

```typescript
{
  "avatar"?: string (uri) // 任意
  "logo"?: string (uri) // 任意
  "description"?: string // 任意
  "cover"?: string (uri) // 任意
  "backUrl"?: string // 任意
  "isActive"?: boolean // 任意
  "theme": {
  {
    "primaryColor"?: string // 任意
    "navbarTextColor"?: string // 任意
    "conversationBackgroundColor"?: string // 任意
    "chatbotMessageTextColor"?: string // 任意
    "userMessageTextColor"?: string // 任意
    "chatbotMessageBackgroundColor"?: string // 任意
    "userMessageBackgroundColor"?: string // 任意
    "chatbotMessageBackgroundShadowEnabled"?: boolean // 任意
    "userMessageBackgroundShadowEnabled"?: boolean // 任意
    "chatbotMessageGradientEnabled"?: boolean // 任意
    "userMessageGradientEnabled"?: boolean // 任意
  }
  }
  "darkTheme": {
  {
    "primaryColor"?: string // 任意
    "navbarTextColor"?: string // 任意
    "conversationBackgroundColor"?: string // 任意
    "chatbotMessageTextColor"?: string // 任意
    "userMessageTextColor"?: string // 任意
    "chatbotMessageBackgroundColor"?: string // 任意
    "userMessageBackgroundColor"?: string // 任意
    "chatbotMessageBackgroundShadowEnabled"?: boolean // 任意
    "userMessageBackgroundShadowEnabled"?: boolean // 任意
    "chatbotMessageGradientEnabled"?: boolean // 任意
    "userMessageGradientEnabled"?: boolean // 任意
  }
  }
  "enableFileUpload"?: boolean // 任意
  "enableDisplayCitations"?: boolean // 任意
  "toolDisplayMode"?: string (enum: full, compact, hidden) // * `full` - Full
* `compact` - Compact
* `hidden` - Hidden (任意)
  "enableDisplayThinking"?: boolean // 任意
  "enableUserThinkingControl"?: boolean // 任意
  "enableDisplayQueryMetadata"?: boolean // 任意
  "enableShareConversation"?: boolean // 任意
  "enableLocation"?: boolean // 任意
  "enableShowPoweredBy"?: boolean // 任意
  "poweredByLogo"?: string (uri) // 任意
  "enableAnonymous"?: boolean // 任意
  "enableDisplayPreviousConversation"?: boolean // 任意
  "enableDisplayConversationHistory"?: boolean // 任意
  "enableConversationTimer"?: boolean // 任意
  "conversationTimerDuration"?: integer // タイマーのタイムアウト時間。範囲は 3〜60 分です (任意)
  "enableAutoNewConversationOnTimeout"?: boolean // 任意
  "enableThemeModeToggle"?: boolean // 任意
  "enableDisplayFontSizeSwitch"?: boolean // 任意
  "defaultThemeMode"?:  // 任意
  {
  }
  "enableDownloadCitations"?: boolean // 任意
  "customDomain"?:  // 任意
  {
    "domain": string
  }
  "enableDisplayChatbotAvatar"?: boolean // 任意
  "enableDisplayChatbotName"?: boolean // 任意
  "enableVoiceAgent"?: boolean // WebChat で音声エージェント機能の利用を許可するかどうか (任意)
  "buttonIcon"?: string (uri) // 任意
}
```

**リクエストの例**

```json
{
  "avatar": "https://example.com/file.jpg",
  "logo": "https://example.com/file.jpg",
  "description": "サンプル文字列",
  "cover": "https://example.com/file.jpg",
  "backUrl": "サンプル文字列",
  "isActive": true,
  "theme": {
    "primaryColor": "サンプル文字列",
    "navbarTextColor": "サンプル文字列",
    "conversationBackgroundColor": "サンプル文字列",
    "chatbotMessageTextColor": "サンプル文字列",
    "userMessageTextColor": "サンプル文字列",
    "chatbotMessageBackgroundColor": "サンプル文字列",
    "userMessageBackgroundColor": "サンプル文字列",
    "chatbotMessageBackgroundShadowEnabled": true,
    "userMessageBackgroundShadowEnabled": true,
    "chatbotMessageGradientEnabled": true,
    "userMessageGradientEnabled": true
  },
  "darkTheme": {
    "primaryColor": "サンプル文字列",
    "navbarTextColor": "サンプル文字列",
    "conversationBackgroundColor": "サンプル文字列",
    "chatbotMessageTextColor": "サンプル文字列",
    "userMessageTextColor": "サンプル文字列",
    "chatbotMessageBackgroundColor": "サンプル文字列",
    "userMessageBackgroundColor": "サンプル文字列",
    "chatbotMessageBackgroundShadowEnabled": true,
    "userMessageBackgroundShadowEnabled": true,
    "chatbotMessageGradientEnabled": true,
    "userMessageGradientEnabled": true
  },
  "enableFileUpload": true,
  "enableDisplayCitations": true,
  "toolDisplayMode": "full",
  "enableDisplayThinking": true,
  "enableUserThinkingControl": true,
  "enableDisplayQueryMetadata": true,
  "enableShareConversation": true,
  "enableLocation": true,
  "enableShowPoweredBy": true,
  "poweredByLogo": "https://example.com/file.jpg",
  "enableAnonymous": true,
  "enableDisplayPreviousConversation": true,
  "enableDisplayConversationHistory": true,
  "enableConversationTimer": true,
  "conversationTimerDuration": 123,
  "enableAutoNewConversationOnTimeout": true,
  "enableThemeModeToggle": true,
  "enableDisplayFontSizeSwitch": true,
  "defaultThemeMode": {},
  "enableDownloadCitations": true,
  "customDomain": {
    "domain": "サンプル文字列"
  },
  "enableDisplayChatbotAvatar": true,
  "enableDisplayChatbotName": true,
  "enableVoiceAgent": true,
  "buttonIcon": "https://example.com/file.jpg"
}
```

#### コード例

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

```bash
# API 呼び出しの例 (Shell)
curl -X PUT "https://api.maiagent.ai/api/web-chats/550e8400-e29b-41d4-a716-446655440000/" \
  -H "Authorization: Api-Key YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "avatar": "https://example.com/file.jpg",
    "logo": "https://example.com/file.jpg",
    "description": "サンプル文字列",
    "cover": "https://example.com/file.jpg",
    "backUrl": "サンプル文字列",
    "isActive": true,
    "theme": {
      "primaryColor": "サンプル文字列",
      "navbarTextColor": "サンプル文字列",
      "conversationBackgroundColor": "サンプル文字列",
      "chatbotMessageTextColor": "サンプル文字列",
      "userMessageTextColor": "サンプル文字列",
      "chatbotMessageBackgroundColor": "サンプル文字列",
      "userMessageBackgroundColor": "サンプル文字列",
      "chatbotMessageBackgroundShadowEnabled": true,
      "userMessageBackgroundShadowEnabled": true,
      "chatbotMessageGradientEnabled": true,
      "userMessageGradientEnabled": true
    },
    "darkTheme": {
      "primaryColor": "サンプル文字列",
      "navbarTextColor": "サンプル文字列",
      "conversationBackgroundColor": "サンプル文字列",
      "chatbotMessageTextColor": "サンプル文字列",
      "userMessageTextColor": "サンプル文字列",
      "chatbotMessageBackgroundColor": "サンプル文字列",
      "userMessageBackgroundColor": "サンプル文字列",
      "chatbotMessageBackgroundShadowEnabled": true,
      "userMessageBackgroundShadowEnabled": true,
      "chatbotMessageGradientEnabled": true,
      "userMessageGradientEnabled": true
    },
    "enableFileUpload": true,
    "enableDisplayCitations": true,
    "toolDisplayMode": "full",
    "enableDisplayThinking": true,
    "enableUserThinkingControl": true,
    "enableDisplayQueryMetadata": true,
    "enableShareConversation": true,
    "enableLocation": true,
    "enableShowPoweredBy": true,
    "poweredByLogo": "https://example.com/file.jpg",
    "enableAnonymous": true,
    "enableDisplayPreviousConversation": true,
    "enableDisplayConversationHistory": true,
    "enableConversationTimer": true,
    "conversationTimerDuration": 123,
    "enableAutoNewConversationOnTimeout": true,
    "enableThemeModeToggle": true,
    "enableDisplayFontSizeSwitch": true,
    "defaultThemeMode": {},
    "enableDownloadCitations": true,
    "customDomain": {
      "domain": "サンプル文字列"
    },
    "enableDisplayChatbotAvatar": true,
    "enableDisplayChatbotName": true,
    "enableVoiceAgent": true,
    "buttonIcon": "https://example.com/file.jpg"
  }'

# 実行前に 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 = {
    "avatar": "https://example.com/file.jpg",
    "logo": "https://example.com/file.jpg",
    "description": "サンプル文字列",
    "cover": "https://example.com/file.jpg",
    "backUrl": "サンプル文字列",
    "isActive": true,
    "theme": {
      "primaryColor": "サンプル文字列",
      "navbarTextColor": "サンプル文字列",
      "conversationBackgroundColor": "サンプル文字列",
      "chatbotMessageTextColor": "サンプル文字列",
      "userMessageTextColor": "サンプル文字列",
      "chatbotMessageBackgroundColor": "サンプル文字列",
      "userMessageBackgroundColor": "サンプル文字列",
      "chatbotMessageBackgroundShadowEnabled": true,
      "userMessageBackgroundShadowEnabled": true,
      "chatbotMessageGradientEnabled": true,
      "userMessageGradientEnabled": true
    },
    "darkTheme": {
      "primaryColor": "サンプル文字列",
      "navbarTextColor": "サンプル文字列",
      "conversationBackgroundColor": "サンプル文字列",
      "chatbotMessageTextColor": "サンプル文字列",
      "userMessageTextColor": "サンプル文字列",
      "chatbotMessageBackgroundColor": "サンプル文字列",
      "userMessageBackgroundColor": "サンプル文字列",
      "chatbotMessageBackgroundShadowEnabled": true,
      "userMessageBackgroundShadowEnabled": true,
      "chatbotMessageGradientEnabled": true,
      "userMessageGradientEnabled": true
    },
    "enableFileUpload": true,
    "enableDisplayCitations": true,
    "toolDisplayMode": "full",
    "enableDisplayThinking": true,
    "enableUserThinkingControl": true,
    "enableDisplayQueryMetadata": true,
    "enableShareConversation": true,
    "enableLocation": true,
    "enableShowPoweredBy": true,
    "poweredByLogo": "https://example.com/file.jpg",
    "enableAnonymous": true,
    "enableDisplayPreviousConversation": true,
    "enableDisplayConversationHistory": true,
    "enableConversationTimer": true,
    "conversationTimerDuration": 123,
    "enableAutoNewConversationOnTimeout": true,
    "enableThemeModeToggle": true,
    "enableDisplayFontSizeSwitch": true,
    "defaultThemeMode": {},
    "enableDownloadCitations": true,
    "customDomain": {
      "domain": "サンプル文字列"
    },
    "enableDisplayChatbotAvatar": true,
    "enableDisplayChatbotName": true,
    "enableVoiceAgent": true,
    "buttonIcon": "https://example.com/file.jpg"
  };

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

# リクエスト内容 (payload)
data = {
      "avatar": "https://example.com/file.jpg",
      "logo": "https://example.com/file.jpg",
      "description": "サンプル文字列",
      "cover": "https://example.com/file.jpg",
      "backUrl": "サンプル文字列",
      "isActive": true,
      "theme": {
        "primaryColor": "サンプル文字列",
        "navbarTextColor": "サンプル文字列",
        "conversationBackgroundColor": "サンプル文字列",
        "chatbotMessageTextColor": "サンプル文字列",
        "userMessageTextColor": "サンプル文字列",
        "chatbotMessageBackgroundColor": "サンプル文字列",
        "userMessageBackgroundColor": "サンプル文字列",
        "chatbotMessageBackgroundShadowEnabled": true,
        "userMessageBackgroundShadowEnabled": true,
        "chatbotMessageGradientEnabled": true,
        "userMessageGradientEnabled": true
      },
      "darkTheme": {
        "primaryColor": "サンプル文字列",
        "navbarTextColor": "サンプル文字列",
        "conversationBackgroundColor": "サンプル文字列",
        "chatbotMessageTextColor": "サンプル文字列",
        "userMessageTextColor": "サンプル文字列",
        "chatbotMessageBackgroundColor": "サンプル文字列",
        "userMessageBackgroundColor": "サンプル文字列",
        "chatbotMessageBackgroundShadowEnabled": true,
        "userMessageBackgroundShadowEnabled": true,
        "chatbotMessageGradientEnabled": true,
        "userMessageGradientEnabled": true
      },
      "enableFileUpload": true,
      "enableDisplayCitations": true,
      "toolDisplayMode": "full",
      "enableDisplayThinking": true,
      "enableUserThinkingControl": true,
      "enableDisplayQueryMetadata": true,
      "enableShareConversation": true,
      "enableLocation": true,
      "enableShowPoweredBy": true,
      "poweredByLogo": "https://example.com/file.jpg",
      "enableAnonymous": true,
      "enableDisplayPreviousConversation": true,
      "enableDisplayConversationHistory": true,
      "enableConversationTimer": true,
      "conversationTimerDuration": 123,
      "enableAutoNewConversationOnTimeout": true,
      "enableThemeModeToggle": true,
      "enableDisplayFontSizeSwitch": true,
      "defaultThemeMode": {},
      "enableDownloadCitations": true,
      "customDomain": {
        "domain": "サンプル文字列"
      },
      "enableDisplayChatbotAvatar": true,
      "enableDisplayChatbotName": true,
      "enableVoiceAgent": true,
      "buttonIcon": "https://example.com/file.jpg"
    }

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/web-chats/550e8400-e29b-41d4-a716-446655440000/", [
        'headers' => [
            'Authorization' => 'Api-Key YOUR_API_KEY',
            'Content-Type' => 'application/json'
        ],
        'json' => {
            "avatar": "https://example.com/file.jpg",
            "logo": "https://example.com/file.jpg",
            "description": "サンプル文字列",
            "cover": "https://example.com/file.jpg",
            "backUrl": "サンプル文字列",
            "isActive": true,
            "theme": {
                "primaryColor": "サンプル文字列",
                "navbarTextColor": "サンプル文字列",
                "conversationBackgroundColor": "サンプル文字列",
                "chatbotMessageTextColor": "サンプル文字列",
                "userMessageTextColor": "サンプル文字列",
                "chatbotMessageBackgroundColor": "サンプル文字列",
                "userMessageBackgroundColor": "サンプル文字列",
                "chatbotMessageBackgroundShadowEnabled": true,
                "userMessageBackgroundShadowEnabled": true,
                "chatbotMessageGradientEnabled": true,
                "userMessageGradientEnabled": true
            },
            "darkTheme": {
                "primaryColor": "サンプル文字列",
                "navbarTextColor": "サンプル文字列",
                "conversationBackgroundColor": "サンプル文字列",
                "chatbotMessageTextColor": "サンプル文字列",
                "userMessageTextColor": "サンプル文字列",
                "chatbotMessageBackgroundColor": "サンプル文字列",
                "userMessageBackgroundColor": "サンプル文字列",
                "chatbotMessageBackgroundShadowEnabled": true,
                "userMessageBackgroundShadowEnabled": true,
                "chatbotMessageGradientEnabled": true,
                "userMessageGradientEnabled": true
            },
            "enableFileUpload": true,
            "enableDisplayCitations": true,
            "toolDisplayMode": "full",
            "enableDisplayThinking": true,
            "enableUserThinkingControl": true,
            "enableDisplayQueryMetadata": true,
            "enableShareConversation": true,
            "enableLocation": true,
            "enableShowPoweredBy": true,
            "poweredByLogo": "https://example.com/file.jpg",
            "enableAnonymous": true,
            "enableDisplayPreviousConversation": true,
            "enableDisplayConversationHistory": true,
            "enableConversationTimer": true,
            "conversationTimerDuration": 123,
            "enableAutoNewConversationOnTimeout": true,
            "enableThemeModeToggle": true,
            "enableDisplayFontSizeSwitch": true,
            "defaultThemeMode": {},
            "enableDownloadCitations": true,
            "customDomain": {
                "domain": "サンプル文字列"
            },
            "enableDisplayChatbotAvatar": true,
            "enableDisplayChatbotName": true,
            "enableVoiceAgent": true,
            "buttonIcon": "https://example.com/file.jpg"
        }
    ]);
    
    $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
  "avatar"?: string (uri) // 任意
  "logo"?: string (uri) // 任意
  "description"?: string // 任意
  "cover"?: string (uri) // 任意
  "backUrl"?: string // 任意
  "isActive"?: boolean // 任意
  "enableSpeech": boolean
  "displayConversationStarters": [
    string
  ]
  "theme": {
  {
    "primaryColor"?: string // 任意
    "navbarTextColor"?: string // 任意
    "conversationBackgroundColor"?: string // 任意
    "chatbotMessageTextColor"?: string // 任意
    "userMessageTextColor"?: string // 任意
    "chatbotMessageBackgroundColor"?: string // 任意
    "userMessageBackgroundColor"?: string // 任意
    "chatbotMessageBackgroundShadowEnabled"?: boolean // 任意
    "userMessageBackgroundShadowEnabled"?: boolean // 任意
    "chatbotMessageGradientEnabled"?: boolean // 任意
    "userMessageGradientEnabled"?: boolean // 任意
  }
  }
  "darkTheme": {
  {
    "primaryColor"?: string // 任意
    "navbarTextColor"?: string // 任意
    "conversationBackgroundColor"?: string // 任意
    "chatbotMessageTextColor"?: string // 任意
    "userMessageTextColor"?: string // 任意
    "chatbotMessageBackgroundColor"?: string // 任意
    "userMessageBackgroundColor"?: string // 任意
    "chatbotMessageBackgroundShadowEnabled"?: boolean // 任意
    "userMessageBackgroundShadowEnabled"?: boolean // 任意
    "chatbotMessageGradientEnabled"?: boolean // 任意
    "userMessageGradientEnabled"?: boolean // 任意
  }
  }
  "enableFileUpload"?: boolean // 任意
  "enableDisplayCitations"?: boolean // 任意
  "toolDisplayMode"?: string (enum: full, compact, hidden) // * `full` - Full
* `compact` - Compact
* `hidden` - Hidden (任意)
  "enableDisplayThinking"?: boolean // 任意
  "enableUserThinkingControl"?: boolean // 任意
  "enableDisplayQueryMetadata"?: boolean // 任意
  "enableShareConversation"?: boolean // 任意
  "enableLocation"?: boolean // 任意
  "enableShowPoweredBy"?: boolean // 任意
  "poweredByLogo"?: string (uri) // 任意
  "enableAnonymous"?: boolean // 任意
  "enableDisplayPreviousConversation"?: boolean // 任意
  "enableDisplayConversationHistory"?: boolean // 任意
  "enableConversationTimer"?: boolean // 任意
  "conversationTimerDuration"?: integer // タイマーのタイムアウト時間。範囲は 3〜60 分です (任意)
  "enableAutoNewConversationOnTimeout"?: boolean // 任意
  "accessType": 
  {
  }
  "enableThemeModeToggle"?: boolean // 任意
  "enableDisplayFontSizeSwitch"?: boolean // 任意
  "defaultThemeMode"?:  // 任意
  {
  }
  "enableDownloadCitations"?: boolean // 任意
  "customDomain"?:  // 任意
  {
    "id": string (uuid)
    "domain": string
    "status": 
    {
    }
  }
  "enableDisplayChatbotAvatar"?: boolean // 任意
  "enableDisplayChatbotName"?: boolean // 任意
  "enableVoiceAgent"?: boolean // WebChat で音声エージェント機能の利用を許可するかどうか (任意)
  "buttonIcon"?: string (uri) // 任意
  "inbox": object
}
```

**レスポンスの例**

```json
{
  "id": "550e8400-e29b-41d4-a716-446655440000",
  "name": "レスポンス文字列",
  "avatar": "https://example.com/file.jpg",
  "logo": "https://example.com/file.jpg",
  "description": "レスポンス文字列",
  "cover": "https://example.com/file.jpg",
  "backUrl": "レスポンス文字列",
  "isActive": false,
  "enableSpeech": false,
  "displayConversationStarters": [
    "レスポンス文字列"
  ],
  "theme": {
    "primaryColor": "レスポンス文字列",
    "navbarTextColor": "レスポンス文字列",
    "conversationBackgroundColor": "レスポンス文字列",
    "chatbotMessageTextColor": "レスポンス文字列",
    "userMessageTextColor": "レスポンス文字列",
    "chatbotMessageBackgroundColor": "レスポンス文字列",
    "userMessageBackgroundColor": "レスポンス文字列",
    "chatbotMessageBackgroundShadowEnabled": false,
    "userMessageBackgroundShadowEnabled": false,
    "chatbotMessageGradientEnabled": false,
    "userMessageGradientEnabled": false
  },
  "darkTheme": {
    "primaryColor": "レスポンス文字列",
    "navbarTextColor": "レスポンス文字列",
    "conversationBackgroundColor": "レスポンス文字列",
    "chatbotMessageTextColor": "レスポンス文字列",
    "userMessageTextColor": "レスポンス文字列",
    "chatbotMessageBackgroundColor": "レスポンス文字列",
    "userMessageBackgroundColor": "レスポンス文字列",
    "chatbotMessageBackgroundShadowEnabled": false,
    "userMessageBackgroundShadowEnabled": false,
    "chatbotMessageGradientEnabled": false,
    "userMessageGradientEnabled": false
  },
  "enableFileUpload": false,
  "enableDisplayCitations": false,
  "toolDisplayMode": "full",
  "enableDisplayThinking": false,
  "enableUserThinkingControl": false,
  "enableDisplayQueryMetadata": false,
  "enableShareConversation": false,
  "enableLocation": false,
  "enableShowPoweredBy": false,
  "poweredByLogo": "https://example.com/file.jpg",
  "enableAnonymous": false,
  "enableDisplayPreviousConversation": false,
  "enableDisplayConversationHistory": false,
  "enableConversationTimer": false,
  "conversationTimerDuration": 456,
  "enableAutoNewConversationOnTimeout": false,
  "accessType": {},
  "enableThemeModeToggle": false,
  "enableDisplayFontSizeSwitch": false,
  "defaultThemeMode": {},
  "enableDownloadCitations": false,
  "customDomain": {
    "id": "550e8400-e29b-41d4-a716-446655440000",
    "domain": "レスポンス文字列",
    "status": {}
  },
  "enableDisplayChatbotAvatar": false,
  "enableDisplayChatbotName": false,
  "enableVoiceAgent": false,
  "buttonIcon": "https://example.com/file.jpg",
  "inbox": {
    "id": "550e8400-e29b-41d4-a716-446655440000",
    "name": "レスポンス例の名前",
    "description": "レスポンス例の説明"
  }
}
```

***

### Web Chat の部分更新 <a href="#web-chat" id="web-chat"></a>

PATCH `/api/v1/web-chats/{id}/`

#### パラメータ

| パラメータ名 | 必須 | 型      | 説明                                       |
| ------ | -- | ------ | ---------------------------------------- |
| `id`   | ✅  | string | A UUID string identifying this web chat. |

#### リクエスト内容

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

| フィールド                                           | 型                                          | 必須  | 説明                                                    |
| ----------------------------------------------- | ------------------------------------------ | --- | ----------------------------------------------------- |
| avatar                                          | string (uri)                               | いいえ |                                                       |
| logo                                            | string (uri)                               | いいえ |                                                       |
| description                                     | string                                     | いいえ |                                                       |
| cover                                           | string (uri)                               | いいえ |                                                       |
| backUrl                                         | string                                     | いいえ |                                                       |
| isActive                                        | boolean                                    | いいえ |                                                       |
| theme                                           | object                                     | いいえ |                                                       |
| theme.primaryColor                              | string                                     | いいえ |                                                       |
| theme.navbarTextColor                           | string                                     | いいえ |                                                       |
| theme.conversationBackgroundColor               | string                                     | いいえ |                                                       |
| theme.chatbotMessageTextColor                   | string                                     | いいえ |                                                       |
| theme.userMessageTextColor                      | string                                     | いいえ |                                                       |
| theme.chatbotMessageBackgroundColor             | string                                     | いいえ |                                                       |
| theme.userMessageBackgroundColor                | string                                     | いいえ |                                                       |
| theme.chatbotMessageBackgroundShadowEnabled     | boolean                                    | いいえ |                                                       |
| theme.userMessageBackgroundShadowEnabled        | boolean                                    | いいえ |                                                       |
| theme.chatbotMessageGradientEnabled             | boolean                                    | いいえ |                                                       |
| theme.userMessageGradientEnabled                | boolean                                    | いいえ |                                                       |
| darkTheme                                       | object                                     | いいえ |                                                       |
| darkTheme.primaryColor                          | string                                     | いいえ |                                                       |
| darkTheme.navbarTextColor                       | string                                     | いいえ |                                                       |
| darkTheme.conversationBackgroundColor           | string                                     | いいえ |                                                       |
| darkTheme.chatbotMessageTextColor               | string                                     | いいえ |                                                       |
| darkTheme.userMessageTextColor                  | string                                     | いいえ |                                                       |
| darkTheme.chatbotMessageBackgroundColor         | string                                     | いいえ |                                                       |
| darkTheme.userMessageBackgroundColor            | string                                     | いいえ |                                                       |
| darkTheme.chatbotMessageBackgroundShadowEnabled | boolean                                    | いいえ |                                                       |
| darkTheme.userMessageBackgroundShadowEnabled    | boolean                                    | いいえ |                                                       |
| darkTheme.chatbotMessageGradientEnabled         | boolean                                    | いいえ |                                                       |
| darkTheme.userMessageGradientEnabled            | boolean                                    | いいえ |                                                       |
| enableFileUpload                                | boolean                                    | いいえ |                                                       |
| enableDisplayCitations                          | boolean                                    | いいえ |                                                       |
| toolDisplayMode                                 | string (enum: full, compact, hidden)       | いいえ | `full`: Full ; `compact`: Compact ; `hidden`: Hidden; |
| enableDisplayThinking                           | boolean                                    | いいえ |                                                       |
| enableUserThinkingControl                       | boolean                                    | いいえ |                                                       |
| enableDisplayQueryMetadata                      | boolean                                    | いいえ |                                                       |
| enableShareConversation                         | boolean                                    | いいえ |                                                       |
| enableLocation                                  | boolean                                    | いいえ |                                                       |
| enableShowPoweredBy                             | boolean                                    | いいえ |                                                       |
| poweredByLogo                                   | string (uri)                               | いいえ |                                                       |
| enableAnonymous                                 | boolean                                    | いいえ |                                                       |
| enableDisplayPreviousConversation               | boolean                                    | いいえ |                                                       |
| enableDisplayConversationHistory                | boolean                                    | いいえ |                                                       |
| enableConversationTimer                         | boolean                                    | いいえ |                                                       |
| conversationTimerDuration                       | integer                                    | いいえ | タイマーのタイムアウト時間。範囲は 3〜60 分です                            |
| enableAutoNewConversationOnTimeout              | boolean                                    | いいえ |                                                       |
| enableThemeModeToggle                           | boolean                                    | いいえ |                                                       |
| enableDisplayFontSizeSwitch                     | boolean                                    | いいえ |                                                       |
| defaultThemeMode                                | object                                     | いいえ |                                                       |
| enableDownloadCitations                         | boolean                                    | いいえ |                                                       |
| customDomain                                    | object (3 個のプロパティ: id, domain, status を含む) | いいえ |                                                       |
| customDomain.domain                             | string                                     | はい  |                                                       |
| enableDisplayChatbotAvatar                      | boolean                                    | いいえ |                                                       |
| enableDisplayChatbotName                        | boolean                                    | いいえ |                                                       |
| enableVoiceAgent                                | boolean                                    | いいえ | WebChat で音声エージェント機能の利用を許可するかどうか                       |
| buttonIcon                                      | string (uri)                               | いいえ |                                                       |

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

```typescript
{
  "avatar"?: string (uri) // 任意
  "logo"?: string (uri) // 任意
  "description"?: string // 任意
  "cover"?: string (uri) // 任意
  "backUrl"?: string // 任意
  "isActive"?: boolean // 任意
  "theme"?: { // 任意
  {
    "primaryColor"?: string // 任意
    "navbarTextColor"?: string // 任意
    "conversationBackgroundColor"?: string // 任意
    "chatbotMessageTextColor"?: string // 任意
    "userMessageTextColor"?: string // 任意
    "chatbotMessageBackgroundColor"?: string // 任意
    "userMessageBackgroundColor"?: string // 任意
    "chatbotMessageBackgroundShadowEnabled"?: boolean // 任意
    "userMessageBackgroundShadowEnabled"?: boolean // 任意
    "chatbotMessageGradientEnabled"?: boolean // 任意
    "userMessageGradientEnabled"?: boolean // 任意
  }
  }
  "darkTheme"?: { // 任意
  {
    "primaryColor"?: string // 任意
    "navbarTextColor"?: string // 任意
    "conversationBackgroundColor"?: string // 任意
    "chatbotMessageTextColor"?: string // 任意
    "userMessageTextColor"?: string // 任意
    "chatbotMessageBackgroundColor"?: string // 任意
    "userMessageBackgroundColor"?: string // 任意
    "chatbotMessageBackgroundShadowEnabled"?: boolean // 任意
    "userMessageBackgroundShadowEnabled"?: boolean // 任意
    "chatbotMessageGradientEnabled"?: boolean // 任意
    "userMessageGradientEnabled"?: boolean // 任意
  }
  }
  "enableFileUpload"?: boolean // 任意
  "enableDisplayCitations"?: boolean // 任意
  "toolDisplayMode"?: string (enum: full, compact, hidden) // * `full` - Full
* `compact` - Compact
* `hidden` - Hidden (任意)
  "enableDisplayThinking"?: boolean // 任意
  "enableUserThinkingControl"?: boolean // 任意
  "enableDisplayQueryMetadata"?: boolean // 任意
  "enableShareConversation"?: boolean // 任意
  "enableLocation"?: boolean // 任意
  "enableShowPoweredBy"?: boolean // 任意
  "poweredByLogo"?: string (uri) // 任意
  "enableAnonymous"?: boolean // 任意
  "enableDisplayPreviousConversation"?: boolean // 任意
  "enableDisplayConversationHistory"?: boolean // 任意
  "enableConversationTimer"?: boolean // 任意
  "conversationTimerDuration"?: integer // タイマーのタイムアウト時間。範囲は 3〜60 分です (任意)
  "enableAutoNewConversationOnTimeout"?: boolean // 任意
  "enableThemeModeToggle"?: boolean // 任意
  "enableDisplayFontSizeSwitch"?: boolean // 任意
  "defaultThemeMode"?:  // 任意
  {
  }
  "enableDownloadCitations"?: boolean // 任意
  "customDomain"?:  // 任意
  {
    "domain": string
  }
  "enableDisplayChatbotAvatar"?: boolean // 任意
  "enableDisplayChatbotName"?: boolean // 任意
  "enableVoiceAgent"?: boolean // WebChat で音声エージェント機能の利用を許可するかどうか (任意)
  "buttonIcon"?: string (uri) // 任意
}
```

**リクエストの例**

```json
{
  "avatar": "https://example.com/file.jpg",
  "logo": "https://example.com/file.jpg",
  "description": "サンプル文字列",
  "cover": "https://example.com/file.jpg",
  "backUrl": "サンプル文字列",
  "isActive": true,
  "theme": {
    "primaryColor": "サンプル文字列",
    "navbarTextColor": "サンプル文字列",
    "conversationBackgroundColor": "サンプル文字列",
    "chatbotMessageTextColor": "サンプル文字列",
    "userMessageTextColor": "サンプル文字列",
    "chatbotMessageBackgroundColor": "サンプル文字列",
    "userMessageBackgroundColor": "サンプル文字列",
    "chatbotMessageBackgroundShadowEnabled": true,
    "userMessageBackgroundShadowEnabled": true,
    "chatbotMessageGradientEnabled": true,
    "userMessageGradientEnabled": true
  },
  "darkTheme": {
    "primaryColor": "サンプル文字列",
    "navbarTextColor": "サンプル文字列",
    "conversationBackgroundColor": "サンプル文字列",
    "chatbotMessageTextColor": "サンプル文字列",
    "userMessageTextColor": "サンプル文字列",
    "chatbotMessageBackgroundColor": "サンプル文字列",
    "userMessageBackgroundColor": "サンプル文字列",
    "chatbotMessageBackgroundShadowEnabled": true,
    "userMessageBackgroundShadowEnabled": true,
    "chatbotMessageGradientEnabled": true,
    "userMessageGradientEnabled": true
  },
  "enableFileUpload": true,
  "enableDisplayCitations": true,
  "toolDisplayMode": "full",
  "enableDisplayThinking": true,
  "enableUserThinkingControl": true,
  "enableDisplayQueryMetadata": true,
  "enableShareConversation": true,
  "enableLocation": true,
  "enableShowPoweredBy": true,
  "poweredByLogo": "https://example.com/file.jpg",
  "enableAnonymous": true,
  "enableDisplayPreviousConversation": true,
  "enableDisplayConversationHistory": true,
  "enableConversationTimer": true,
  "conversationTimerDuration": 123,
  "enableAutoNewConversationOnTimeout": true,
  "enableThemeModeToggle": true,
  "enableDisplayFontSizeSwitch": true,
  "defaultThemeMode": {},
  "enableDownloadCitations": true,
  "customDomain": {
    "domain": "サンプル文字列"
  },
  "enableDisplayChatbotAvatar": true,
  "enableDisplayChatbotName": true,
  "enableVoiceAgent": true,
  "buttonIcon": "https://example.com/file.jpg"
}
```

#### コード例

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

```bash
# API 呼び出しの例 (Shell)
curl -X PATCH "https://api.maiagent.ai/api/v1/web-chats/550e8400-e29b-41d4-a716-446655440000/" \
  -H "Authorization: Api-Key YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "avatar": "https://example.com/file.jpg",
    "logo": "https://example.com/file.jpg",
    "description": "サンプル文字列",
    "cover": "https://example.com/file.jpg",
    "backUrl": "サンプル文字列",
    "isActive": true,
    "theme": {
      "primaryColor": "サンプル文字列",
      "navbarTextColor": "サンプル文字列",
      "conversationBackgroundColor": "サンプル文字列",
      "chatbotMessageTextColor": "サンプル文字列",
      "userMessageTextColor": "サンプル文字列",
      "chatbotMessageBackgroundColor": "サンプル文字列",
      "userMessageBackgroundColor": "サンプル文字列",
      "chatbotMessageBackgroundShadowEnabled": true,
      "userMessageBackgroundShadowEnabled": true,
      "chatbotMessageGradientEnabled": true,
      "userMessageGradientEnabled": true
    },
    "darkTheme": {
      "primaryColor": "サンプル文字列",
      "navbarTextColor": "サンプル文字列",
      "conversationBackgroundColor": "サンプル文字列",
      "chatbotMessageTextColor": "サンプル文字列",
      "userMessageTextColor": "サンプル文字列",
      "chatbotMessageBackgroundColor": "サンプル文字列",
      "userMessageBackgroundColor": "サンプル文字列",
      "chatbotMessageBackgroundShadowEnabled": true,
      "userMessageBackgroundShadowEnabled": true,
      "chatbotMessageGradientEnabled": true,
      "userMessageGradientEnabled": true
    },
    "enableFileUpload": true,
    "enableDisplayCitations": true,
    "toolDisplayMode": "full",
    "enableDisplayThinking": true,
    "enableUserThinkingControl": true,
    "enableDisplayQueryMetadata": true,
    "enableShareConversation": true,
    "enableLocation": true,
    "enableShowPoweredBy": true,
    "poweredByLogo": "https://example.com/file.jpg",
    "enableAnonymous": true,
    "enableDisplayPreviousConversation": true,
    "enableDisplayConversationHistory": true,
    "enableConversationTimer": true,
    "conversationTimerDuration": 123,
    "enableAutoNewConversationOnTimeout": true,
    "enableThemeModeToggle": true,
    "enableDisplayFontSizeSwitch": true,
    "defaultThemeMode": {},
    "enableDownloadCitations": true,
    "customDomain": {
      "domain": "サンプル文字列"
    },
    "enableDisplayChatbotAvatar": true,
    "enableDisplayChatbotName": true,
    "enableVoiceAgent": true,
    "buttonIcon": "https://example.com/file.jpg"
  }'

# 実行前に 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 = {
    "avatar": "https://example.com/file.jpg",
    "logo": "https://example.com/file.jpg",
    "description": "サンプル文字列",
    "cover": "https://example.com/file.jpg",
    "backUrl": "サンプル文字列",
    "isActive": true,
    "theme": {
      "primaryColor": "サンプル文字列",
      "navbarTextColor": "サンプル文字列",
      "conversationBackgroundColor": "サンプル文字列",
      "chatbotMessageTextColor": "サンプル文字列",
      "userMessageTextColor": "サンプル文字列",
      "chatbotMessageBackgroundColor": "サンプル文字列",
      "userMessageBackgroundColor": "サンプル文字列",
      "chatbotMessageBackgroundShadowEnabled": true,
      "userMessageBackgroundShadowEnabled": true,
      "chatbotMessageGradientEnabled": true,
      "userMessageGradientEnabled": true
    },
    "darkTheme": {
      "primaryColor": "サンプル文字列",
      "navbarTextColor": "サンプル文字列",
      "conversationBackgroundColor": "サンプル文字列",
      "chatbotMessageTextColor": "サンプル文字列",
      "userMessageTextColor": "サンプル文字列",
      "chatbotMessageBackgroundColor": "サンプル文字列",
      "userMessageBackgroundColor": "サンプル文字列",
      "chatbotMessageBackgroundShadowEnabled": true,
      "userMessageBackgroundShadowEnabled": true,
      "chatbotMessageGradientEnabled": true,
      "userMessageGradientEnabled": true
    },
    "enableFileUpload": true,
    "enableDisplayCitations": true,
    "toolDisplayMode": "full",
    "enableDisplayThinking": true,
    "enableUserThinkingControl": true,
    "enableDisplayQueryMetadata": true,
    "enableShareConversation": true,
    "enableLocation": true,
    "enableShowPoweredBy": true,
    "poweredByLogo": "https://example.com/file.jpg",
    "enableAnonymous": true,
    "enableDisplayPreviousConversation": true,
    "enableDisplayConversationHistory": true,
    "enableConversationTimer": true,
    "conversationTimerDuration": 123,
    "enableAutoNewConversationOnTimeout": true,
    "enableThemeModeToggle": true,
    "enableDisplayFontSizeSwitch": true,
    "defaultThemeMode": {},
    "enableDownloadCitations": true,
    "customDomain": {
      "domain": "サンプル文字列"
    },
    "enableDisplayChatbotAvatar": true,
    "enableDisplayChatbotName": true,
    "enableVoiceAgent": true,
    "buttonIcon": "https://example.com/file.jpg"
  };

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

# リクエスト内容 (payload)
data = {
      "avatar": "https://example.com/file.jpg",
      "logo": "https://example.com/file.jpg",
      "description": "サンプル文字列",
      "cover": "https://example.com/file.jpg",
      "backUrl": "サンプル文字列",
      "isActive": true,
      "theme": {
        "primaryColor": "サンプル文字列",
        "navbarTextColor": "サンプル文字列",
        "conversationBackgroundColor": "サンプル文字列",
        "chatbotMessageTextColor": "サンプル文字列",
        "userMessageTextColor": "サンプル文字列",
        "chatbotMessageBackgroundColor": "サンプル文字列",
        "userMessageBackgroundColor": "サンプル文字列",
        "chatbotMessageBackgroundShadowEnabled": true,
        "userMessageBackgroundShadowEnabled": true,
        "chatbotMessageGradientEnabled": true,
        "userMessageGradientEnabled": true
      },
      "darkTheme": {
        "primaryColor": "サンプル文字列",
        "navbarTextColor": "サンプル文字列",
        "conversationBackgroundColor": "サンプル文字列",
        "chatbotMessageTextColor": "サンプル文字列",
        "userMessageTextColor": "サンプル文字列",
        "chatbotMessageBackgroundColor": "サンプル文字列",
        "userMessageBackgroundColor": "サンプル文字列",
        "chatbotMessageBackgroundShadowEnabled": true,
        "userMessageBackgroundShadowEnabled": true,
        "chatbotMessageGradientEnabled": true,
        "userMessageGradientEnabled": true
      },
      "enableFileUpload": true,
      "enableDisplayCitations": true,
      "toolDisplayMode": "full",
      "enableDisplayThinking": true,
      "enableUserThinkingControl": true,
      "enableDisplayQueryMetadata": true,
      "enableShareConversation": true,
      "enableLocation": true,
      "enableShowPoweredBy": true,
      "poweredByLogo": "https://example.com/file.jpg",
      "enableAnonymous": true,
      "enableDisplayPreviousConversation": true,
      "enableDisplayConversationHistory": true,
      "enableConversationTimer": true,
      "conversationTimerDuration": 123,
      "enableAutoNewConversationOnTimeout": true,
      "enableThemeModeToggle": true,
      "enableDisplayFontSizeSwitch": true,
      "defaultThemeMode": {},
      "enableDownloadCitations": true,
      "customDomain": {
        "domain": "サンプル文字列"
      },
      "enableDisplayChatbotAvatar": true,
      "enableDisplayChatbotName": true,
      "enableVoiceAgent": true,
      "buttonIcon": "https://example.com/file.jpg"
    }

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/web-chats/550e8400-e29b-41d4-a716-446655440000/", [
        'headers' => [
            'Authorization' => 'Api-Key YOUR_API_KEY',
            'Content-Type' => 'application/json'
        ],
        'json' => {
            "avatar": "https://example.com/file.jpg",
            "logo": "https://example.com/file.jpg",
            "description": "サンプル文字列",
            "cover": "https://example.com/file.jpg",
            "backUrl": "サンプル文字列",
            "isActive": true,
            "theme": {
                "primaryColor": "サンプル文字列",
                "navbarTextColor": "サンプル文字列",
                "conversationBackgroundColor": "サンプル文字列",
                "chatbotMessageTextColor": "サンプル文字列",
                "userMessageTextColor": "サンプル文字列",
                "chatbotMessageBackgroundColor": "サンプル文字列",
                "userMessageBackgroundColor": "サンプル文字列",
                "chatbotMessageBackgroundShadowEnabled": true,
                "userMessageBackgroundShadowEnabled": true,
                "chatbotMessageGradientEnabled": true,
                "userMessageGradientEnabled": true
            },
            "darkTheme": {
                "primaryColor": "サンプル文字列",
                "navbarTextColor": "サンプル文字列",
                "conversationBackgroundColor": "サンプル文字列",
                "chatbotMessageTextColor": "サンプル文字列",
                "userMessageTextColor": "サンプル文字列",
                "chatbotMessageBackgroundColor": "サンプル文字列",
                "userMessageBackgroundColor": "サンプル文字列",
                "chatbotMessageBackgroundShadowEnabled": true,
                "userMessageBackgroundShadowEnabled": true,
                "chatbotMessageGradientEnabled": true,
                "userMessageGradientEnabled": true
            },
            "enableFileUpload": true,
            "enableDisplayCitations": true,
            "toolDisplayMode": "full",
            "enableDisplayThinking": true,
            "enableUserThinkingControl": true,
            "enableDisplayQueryMetadata": true,
            "enableShareConversation": true,
            "enableLocation": true,
            "enableShowPoweredBy": true,
            "poweredByLogo": "https://example.com/file.jpg",
            "enableAnonymous": true,
            "enableDisplayPreviousConversation": true,
            "enableDisplayConversationHistory": true,
            "enableConversationTimer": true,
            "conversationTimerDuration": 123,
            "enableAutoNewConversationOnTimeout": true,
            "enableThemeModeToggle": true,
            "enableDisplayFontSizeSwitch": true,
            "defaultThemeMode": {},
            "enableDownloadCitations": true,
            "customDomain": {
                "domain": "サンプル文字列"
            },
            "enableDisplayChatbotAvatar": true,
            "enableDisplayChatbotName": true,
            "enableVoiceAgent": true,
            "buttonIcon": "https://example.com/file.jpg"
        }
    ]);
    
    $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
  "avatar"?: string (uri) // 任意
  "logo"?: string (uri) // 任意
  "description"?: string // 任意
  "cover"?: string (uri) // 任意
  "backUrl"?: string // 任意
  "isActive"?: boolean // 任意
  "enableSpeech": boolean
  "displayConversationStarters": [
    string
  ]
  "theme": {
  {
    "primaryColor"?: string // 任意
    "navbarTextColor"?: string // 任意
    "conversationBackgroundColor"?: string // 任意
    "chatbotMessageTextColor"?: string // 任意
    "userMessageTextColor"?: string // 任意
    "chatbotMessageBackgroundColor"?: string // 任意
    "userMessageBackgroundColor"?: string // 任意
    "chatbotMessageBackgroundShadowEnabled"?: boolean // 任意
    "userMessageBackgroundShadowEnabled"?: boolean // 任意
    "chatbotMessageGradientEnabled"?: boolean // 任意
    "userMessageGradientEnabled"?: boolean // 任意
  }
  }
  "darkTheme": {
  {
    "primaryColor"?: string // 任意
    "navbarTextColor"?: string // 任意
    "conversationBackgroundColor"?: string // 任意
    "chatbotMessageTextColor"?: string // 任意
    "userMessageTextColor"?: string // 任意
    "chatbotMessageBackgroundColor"?: string // 任意
    "userMessageBackgroundColor"?: string // 任意
    "chatbotMessageBackgroundShadowEnabled"?: boolean // 任意
    "userMessageBackgroundShadowEnabled"?: boolean // 任意
    "chatbotMessageGradientEnabled"?: boolean // 任意
    "userMessageGradientEnabled"?: boolean // 任意
  }
  }
  "enableFileUpload"?: boolean // 任意
  "enableDisplayCitations"?: boolean // 任意
  "toolDisplayMode"?: string (enum: full, compact, hidden) // * `full` - Full
* `compact` - Compact
* `hidden` - Hidden (任意)
  "enableDisplayThinking"?: boolean // 任意
  "enableUserThinkingControl"?: boolean // 任意
  "enableDisplayQueryMetadata"?: boolean // 任意
  "enableShareConversation"?: boolean // 任意
  "enableLocation"?: boolean // 任意
  "enableShowPoweredBy"?: boolean // 任意
  "poweredByLogo"?: string (uri) // 任意
  "enableAnonymous"?: boolean // 任意
  "enableDisplayPreviousConversation"?: boolean // 任意
  "enableDisplayConversationHistory"?: boolean // 任意
  "enableConversationTimer"?: boolean // 任意
  "conversationTimerDuration"?: integer // タイマーのタイムアウト時間。範囲は 3〜60 分です (任意)
  "enableAutoNewConversationOnTimeout"?: boolean // 任意
  "accessType": 
  {
  }
  "enableThemeModeToggle"?: boolean // 任意
  "enableDisplayFontSizeSwitch"?: boolean // 任意
  "defaultThemeMode"?:  // 任意
  {
  }
  "enableDownloadCitations"?: boolean // 任意
  "customDomain"?:  // 任意
  {
    "id": string (uuid)
    "domain": string
    "status": 
    {
    }
  }
  "enableDisplayChatbotAvatar"?: boolean // 任意
  "enableDisplayChatbotName"?: boolean // 任意
  "enableVoiceAgent"?: boolean // WebChat で音声エージェント機能の利用を許可するかどうか (任意)
  "buttonIcon"?: string (uri) // 任意
  "inbox": object
}
```

**レスポンスの例**

```json
{
  "id": "550e8400-e29b-41d4-a716-446655440000",
  "name": "レスポンス文字列",
  "avatar": "https://example.com/file.jpg",
  "logo": "https://example.com/file.jpg",
  "description": "レスポンス文字列",
  "cover": "https://example.com/file.jpg",
  "backUrl": "レスポンス文字列",
  "isActive": false,
  "enableSpeech": false,
  "displayConversationStarters": [
    "レスポンス文字列"
  ],
  "theme": {
    "primaryColor": "レスポンス文字列",
    "navbarTextColor": "レスポンス文字列",
    "conversationBackgroundColor": "レスポンス文字列",
    "chatbotMessageTextColor": "レスポンス文字列",
    "userMessageTextColor": "レスポンス文字列",
    "chatbotMessageBackgroundColor": "レスポンス文字列",
    "userMessageBackgroundColor": "レスポンス文字列",
    "chatbotMessageBackgroundShadowEnabled": false,
    "userMessageBackgroundShadowEnabled": false,
    "chatbotMessageGradientEnabled": false,
    "userMessageGradientEnabled": false
  },
  "darkTheme": {
    "primaryColor": "レスポンス文字列",
    "navbarTextColor": "レスポンス文字列",
    "conversationBackgroundColor": "レスポンス文字列",
    "chatbotMessageTextColor": "レスポンス文字列",
    "userMessageTextColor": "レスポンス文字列",
    "chatbotMessageBackgroundColor": "レスポンス文字列",
    "userMessageBackgroundColor": "レスポンス文字列",
    "chatbotMessageBackgroundShadowEnabled": false,
    "userMessageBackgroundShadowEnabled": false,
    "chatbotMessageGradientEnabled": false,
    "userMessageGradientEnabled": false
  },
  "enableFileUpload": false,
  "enableDisplayCitations": false,
  "toolDisplayMode": "full",
  "enableDisplayThinking": false,
  "enableUserThinkingControl": false,
  "enableDisplayQueryMetadata": false,
  "enableShareConversation": false,
  "enableLocation": false,
  "enableShowPoweredBy": false,
  "poweredByLogo": "https://example.com/file.jpg",
  "enableAnonymous": false,
  "enableDisplayPreviousConversation": false,
  "enableDisplayConversationHistory": false,
  "enableConversationTimer": false,
  "conversationTimerDuration": 456,
  "enableAutoNewConversationOnTimeout": false,
  "accessType": {},
  "enableThemeModeToggle": false,
  "enableDisplayFontSizeSwitch": false,
  "defaultThemeMode": {},
  "enableDownloadCitations": false,
  "customDomain": {
    "id": "550e8400-e29b-41d4-a716-446655440000",
    "domain": "レスポンス文字列",
    "status": {}
  },
  "enableDisplayChatbotAvatar": false,
  "enableDisplayChatbotName": false,
  "enableVoiceAgent": false,
  "buttonIcon": "https://example.com/file.jpg",
  "inbox": {
    "id": "550e8400-e29b-41d4-a716-446655440000",
    "name": "レスポンス例の名前",
    "description": "レスポンス例の説明"
  }
}
```

***

### Web Chat の部分更新 <a href="#web-chat" id="web-chat"></a>

PATCH `/api/web-chats/{id}/`

#### パラメータ

| パラメータ名 | 必須 | 型      | 説明                                       |
| ------ | -- | ------ | ---------------------------------------- |
| `id`   | ✅  | string | A UUID string identifying this web chat. |

#### リクエスト内容

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

| フィールド                                           | 型                                          | 必須  | 説明                                                    |
| ----------------------------------------------- | ------------------------------------------ | --- | ----------------------------------------------------- |
| avatar                                          | string (uri)                               | いいえ |                                                       |
| logo                                            | string (uri)                               | いいえ |                                                       |
| description                                     | string                                     | いいえ |                                                       |
| cover                                           | string (uri)                               | いいえ |                                                       |
| backUrl                                         | string                                     | いいえ |                                                       |
| isActive                                        | boolean                                    | いいえ |                                                       |
| theme                                           | object                                     | いいえ |                                                       |
| theme.primaryColor                              | string                                     | いいえ |                                                       |
| theme.navbarTextColor                           | string                                     | いいえ |                                                       |
| theme.conversationBackgroundColor               | string                                     | いいえ |                                                       |
| theme.chatbotMessageTextColor                   | string                                     | いいえ |                                                       |
| theme.userMessageTextColor                      | string                                     | いいえ |                                                       |
| theme.chatbotMessageBackgroundColor             | string                                     | いいえ |                                                       |
| theme.userMessageBackgroundColor                | string                                     | いいえ |                                                       |
| theme.chatbotMessageBackgroundShadowEnabled     | boolean                                    | いいえ |                                                       |
| theme.userMessageBackgroundShadowEnabled        | boolean                                    | いいえ |                                                       |
| theme.chatbotMessageGradientEnabled             | boolean                                    | いいえ |                                                       |
| theme.userMessageGradientEnabled                | boolean                                    | いいえ |                                                       |
| darkTheme                                       | object                                     | いいえ |                                                       |
| darkTheme.primaryColor                          | string                                     | いいえ |                                                       |
| darkTheme.navbarTextColor                       | string                                     | いいえ |                                                       |
| darkTheme.conversationBackgroundColor           | string                                     | いいえ |                                                       |
| darkTheme.chatbotMessageTextColor               | string                                     | いいえ |                                                       |
| darkTheme.userMessageTextColor                  | string                                     | いいえ |                                                       |
| darkTheme.chatbotMessageBackgroundColor         | string                                     | いいえ |                                                       |
| darkTheme.userMessageBackgroundColor            | string                                     | いいえ |                                                       |
| darkTheme.chatbotMessageBackgroundShadowEnabled | boolean                                    | いいえ |                                                       |
| darkTheme.userMessageBackgroundShadowEnabled    | boolean                                    | いいえ |                                                       |
| darkTheme.chatbotMessageGradientEnabled         | boolean                                    | いいえ |                                                       |
| darkTheme.userMessageGradientEnabled            | boolean                                    | いいえ |                                                       |
| enableFileUpload                                | boolean                                    | いいえ |                                                       |
| enableDisplayCitations                          | boolean                                    | いいえ |                                                       |
| toolDisplayMode                                 | string (enum: full, compact, hidden)       | いいえ | `full`: Full ; `compact`: Compact ; `hidden`: Hidden; |
| enableDisplayThinking                           | boolean                                    | いいえ |                                                       |
| enableUserThinkingControl                       | boolean                                    | いいえ |                                                       |
| enableDisplayQueryMetadata                      | boolean                                    | いいえ |                                                       |
| enableShareConversation                         | boolean                                    | いいえ |                                                       |
| enableLocation                                  | boolean                                    | いいえ |                                                       |
| enableShowPoweredBy                             | boolean                                    | いいえ |                                                       |
| poweredByLogo                                   | string (uri)                               | いいえ |                                                       |
| enableAnonymous                                 | boolean                                    | いいえ |                                                       |
| enableDisplayPreviousConversation               | boolean                                    | いいえ |                                                       |
| enableDisplayConversationHistory                | boolean                                    | いいえ |                                                       |
| enableConversationTimer                         | boolean                                    | いいえ |                                                       |
| conversationTimerDuration                       | integer                                    | いいえ | タイマーのタイムアウト時間。範囲は 3〜60 分です                            |
| enableAutoNewConversationOnTimeout              | boolean                                    | いいえ |                                                       |
| enableThemeModeToggle                           | boolean                                    | いいえ |                                                       |
| enableDisplayFontSizeSwitch                     | boolean                                    | いいえ |                                                       |
| defaultThemeMode                                | object                                     | いいえ |                                                       |
| enableDownloadCitations                         | boolean                                    | いいえ |                                                       |
| customDomain                                    | object (3 個のプロパティ: id, domain, status を含む) | いいえ |                                                       |
| customDomain.domain                             | string                                     | はい  |                                                       |
| enableDisplayChatbotAvatar                      | boolean                                    | いいえ |                                                       |
| enableDisplayChatbotName                        | boolean                                    | いいえ |                                                       |
| enableVoiceAgent                                | boolean                                    | いいえ | WebChat で音声エージェント機能の利用を許可するかどうか                       |
| buttonIcon                                      | string (uri)                               | いいえ |                                                       |

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

```typescript
{
  "avatar"?: string (uri) // 任意
  "logo"?: string (uri) // 任意
  "description"?: string // 任意
  "cover"?: string (uri) // 任意
  "backUrl"?: string // 任意
  "isActive"?: boolean // 任意
  "theme"?: { // 任意
  {
    "primaryColor"?: string // 任意
    "navbarTextColor"?: string // 任意
    "conversationBackgroundColor"?: string // 任意
    "chatbotMessageTextColor"?: string // 任意
    "userMessageTextColor"?: string // 任意
    "chatbotMessageBackgroundColor"?: string // 任意
    "userMessageBackgroundColor"?: string // 任意
    "chatbotMessageBackgroundShadowEnabled"?: boolean // 任意
    "userMessageBackgroundShadowEnabled"?: boolean // 任意
    "chatbotMessageGradientEnabled"?: boolean // 任意
    "userMessageGradientEnabled"?: boolean // 任意
  }
  }
  "darkTheme"?: { // 任意
  {
    "primaryColor"?: string // 任意
    "navbarTextColor"?: string // 任意
    "conversationBackgroundColor"?: string // 任意
    "chatbotMessageTextColor"?: string // 任意
    "userMessageTextColor"?: string // 任意
    "chatbotMessageBackgroundColor"?: string // 任意
    "userMessageBackgroundColor"?: string // 任意
    "chatbotMessageBackgroundShadowEnabled"?: boolean // 任意
    "userMessageBackgroundShadowEnabled"?: boolean // 任意
    "chatbotMessageGradientEnabled"?: boolean // 任意
    "userMessageGradientEnabled"?: boolean // 任意
  }
  }
  "enableFileUpload"?: boolean // 任意
  "enableDisplayCitations"?: boolean // 任意
  "toolDisplayMode"?: string (enum: full, compact, hidden) // * `full` - Full
* `compact` - Compact
* `hidden` - Hidden (任意)
  "enableDisplayThinking"?: boolean // 任意
  "enableUserThinkingControl"?: boolean // 任意
  "enableDisplayQueryMetadata"?: boolean // 任意
  "enableShareConversation"?: boolean // 任意
  "enableLocation"?: boolean // 任意
  "enableShowPoweredBy"?: boolean // 任意
  "poweredByLogo"?: string (uri) // 任意
  "enableAnonymous"?: boolean // 任意
  "enableDisplayPreviousConversation"?: boolean // 任意
  "enableDisplayConversationHistory"?: boolean // 任意
  "enableConversationTimer"?: boolean // 任意
  "conversationTimerDuration"?: integer // タイマーのタイムアウト時間。範囲は 3〜60 分です (任意)
  "enableAutoNewConversationOnTimeout"?: boolean // 任意
  "enableThemeModeToggle"?: boolean // 任意
  "enableDisplayFontSizeSwitch"?: boolean // 任意
  "defaultThemeMode"?:  // 任意
  {
  }
  "enableDownloadCitations"?: boolean // 任意
  "customDomain"?:  // 任意
  {
    "domain": string
  }
  "enableDisplayChatbotAvatar"?: boolean // 任意
  "enableDisplayChatbotName"?: boolean // 任意
  "enableVoiceAgent"?: boolean // WebChat で音声エージェント機能の利用を許可するかどうか (任意)
  "buttonIcon"?: string (uri) // 任意
}
```

**リクエストの例**

```json
{
  "avatar": "https://example.com/file.jpg",
  "logo": "https://example.com/file.jpg",
  "description": "サンプル文字列",
  "cover": "https://example.com/file.jpg",
  "backUrl": "サンプル文字列",
  "isActive": true,
  "theme": {
    "primaryColor": "サンプル文字列",
    "navbarTextColor": "サンプル文字列",
    "conversationBackgroundColor": "サンプル文字列",
    "chatbotMessageTextColor": "サンプル文字列",
    "userMessageTextColor": "サンプル文字列",
    "chatbotMessageBackgroundColor": "サンプル文字列",
    "userMessageBackgroundColor": "サンプル文字列",
    "chatbotMessageBackgroundShadowEnabled": true,
    "userMessageBackgroundShadowEnabled": true,
    "chatbotMessageGradientEnabled": true,
    "userMessageGradientEnabled": true
  },
  "darkTheme": {
    "primaryColor": "サンプル文字列",
    "navbarTextColor": "サンプル文字列",
    "conversationBackgroundColor": "サンプル文字列",
    "chatbotMessageTextColor": "サンプル文字列",
    "userMessageTextColor": "サンプル文字列",
    "chatbotMessageBackgroundColor": "サンプル文字列",
    "userMessageBackgroundColor": "サンプル文字列",
    "chatbotMessageBackgroundShadowEnabled": true,
    "userMessageBackgroundShadowEnabled": true,
    "chatbotMessageGradientEnabled": true,
    "userMessageGradientEnabled": true
  },
  "enableFileUpload": true,
  "enableDisplayCitations": true,
  "toolDisplayMode": "full",
  "enableDisplayThinking": true,
  "enableUserThinkingControl": true,
  "enableDisplayQueryMetadata": true,
  "enableShareConversation": true,
  "enableLocation": true,
  "enableShowPoweredBy": true,
  "poweredByLogo": "https://example.com/file.jpg",
  "enableAnonymous": true,
  "enableDisplayPreviousConversation": true,
  "enableDisplayConversationHistory": true,
  "enableConversationTimer": true,
  "conversationTimerDuration": 123,
  "enableAutoNewConversationOnTimeout": true,
  "enableThemeModeToggle": true,
  "enableDisplayFontSizeSwitch": true,
  "defaultThemeMode": {},
  "enableDownloadCitations": true,
  "customDomain": {
    "domain": "サンプル文字列"
  },
  "enableDisplayChatbotAvatar": true,
  "enableDisplayChatbotName": true,
  "enableVoiceAgent": true,
  "buttonIcon": "https://example.com/file.jpg"
}
```

#### コード例

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

```bash
# API 呼び出しの例 (Shell)
curl -X PATCH "https://api.maiagent.ai/api/web-chats/550e8400-e29b-41d4-a716-446655440000/" \
  -H "Authorization: Api-Key YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "avatar": "https://example.com/file.jpg",
    "logo": "https://example.com/file.jpg",
    "description": "サンプル文字列",
    "cover": "https://example.com/file.jpg",
    "backUrl": "サンプル文字列",
    "isActive": true,
    "theme": {
      "primaryColor": "サンプル文字列",
      "navbarTextColor": "サンプル文字列",
      "conversationBackgroundColor": "サンプル文字列",
      "chatbotMessageTextColor": "サンプル文字列",
      "userMessageTextColor": "サンプル文字列",
      "chatbotMessageBackgroundColor": "サンプル文字列",
      "userMessageBackgroundColor": "サンプル文字列",
      "chatbotMessageBackgroundShadowEnabled": true,
      "userMessageBackgroundShadowEnabled": true,
      "chatbotMessageGradientEnabled": true,
      "userMessageGradientEnabled": true
    },
    "darkTheme": {
      "primaryColor": "サンプル文字列",
      "navbarTextColor": "サンプル文字列",
      "conversationBackgroundColor": "サンプル文字列",
      "chatbotMessageTextColor": "サンプル文字列",
      "userMessageTextColor": "サンプル文字列",
      "chatbotMessageBackgroundColor": "サンプル文字列",
      "userMessageBackgroundColor": "サンプル文字列",
      "chatbotMessageBackgroundShadowEnabled": true,
      "userMessageBackgroundShadowEnabled": true,
      "chatbotMessageGradientEnabled": true,
      "userMessageGradientEnabled": true
    },
    "enableFileUpload": true,
    "enableDisplayCitations": true,
    "toolDisplayMode": "full",
    "enableDisplayThinking": true,
    "enableUserThinkingControl": true,
    "enableDisplayQueryMetadata": true,
    "enableShareConversation": true,
    "enableLocation": true,
    "enableShowPoweredBy": true,
    "poweredByLogo": "https://example.com/file.jpg",
    "enableAnonymous": true,
    "enableDisplayPreviousConversation": true,
    "enableDisplayConversationHistory": true,
    "enableConversationTimer": true,
    "conversationTimerDuration": 123,
    "enableAutoNewConversationOnTimeout": true,
    "enableThemeModeToggle": true,
    "enableDisplayFontSizeSwitch": true,
    "defaultThemeMode": {},
    "enableDownloadCitations": true,
    "customDomain": {
      "domain": "サンプル文字列"
    },
    "enableDisplayChatbotAvatar": true,
    "enableDisplayChatbotName": true,
    "enableVoiceAgent": true,
    "buttonIcon": "https://example.com/file.jpg"
  }'

# 実行前に 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 = {
    "avatar": "https://example.com/file.jpg",
    "logo": "https://example.com/file.jpg",
    "description": "サンプル文字列",
    "cover": "https://example.com/file.jpg",
    "backUrl": "サンプル文字列",
    "isActive": true,
    "theme": {
      "primaryColor": "サンプル文字列",
      "navbarTextColor": "サンプル文字列",
      "conversationBackgroundColor": "サンプル文字列",
      "chatbotMessageTextColor": "サンプル文字列",
      "userMessageTextColor": "サンプル文字列",
      "chatbotMessageBackgroundColor": "サンプル文字列",
      "userMessageBackgroundColor": "サンプル文字列",
      "chatbotMessageBackgroundShadowEnabled": true,
      "userMessageBackgroundShadowEnabled": true,
      "chatbotMessageGradientEnabled": true,
      "userMessageGradientEnabled": true
    },
    "darkTheme": {
      "primaryColor": "サンプル文字列",
      "navbarTextColor": "サンプル文字列",
      "conversationBackgroundColor": "サンプル文字列",
      "chatbotMessageTextColor": "サンプル文字列",
      "userMessageTextColor": "サンプル文字列",
      "chatbotMessageBackgroundColor": "サンプル文字列",
      "userMessageBackgroundColor": "サンプル文字列",
      "chatbotMessageBackgroundShadowEnabled": true,
      "userMessageBackgroundShadowEnabled": true,
      "chatbotMessageGradientEnabled": true,
      "userMessageGradientEnabled": true
    },
    "enableFileUpload": true,
    "enableDisplayCitations": true,
    "toolDisplayMode": "full",
    "enableDisplayThinking": true,
    "enableUserThinkingControl": true,
    "enableDisplayQueryMetadata": true,
    "enableShareConversation": true,
    "enableLocation": true,
    "enableShowPoweredBy": true,
    "poweredByLogo": "https://example.com/file.jpg",
    "enableAnonymous": true,
    "enableDisplayPreviousConversation": true,
    "enableDisplayConversationHistory": true,
    "enableConversationTimer": true,
    "conversationTimerDuration": 123,
    "enableAutoNewConversationOnTimeout": true,
    "enableThemeModeToggle": true,
    "enableDisplayFontSizeSwitch": true,
    "defaultThemeMode": {},
    "enableDownloadCitations": true,
    "customDomain": {
      "domain": "サンプル文字列"
    },
    "enableDisplayChatbotAvatar": true,
    "enableDisplayChatbotName": true,
    "enableVoiceAgent": true,
    "buttonIcon": "https://example.com/file.jpg"
  };

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

# リクエスト内容 (payload)
data = {
      "avatar": "https://example.com/file.jpg",
      "logo": "https://example.com/file.jpg",
      "description": "サンプル文字列",
      "cover": "https://example.com/file.jpg",
      "backUrl": "サンプル文字列",
      "isActive": true,
      "theme": {
        "primaryColor": "サンプル文字列",
        "navbarTextColor": "サンプル文字列",
        "conversationBackgroundColor": "サンプル文字列",
        "chatbotMessageTextColor": "サンプル文字列",
        "userMessageTextColor": "サンプル文字列",
        "chatbotMessageBackgroundColor": "サンプル文字列",
        "userMessageBackgroundColor": "サンプル文字列",
        "chatbotMessageBackgroundShadowEnabled": true,
        "userMessageBackgroundShadowEnabled": true,
        "chatbotMessageGradientEnabled": true,
        "userMessageGradientEnabled": true
      },
      "darkTheme": {
        "primaryColor": "サンプル文字列",
        "navbarTextColor": "サンプル文字列",
        "conversationBackgroundColor": "サンプル文字列",
        "chatbotMessageTextColor": "サンプル文字列",
        "userMessageTextColor": "サンプル文字列",
        "chatbotMessageBackgroundColor": "サンプル文字列",
        "userMessageBackgroundColor": "サンプル文字列",
        "chatbotMessageBackgroundShadowEnabled": true,
        "userMessageBackgroundShadowEnabled": true,
        "chatbotMessageGradientEnabled": true,
        "userMessageGradientEnabled": true
      },
      "enableFileUpload": true,
      "enableDisplayCitations": true,
      "toolDisplayMode": "full",
      "enableDisplayThinking": true,
      "enableUserThinkingControl": true,
      "enableDisplayQueryMetadata": true,
      "enableShareConversation": true,
      "enableLocation": true,
      "enableShowPoweredBy": true,
      "poweredByLogo": "https://example.com/file.jpg",
      "enableAnonymous": true,
      "enableDisplayPreviousConversation": true,
      "enableDisplayConversationHistory": true,
      "enableConversationTimer": true,
      "conversationTimerDuration": 123,
      "enableAutoNewConversationOnTimeout": true,
      "enableThemeModeToggle": true,
      "enableDisplayFontSizeSwitch": true,
      "defaultThemeMode": {},
      "enableDownloadCitations": true,
      "customDomain": {
        "domain": "サンプル文字列"
      },
      "enableDisplayChatbotAvatar": true,
      "enableDisplayChatbotName": true,
      "enableVoiceAgent": true,
      "buttonIcon": "https://example.com/file.jpg"
    }

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/web-chats/550e8400-e29b-41d4-a716-446655440000/", [
        'headers' => [
            'Authorization' => 'Api-Key YOUR_API_KEY',
            'Content-Type' => 'application/json'
        ],
        'json' => {
            "avatar": "https://example.com/file.jpg",
            "logo": "https://example.com/file.jpg",
            "description": "サンプル文字列",
            "cover": "https://example.com/file.jpg",
            "backUrl": "サンプル文字列",
            "isActive": true,
            "theme": {
                "primaryColor": "サンプル文字列",
                "navbarTextColor": "サンプル文字列",
                "conversationBackgroundColor": "サンプル文字列",
                "chatbotMessageTextColor": "サンプル文字列",
                "userMessageTextColor": "サンプル文字列",
                "chatbotMessageBackgroundColor": "サンプル文字列",
                "userMessageBackgroundColor": "サンプル文字列",
                "chatbotMessageBackgroundShadowEnabled": true,
                "userMessageBackgroundShadowEnabled": true,
                "chatbotMessageGradientEnabled": true,
                "userMessageGradientEnabled": true
            },
            "darkTheme": {
                "primaryColor": "サンプル文字列",
                "navbarTextColor": "サンプル文字列",
                "conversationBackgroundColor": "サンプル文字列",
                "chatbotMessageTextColor": "サンプル文字列",
                "userMessageTextColor": "サンプル文字列",
                "chatbotMessageBackgroundColor": "サンプル文字列",
                "userMessageBackgroundColor": "サンプル文字列",
                "chatbotMessageBackgroundShadowEnabled": true,
                "userMessageBackgroundShadowEnabled": true,
                "chatbotMessageGradientEnabled": true,
                "userMessageGradientEnabled": true
            },
            "enableFileUpload": true,
            "enableDisplayCitations": true,
            "toolDisplayMode": "full",
            "enableDisplayThinking": true,
            "enableUserThinkingControl": true,
            "enableDisplayQueryMetadata": true,
            "enableShareConversation": true,
            "enableLocation": true,
            "enableShowPoweredBy": true,
            "poweredByLogo": "https://example.com/file.jpg",
            "enableAnonymous": true,
            "enableDisplayPreviousConversation": true,
            "enableDisplayConversationHistory": true,
            "enableConversationTimer": true,
            "conversationTimerDuration": 123,
            "enableAutoNewConversationOnTimeout": true,
            "enableThemeModeToggle": true,
            "enableDisplayFontSizeSwitch": true,
            "defaultThemeMode": {},
            "enableDownloadCitations": true,
            "customDomain": {
                "domain": "サンプル文字列"
            },
            "enableDisplayChatbotAvatar": true,
            "enableDisplayChatbotName": true,
            "enableVoiceAgent": true,
            "buttonIcon": "https://example.com/file.jpg"
        }
    ]);
    
    $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
  "avatar"?: string (uri) // 任意
  "logo"?: string (uri) // 任意
  "description"?: string // 任意
  "cover"?: string (uri) // 任意
  "backUrl"?: string // 任意
  "isActive"?: boolean // 任意
  "enableSpeech": boolean
  "displayConversationStarters": [
    string
  ]
  "theme": {
  {
    "primaryColor"?: string // 任意
    "navbarTextColor"?: string // 任意
    "conversationBackgroundColor"?: string // 任意
    "chatbotMessageTextColor"?: string // 任意
    "userMessageTextColor"?: string // 任意
    "chatbotMessageBackgroundColor"?: string // 任意
    "userMessageBackgroundColor"?: string // 任意
    "chatbotMessageBackgroundShadowEnabled"?: boolean // 任意
    "userMessageBackgroundShadowEnabled"?: boolean // 任意
    "chatbotMessageGradientEnabled"?: boolean // 任意
    "userMessageGradientEnabled"?: boolean // 任意
  }
  }
  "darkTheme": {
  {
    "primaryColor"?: string // 任意
    "navbarTextColor"?: string // 任意
    "conversationBackgroundColor"?: string // 任意
    "chatbotMessageTextColor"?: string // 任意
    "userMessageTextColor"?: string // 任意
    "chatbotMessageBackgroundColor"?: string // 任意
    "userMessageBackgroundColor"?: string // 任意
    "chatbotMessageBackgroundShadowEnabled"?: boolean // 任意
    "userMessageBackgroundShadowEnabled"?: boolean // 任意
    "chatbotMessageGradientEnabled"?: boolean // 任意
    "userMessageGradientEnabled"?: boolean // 任意
  }
  }
  "enableFileUpload"?: boolean // 任意
  "enableDisplayCitations"?: boolean // 任意
  "toolDisplayMode"?: string (enum: full, compact, hidden) // * `full` - Full
* `compact` - Compact
* `hidden` - Hidden (任意)
  "enableDisplayThinking"?: boolean // 任意
  "enableUserThinkingControl"?: boolean // 任意
  "enableDisplayQueryMetadata"?: boolean // 任意
  "enableShareConversation"?: boolean // 任意
  "enableLocation"?: boolean // 任意
  "enableShowPoweredBy"?: boolean // 任意
  "poweredByLogo"?: string (uri) // 任意
  "enableAnonymous"?: boolean // 任意
  "enableDisplayPreviousConversation"?: boolean // 任意
  "enableDisplayConversationHistory"?: boolean // 任意
  "enableConversationTimer"?: boolean // 任意
  "conversationTimerDuration"?: integer // タイマーのタイムアウト時間。範囲は 3〜60 分です (任意)
  "enableAutoNewConversationOnTimeout"?: boolean // 任意
  "accessType": 
  {
  }
  "enableThemeModeToggle"?: boolean // 任意
  "enableDisplayFontSizeSwitch"?: boolean // 任意
  "defaultThemeMode"?:  // 任意
  {
  }
  "enableDownloadCitations"?: boolean // 任意
  "customDomain"?:  // 任意
  {
    "id": string (uuid)
    "domain": string
    "status": 
    {
    }
  }
  "enableDisplayChatbotAvatar"?: boolean // 任意
  "enableDisplayChatbotName"?: boolean // 任意
  "enableVoiceAgent"?: boolean // WebChat で音声エージェント機能の利用を許可するかどうか (任意)
  "buttonIcon"?: string (uri) // 任意
  "inbox": object
}
```

**レスポンスの例**

```json
{
  "id": "550e8400-e29b-41d4-a716-446655440000",
  "name": "レスポンス文字列",
  "avatar": "https://example.com/file.jpg",
  "logo": "https://example.com/file.jpg",
  "description": "レスポンス文字列",
  "cover": "https://example.com/file.jpg",
  "backUrl": "レスポンス文字列",
  "isActive": false,
  "enableSpeech": false,
  "displayConversationStarters": [
    "レスポンス文字列"
  ],
  "theme": {
    "primaryColor": "レスポンス文字列",
    "navbarTextColor": "レスポンス文字列",
    "conversationBackgroundColor": "レスポンス文字列",
    "chatbotMessageTextColor": "レスポンス文字列",
    "userMessageTextColor": "レスポンス文字列",
    "chatbotMessageBackgroundColor": "レスポンス文字列",
    "userMessageBackgroundColor": "レスポンス文字列",
    "chatbotMessageBackgroundShadowEnabled": false,
    "userMessageBackgroundShadowEnabled": false,
    "chatbotMessageGradientEnabled": false,
    "userMessageGradientEnabled": false
  },
  "darkTheme": {
    "primaryColor": "レスポンス文字列",
    "navbarTextColor": "レスポンス文字列",
    "conversationBackgroundColor": "レスポンス文字列",
    "chatbotMessageTextColor": "レスポンス文字列",
    "userMessageTextColor": "レスポンス文字列",
    "chatbotMessageBackgroundColor": "レスポンス文字列",
    "userMessageBackgroundColor": "レスポンス文字列",
    "chatbotMessageBackgroundShadowEnabled": false,
    "userMessageBackgroundShadowEnabled": false,
    "chatbotMessageGradientEnabled": false,
    "userMessageGradientEnabled": false
  },
  "enableFileUpload": false,
  "enableDisplayCitations": false,
  "toolDisplayMode": "full",
  "enableDisplayThinking": false,
  "enableUserThinkingControl": false,
  "enableDisplayQueryMetadata": false,
  "enableShareConversation": false,
  "enableLocation": false,
  "enableShowPoweredBy": false,
  "poweredByLogo": "https://example.com/file.jpg",
  "enableAnonymous": false,
  "enableDisplayPreviousConversation": false,
  "enableDisplayConversationHistory": false,
  "enableConversationTimer": false,
  "conversationTimerDuration": 456,
  "enableAutoNewConversationOnTimeout": false,
  "accessType": {},
  "enableThemeModeToggle": false,
  "enableDisplayFontSizeSwitch": false,
  "defaultThemeMode": {},
  "enableDownloadCitations": false,
  "customDomain": {
    "id": "550e8400-e29b-41d4-a716-446655440000",
    "domain": "レスポンス文字列",
    "status": {}
  },
  "enableDisplayChatbotAvatar": false,
  "enableDisplayChatbotName": false,
  "enableVoiceAgent": false,
  "buttonIcon": "https://example.com/file.jpg",
  "inbox": {
    "id": "550e8400-e29b-41d4-a716-446655440000",
    "name": "レスポンス例の名前",
    "description": "レスポンス例の説明"
  }
}
```

***

### 連絡先の認証情報の設定 <a href="#undefined" id="undefined"></a>

POST `/api/v1/web-chats/{id}/setup-contact-credentials/`

#### パラメータ

| パラメータ名 | 必須 | 型      | 説明                                       |
| ------ | -- | ------ | ---------------------------------------- |
| `id`   | ✅  | string | A UUID string identifying this web chat. |

#### リクエスト内容

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

| フィールド                  | 型                                       | 必須  | 説明                                |
| ---------------------- | --------------------------------------- | --- | --------------------------------- |
| sourceId               | string                                  | はい  | Unique identifier for the contact |
| name                   | string                                  | いいえ | Contact display name              |
| mcpCredentials         | object (2 個のプロパティ: toolId, headers を含む) | いいえ | MCP credentials configuration     |
| mcpCredentials.toolId  | string (uuid)                           | はい  | MCP Tool ID                       |
| mcpCredentials.headers | object                                  | いいえ | Authentication headers            |

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

```typescript
{
  "sourceId": string // Unique identifier for the contact
  "name"?: string // Contact display name (任意)
  "mcpCredentials"?:  // MCP credentials configuration (任意)
  {
    "toolId": string (uuid) // MCP Tool ID
    "headers"?: object // Authentication headers (任意)
  }
}
```

**リクエストの例**

```json
{
  "sourceId": "サンプル文字列",
  "name": "サンプル名",
  "mcpCredentials": {
    "toolId": "550e8400-e29b-41d4-a716-446655440000",
    "headers": {}
  }
}
```

#### コード例

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

```bash
# API 呼び出しの例 (Shell)
curl -X POST "https://api.maiagent.ai/api/v1/web-chats/550e8400-e29b-41d4-a716-446655440000/setup-contact-credentials/" \
  -H "Authorization: Api-Key YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "sourceId": "サンプル文字列",
    "name": "サンプル名",
    "mcpCredentials": {
      "toolId": "550e8400-e29b-41d4-a716-446655440000",
      "headers": {}
    }
  }'

# 実行前に 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 = {
    "sourceId": "サンプル文字列",
    "name": "サンプル名",
    "mcpCredentials": {
      "toolId": "550e8400-e29b-41d4-a716-446655440000",
      "headers": {}
    }
  };

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

# リクエスト内容 (payload)
data = {
      "sourceId": "サンプル文字列",
      "name": "サンプル名",
      "mcpCredentials": {
        "toolId": "550e8400-e29b-41d4-a716-446655440000",
        "headers": {}
      }
    }

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/web-chats/550e8400-e29b-41d4-a716-446655440000/setup-contact-credentials/", [
        'headers' => [
            'Authorization' => 'Api-Key YOUR_API_KEY',
            'Content-Type' => 'application/json'
        ],
        'json' => {
            "sourceId": "サンプル文字列",
            "name": "サンプル名",
            "mcpCredentials": {
                "toolId": "550e8400-e29b-41d4-a716-446655440000",
                "headers": {}
            }
        }
    ]);
    
    $data = json_decode($response->getBody(), true);
    echo "レスポンスの取得に成功しました:\n";
    print_r($data);
} catch (Exception $e) {
    echo 'リクエストでエラーが発生しました: ' . $e->getMessage();
}
?>
```

{% endtab %}
{% endtabs %}

#### レスポンス内容

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

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

```typescript
{
  "contactId": string (uuid) // The created or existing contact ID
}
```

**レスポンスの例**

```json
{
  "contactId": "550e8400-e29b-41d4-a716-446655440000"
}
```

**ステータスコード: 400 - No response body**

***

### 連絡先の認証情報の設定 <a href="#undefined" id="undefined"></a>

POST `/api/web-chats/{id}/setup-contact-credentials/`

#### パラメータ

| パラメータ名 | 必須 | 型      | 説明                                       |
| ------ | -- | ------ | ---------------------------------------- |
| `id`   | ✅  | string | A UUID string identifying this web chat. |

#### リクエスト内容

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

| フィールド                  | 型                                       | 必須  | 説明                                |
| ---------------------- | --------------------------------------- | --- | --------------------------------- |
| sourceId               | string                                  | はい  | Unique identifier for the contact |
| name                   | string                                  | いいえ | Contact display name              |
| mcpCredentials         | object (2 個のプロパティ: toolId, headers を含む) | いいえ | MCP credentials configuration     |
| mcpCredentials.toolId  | string (uuid)                           | はい  | MCP Tool ID                       |
| mcpCredentials.headers | object                                  | いいえ | Authentication headers            |

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

```typescript
{
  "sourceId": string // Unique identifier for the contact
  "name"?: string // Contact display name (任意)
  "mcpCredentials"?:  // MCP credentials configuration (任意)
  {
    "toolId": string (uuid) // MCP Tool ID
    "headers"?: object // Authentication headers (任意)
  }
}
```

**リクエストの例**

```json
{
  "sourceId": "サンプル文字列",
  "name": "サンプル名",
  "mcpCredentials": {
    "toolId": "550e8400-e29b-41d4-a716-446655440000",
    "headers": {}
  }
}
```

#### コード例

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

```bash
# API 呼び出しの例 (Shell)
curl -X POST "https://api.maiagent.ai/api/web-chats/550e8400-e29b-41d4-a716-446655440000/setup-contact-credentials/" \
  -H "Authorization: Api-Key YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "sourceId": "サンプル文字列",
    "name": "サンプル名",
    "mcpCredentials": {
      "toolId": "550e8400-e29b-41d4-a716-446655440000",
      "headers": {}
    }
  }'

# 実行前に 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 = {
    "sourceId": "サンプル文字列",
    "name": "サンプル名",
    "mcpCredentials": {
      "toolId": "550e8400-e29b-41d4-a716-446655440000",
      "headers": {}
    }
  };

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

# リクエスト内容 (payload)
data = {
      "sourceId": "サンプル文字列",
      "name": "サンプル名",
      "mcpCredentials": {
        "toolId": "550e8400-e29b-41d4-a716-446655440000",
        "headers": {}
      }
    }

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/web-chats/550e8400-e29b-41d4-a716-446655440000/setup-contact-credentials/", [
        'headers' => [
            'Authorization' => 'Api-Key YOUR_API_KEY',
            'Content-Type' => 'application/json'
        ],
        'json' => {
            "sourceId": "サンプル文字列",
            "name": "サンプル名",
            "mcpCredentials": {
                "toolId": "550e8400-e29b-41d4-a716-446655440000",
                "headers": {}
            }
        }
    ]);
    
    $data = json_decode($response->getBody(), true);
    echo "レスポンスの取得に成功しました:\n";
    print_r($data);
} catch (Exception $e) {
    echo 'リクエストでエラーが発生しました: ' . $e->getMessage();
}
?>
```

{% endtab %}
{% endtabs %}

#### レスポンス内容

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

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

```typescript
{
  "contactId": string (uuid) // The created or existing contact ID
}
```

**レスポンスの例**

```json
{
  "contactId": "550e8400-e29b-41d4-a716-446655440000"
}
```

**ステータスコード: 400 - No response body**

***

### 音声アシスタント Token の取得 <a href="#token" id="token"></a>

POST `/api/v1/web-chats/{id}/voice-agent/token/`

#### パラメータ

| パラメータ名 | 必須 | 型      | 説明                                       |
| ------ | -- | ------ | ---------------------------------------- |
| `id`   | ✅  | string | A UUID string identifying this web chat. |

#### リクエスト内容

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

| フィールド                                           | 型                                          | 必須  | 説明                                                    |
| ----------------------------------------------- | ------------------------------------------ | --- | ----------------------------------------------------- |
| avatar                                          | string (uri)                               | いいえ |                                                       |
| logo                                            | string (uri)                               | いいえ |                                                       |
| description                                     | string                                     | いいえ |                                                       |
| cover                                           | string (uri)                               | いいえ |                                                       |
| backUrl                                         | string                                     | いいえ |                                                       |
| isActive                                        | boolean                                    | いいえ |                                                       |
| theme                                           | object                                     | はい  |                                                       |
| theme.primaryColor                              | string                                     | いいえ |                                                       |
| theme.navbarTextColor                           | string                                     | いいえ |                                                       |
| theme.conversationBackgroundColor               | string                                     | いいえ |                                                       |
| theme.chatbotMessageTextColor                   | string                                     | いいえ |                                                       |
| theme.userMessageTextColor                      | string                                     | いいえ |                                                       |
| theme.chatbotMessageBackgroundColor             | string                                     | いいえ |                                                       |
| theme.userMessageBackgroundColor                | string                                     | いいえ |                                                       |
| theme.chatbotMessageBackgroundShadowEnabled     | boolean                                    | いいえ |                                                       |
| theme.userMessageBackgroundShadowEnabled        | boolean                                    | いいえ |                                                       |
| theme.chatbotMessageGradientEnabled             | boolean                                    | いいえ |                                                       |
| theme.userMessageGradientEnabled                | boolean                                    | いいえ |                                                       |
| darkTheme                                       | object                                     | はい  |                                                       |
| darkTheme.primaryColor                          | string                                     | いいえ |                                                       |
| darkTheme.navbarTextColor                       | string                                     | いいえ |                                                       |
| darkTheme.conversationBackgroundColor           | string                                     | いいえ |                                                       |
| darkTheme.chatbotMessageTextColor               | string                                     | いいえ |                                                       |
| darkTheme.userMessageTextColor                  | string                                     | いいえ |                                                       |
| darkTheme.chatbotMessageBackgroundColor         | string                                     | いいえ |                                                       |
| darkTheme.userMessageBackgroundColor            | string                                     | いいえ |                                                       |
| darkTheme.chatbotMessageBackgroundShadowEnabled | boolean                                    | いいえ |                                                       |
| darkTheme.userMessageBackgroundShadowEnabled    | boolean                                    | いいえ |                                                       |
| darkTheme.chatbotMessageGradientEnabled         | boolean                                    | いいえ |                                                       |
| darkTheme.userMessageGradientEnabled            | boolean                                    | いいえ |                                                       |
| enableFileUpload                                | boolean                                    | いいえ |                                                       |
| enableDisplayCitations                          | boolean                                    | いいえ |                                                       |
| toolDisplayMode                                 | string (enum: full, compact, hidden)       | いいえ | `full`: Full ; `compact`: Compact ; `hidden`: Hidden; |
| enableDisplayThinking                           | boolean                                    | いいえ |                                                       |
| enableUserThinkingControl                       | boolean                                    | いいえ |                                                       |
| enableDisplayQueryMetadata                      | boolean                                    | いいえ |                                                       |
| enableShareConversation                         | boolean                                    | いいえ |                                                       |
| enableLocation                                  | boolean                                    | いいえ |                                                       |
| enableShowPoweredBy                             | boolean                                    | いいえ |                                                       |
| poweredByLogo                                   | string (uri)                               | いいえ |                                                       |
| enableAnonymous                                 | boolean                                    | いいえ |                                                       |
| enableDisplayPreviousConversation               | boolean                                    | いいえ |                                                       |
| enableDisplayConversationHistory                | boolean                                    | いいえ |                                                       |
| enableConversationTimer                         | boolean                                    | いいえ |                                                       |
| conversationTimerDuration                       | integer                                    | いいえ | タイマーのタイムアウト時間。範囲は 3〜60 分です                            |
| enableAutoNewConversationOnTimeout              | boolean                                    | いいえ |                                                       |
| enableThemeModeToggle                           | boolean                                    | いいえ |                                                       |
| enableDisplayFontSizeSwitch                     | boolean                                    | いいえ |                                                       |
| defaultThemeMode                                | object                                     | いいえ |                                                       |
| enableDownloadCitations                         | boolean                                    | いいえ |                                                       |
| customDomain                                    | object (3 個のプロパティ: id, domain, status を含む) | いいえ |                                                       |
| customDomain.domain                             | string                                     | はい  |                                                       |
| enableDisplayChatbotAvatar                      | boolean                                    | いいえ |                                                       |
| enableDisplayChatbotName                        | boolean                                    | いいえ |                                                       |
| enableVoiceAgent                                | boolean                                    | いいえ | WebChat で音声エージェント機能の利用を許可するかどうか                       |
| buttonIcon                                      | string (uri)                               | いいえ |                                                       |

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

```typescript
{
  "avatar"?: string (uri) // 任意
  "logo"?: string (uri) // 任意
  "description"?: string // 任意
  "cover"?: string (uri) // 任意
  "backUrl"?: string // 任意
  "isActive"?: boolean // 任意
  "theme": {
  {
    "primaryColor"?: string // 任意
    "navbarTextColor"?: string // 任意
    "conversationBackgroundColor"?: string // 任意
    "chatbotMessageTextColor"?: string // 任意
    "userMessageTextColor"?: string // 任意
    "chatbotMessageBackgroundColor"?: string // 任意
    "userMessageBackgroundColor"?: string // 任意
    "chatbotMessageBackgroundShadowEnabled"?: boolean // 任意
    "userMessageBackgroundShadowEnabled"?: boolean // 任意
    "chatbotMessageGradientEnabled"?: boolean // 任意
    "userMessageGradientEnabled"?: boolean // 任意
  }
  }
  "darkTheme": {
  {
    "primaryColor"?: string // 任意
    "navbarTextColor"?: string // 任意
    "conversationBackgroundColor"?: string // 任意
    "chatbotMessageTextColor"?: string // 任意
    "userMessageTextColor"?: string // 任意
    "chatbotMessageBackgroundColor"?: string // 任意
    "userMessageBackgroundColor"?: string // 任意
    "chatbotMessageBackgroundShadowEnabled"?: boolean // 任意
    "userMessageBackgroundShadowEnabled"?: boolean // 任意
    "chatbotMessageGradientEnabled"?: boolean // 任意
    "userMessageGradientEnabled"?: boolean // 任意
  }
  }
  "enableFileUpload"?: boolean // 任意
  "enableDisplayCitations"?: boolean // 任意
  "toolDisplayMode"?: string (enum: full, compact, hidden) // * `full` - Full
* `compact` - Compact
* `hidden` - Hidden (任意)
  "enableDisplayThinking"?: boolean // 任意
  "enableUserThinkingControl"?: boolean // 任意
  "enableDisplayQueryMetadata"?: boolean // 任意
  "enableShareConversation"?: boolean // 任意
  "enableLocation"?: boolean // 任意
  "enableShowPoweredBy"?: boolean // 任意
  "poweredByLogo"?: string (uri) // 任意
  "enableAnonymous"?: boolean // 任意
  "enableDisplayPreviousConversation"?: boolean // 任意
  "enableDisplayConversationHistory"?: boolean // 任意
  "enableConversationTimer"?: boolean // 任意
  "conversationTimerDuration"?: integer // タイマーのタイムアウト時間。範囲は 3〜60 分です (任意)
  "enableAutoNewConversationOnTimeout"?: boolean // 任意
  "enableThemeModeToggle"?: boolean // 任意
  "enableDisplayFontSizeSwitch"?: boolean // 任意
  "defaultThemeMode"?:  // 任意
  {
  }
  "enableDownloadCitations"?: boolean // 任意
  "customDomain"?:  // 任意
  {
    "domain": string
  }
  "enableDisplayChatbotAvatar"?: boolean // 任意
  "enableDisplayChatbotName"?: boolean // 任意
  "enableVoiceAgent"?: boolean // WebChat で音声エージェント機能の利用を許可するかどうか (任意)
  "buttonIcon"?: string (uri) // 任意
}
```

**リクエストの例**

```json
{
  "avatar": "https://example.com/file.jpg",
  "logo": "https://example.com/file.jpg",
  "description": "サンプル文字列",
  "cover": "https://example.com/file.jpg",
  "backUrl": "サンプル文字列",
  "isActive": true,
  "theme": {
    "primaryColor": "サンプル文字列",
    "navbarTextColor": "サンプル文字列",
    "conversationBackgroundColor": "サンプル文字列",
    "chatbotMessageTextColor": "サンプル文字列",
    "userMessageTextColor": "サンプル文字列",
    "chatbotMessageBackgroundColor": "サンプル文字列",
    "userMessageBackgroundColor": "サンプル文字列",
    "chatbotMessageBackgroundShadowEnabled": true,
    "userMessageBackgroundShadowEnabled": true,
    "chatbotMessageGradientEnabled": true,
    "userMessageGradientEnabled": true
  },
  "darkTheme": {
    "primaryColor": "サンプル文字列",
    "navbarTextColor": "サンプル文字列",
    "conversationBackgroundColor": "サンプル文字列",
    "chatbotMessageTextColor": "サンプル文字列",
    "userMessageTextColor": "サンプル文字列",
    "chatbotMessageBackgroundColor": "サンプル文字列",
    "userMessageBackgroundColor": "サンプル文字列",
    "chatbotMessageBackgroundShadowEnabled": true,
    "userMessageBackgroundShadowEnabled": true,
    "chatbotMessageGradientEnabled": true,
    "userMessageGradientEnabled": true
  },
  "enableFileUpload": true,
  "enableDisplayCitations": true,
  "toolDisplayMode": "full",
  "enableDisplayThinking": true,
  "enableUserThinkingControl": true,
  "enableDisplayQueryMetadata": true,
  "enableShareConversation": true,
  "enableLocation": true,
  "enableShowPoweredBy": true,
  "poweredByLogo": "https://example.com/file.jpg",
  "enableAnonymous": true,
  "enableDisplayPreviousConversation": true,
  "enableDisplayConversationHistory": true,
  "enableConversationTimer": true,
  "conversationTimerDuration": 123,
  "enableAutoNewConversationOnTimeout": true,
  "enableThemeModeToggle": true,
  "enableDisplayFontSizeSwitch": true,
  "defaultThemeMode": {},
  "enableDownloadCitations": true,
  "customDomain": {
    "domain": "サンプル文字列"
  },
  "enableDisplayChatbotAvatar": true,
  "enableDisplayChatbotName": true,
  "enableVoiceAgent": true,
  "buttonIcon": "https://example.com/file.jpg"
}
```

#### コード例

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

```bash
# API 呼び出しの例 (Shell)
curl -X POST "https://api.maiagent.ai/api/v1/web-chats/550e8400-e29b-41d4-a716-446655440000/voice-agent/token/" \
  -H "Authorization: Api-Key YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "avatar": "https://example.com/file.jpg",
    "logo": "https://example.com/file.jpg",
    "description": "サンプル文字列",
    "cover": "https://example.com/file.jpg",
    "backUrl": "サンプル文字列",
    "isActive": true,
    "theme": {
      "primaryColor": "サンプル文字列",
      "navbarTextColor": "サンプル文字列",
      "conversationBackgroundColor": "サンプル文字列",
      "chatbotMessageTextColor": "サンプル文字列",
      "userMessageTextColor": "サンプル文字列",
      "chatbotMessageBackgroundColor": "サンプル文字列",
      "userMessageBackgroundColor": "サンプル文字列",
      "chatbotMessageBackgroundShadowEnabled": true,
      "userMessageBackgroundShadowEnabled": true,
      "chatbotMessageGradientEnabled": true,
      "userMessageGradientEnabled": true
    },
    "darkTheme": {
      "primaryColor": "サンプル文字列",
      "navbarTextColor": "サンプル文字列",
      "conversationBackgroundColor": "サンプル文字列",
      "chatbotMessageTextColor": "サンプル文字列",
      "userMessageTextColor": "サンプル文字列",
      "chatbotMessageBackgroundColor": "サンプル文字列",
      "userMessageBackgroundColor": "サンプル文字列",
      "chatbotMessageBackgroundShadowEnabled": true,
      "userMessageBackgroundShadowEnabled": true,
      "chatbotMessageGradientEnabled": true,
      "userMessageGradientEnabled": true
    },
    "enableFileUpload": true,
    "enableDisplayCitations": true,
    "toolDisplayMode": "full",
    "enableDisplayThinking": true,
    "enableUserThinkingControl": true,
    "enableDisplayQueryMetadata": true,
    "enableShareConversation": true,
    "enableLocation": true,
    "enableShowPoweredBy": true,
    "poweredByLogo": "https://example.com/file.jpg",
    "enableAnonymous": true,
    "enableDisplayPreviousConversation": true,
    "enableDisplayConversationHistory": true,
    "enableConversationTimer": true,
    "conversationTimerDuration": 123,
    "enableAutoNewConversationOnTimeout": true,
    "enableThemeModeToggle": true,
    "enableDisplayFontSizeSwitch": true,
    "defaultThemeMode": {},
    "enableDownloadCitations": true,
    "customDomain": {
      "domain": "サンプル文字列"
    },
    "enableDisplayChatbotAvatar": true,
    "enableDisplayChatbotName": true,
    "enableVoiceAgent": true,
    "buttonIcon": "https://example.com/file.jpg"
  }'

# 実行前に 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 = {
    "avatar": "https://example.com/file.jpg",
    "logo": "https://example.com/file.jpg",
    "description": "サンプル文字列",
    "cover": "https://example.com/file.jpg",
    "backUrl": "サンプル文字列",
    "isActive": true,
    "theme": {
      "primaryColor": "サンプル文字列",
      "navbarTextColor": "サンプル文字列",
      "conversationBackgroundColor": "サンプル文字列",
      "chatbotMessageTextColor": "サンプル文字列",
      "userMessageTextColor": "サンプル文字列",
      "chatbotMessageBackgroundColor": "サンプル文字列",
      "userMessageBackgroundColor": "サンプル文字列",
      "chatbotMessageBackgroundShadowEnabled": true,
      "userMessageBackgroundShadowEnabled": true,
      "chatbotMessageGradientEnabled": true,
      "userMessageGradientEnabled": true
    },
    "darkTheme": {
      "primaryColor": "サンプル文字列",
      "navbarTextColor": "サンプル文字列",
      "conversationBackgroundColor": "サンプル文字列",
      "chatbotMessageTextColor": "サンプル文字列",
      "userMessageTextColor": "サンプル文字列",
      "chatbotMessageBackgroundColor": "サンプル文字列",
      "userMessageBackgroundColor": "サンプル文字列",
      "chatbotMessageBackgroundShadowEnabled": true,
      "userMessageBackgroundShadowEnabled": true,
      "chatbotMessageGradientEnabled": true,
      "userMessageGradientEnabled": true
    },
    "enableFileUpload": true,
    "enableDisplayCitations": true,
    "toolDisplayMode": "full",
    "enableDisplayThinking": true,
    "enableUserThinkingControl": true,
    "enableDisplayQueryMetadata": true,
    "enableShareConversation": true,
    "enableLocation": true,
    "enableShowPoweredBy": true,
    "poweredByLogo": "https://example.com/file.jpg",
    "enableAnonymous": true,
    "enableDisplayPreviousConversation": true,
    "enableDisplayConversationHistory": true,
    "enableConversationTimer": true,
    "conversationTimerDuration": 123,
    "enableAutoNewConversationOnTimeout": true,
    "enableThemeModeToggle": true,
    "enableDisplayFontSizeSwitch": true,
    "defaultThemeMode": {},
    "enableDownloadCitations": true,
    "customDomain": {
      "domain": "サンプル文字列"
    },
    "enableDisplayChatbotAvatar": true,
    "enableDisplayChatbotName": true,
    "enableVoiceAgent": true,
    "buttonIcon": "https://example.com/file.jpg"
  };

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

# リクエスト内容 (payload)
data = {
      "avatar": "https://example.com/file.jpg",
      "logo": "https://example.com/file.jpg",
      "description": "サンプル文字列",
      "cover": "https://example.com/file.jpg",
      "backUrl": "サンプル文字列",
      "isActive": true,
      "theme": {
        "primaryColor": "サンプル文字列",
        "navbarTextColor": "サンプル文字列",
        "conversationBackgroundColor": "サンプル文字列",
        "chatbotMessageTextColor": "サンプル文字列",
        "userMessageTextColor": "サンプル文字列",
        "chatbotMessageBackgroundColor": "サンプル文字列",
        "userMessageBackgroundColor": "サンプル文字列",
        "chatbotMessageBackgroundShadowEnabled": true,
        "userMessageBackgroundShadowEnabled": true,
        "chatbotMessageGradientEnabled": true,
        "userMessageGradientEnabled": true
      },
      "darkTheme": {
        "primaryColor": "サンプル文字列",
        "navbarTextColor": "サンプル文字列",
        "conversationBackgroundColor": "サンプル文字列",
        "chatbotMessageTextColor": "サンプル文字列",
        "userMessageTextColor": "サンプル文字列",
        "chatbotMessageBackgroundColor": "サンプル文字列",
        "userMessageBackgroundColor": "サンプル文字列",
        "chatbotMessageBackgroundShadowEnabled": true,
        "userMessageBackgroundShadowEnabled": true,
        "chatbotMessageGradientEnabled": true,
        "userMessageGradientEnabled": true
      },
      "enableFileUpload": true,
      "enableDisplayCitations": true,
      "toolDisplayMode": "full",
      "enableDisplayThinking": true,
      "enableUserThinkingControl": true,
      "enableDisplayQueryMetadata": true,
      "enableShareConversation": true,
      "enableLocation": true,
      "enableShowPoweredBy": true,
      "poweredByLogo": "https://example.com/file.jpg",
      "enableAnonymous": true,
      "enableDisplayPreviousConversation": true,
      "enableDisplayConversationHistory": true,
      "enableConversationTimer": true,
      "conversationTimerDuration": 123,
      "enableAutoNewConversationOnTimeout": true,
      "enableThemeModeToggle": true,
      "enableDisplayFontSizeSwitch": true,
      "defaultThemeMode": {},
      "enableDownloadCitations": true,
      "customDomain": {
        "domain": "サンプル文字列"
      },
      "enableDisplayChatbotAvatar": true,
      "enableDisplayChatbotName": true,
      "enableVoiceAgent": true,
      "buttonIcon": "https://example.com/file.jpg"
    }

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/web-chats/550e8400-e29b-41d4-a716-446655440000/voice-agent/token/", [
        'headers' => [
            'Authorization' => 'Api-Key YOUR_API_KEY',
            'Content-Type' => 'application/json'
        ],
        'json' => {
            "avatar": "https://example.com/file.jpg",
            "logo": "https://example.com/file.jpg",
            "description": "サンプル文字列",
            "cover": "https://example.com/file.jpg",
            "backUrl": "サンプル文字列",
            "isActive": true,
            "theme": {
                "primaryColor": "サンプル文字列",
                "navbarTextColor": "サンプル文字列",
                "conversationBackgroundColor": "サンプル文字列",
                "chatbotMessageTextColor": "サンプル文字列",
                "userMessageTextColor": "サンプル文字列",
                "chatbotMessageBackgroundColor": "サンプル文字列",
                "userMessageBackgroundColor": "サンプル文字列",
                "chatbotMessageBackgroundShadowEnabled": true,
                "userMessageBackgroundShadowEnabled": true,
                "chatbotMessageGradientEnabled": true,
                "userMessageGradientEnabled": true
            },
            "darkTheme": {
                "primaryColor": "サンプル文字列",
                "navbarTextColor": "サンプル文字列",
                "conversationBackgroundColor": "サンプル文字列",
                "chatbotMessageTextColor": "サンプル文字列",
                "userMessageTextColor": "サンプル文字列",
                "chatbotMessageBackgroundColor": "サンプル文字列",
                "userMessageBackgroundColor": "サンプル文字列",
                "chatbotMessageBackgroundShadowEnabled": true,
                "userMessageBackgroundShadowEnabled": true,
                "chatbotMessageGradientEnabled": true,
                "userMessageGradientEnabled": true
            },
            "enableFileUpload": true,
            "enableDisplayCitations": true,
            "toolDisplayMode": "full",
            "enableDisplayThinking": true,
            "enableUserThinkingControl": true,
            "enableDisplayQueryMetadata": true,
            "enableShareConversation": true,
            "enableLocation": true,
            "enableShowPoweredBy": true,
            "poweredByLogo": "https://example.com/file.jpg",
            "enableAnonymous": true,
            "enableDisplayPreviousConversation": true,
            "enableDisplayConversationHistory": true,
            "enableConversationTimer": true,
            "conversationTimerDuration": 123,
            "enableAutoNewConversationOnTimeout": true,
            "enableThemeModeToggle": true,
            "enableDisplayFontSizeSwitch": true,
            "defaultThemeMode": {},
            "enableDownloadCitations": true,
            "customDomain": {
                "domain": "サンプル文字列"
            },
            "enableDisplayChatbotAvatar": true,
            "enableDisplayChatbotName": true,
            "enableVoiceAgent": true,
            "buttonIcon": "https://example.com/file.jpg"
        }
    ]);
    
    $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
  "avatar"?: string (uri) // 任意
  "logo"?: string (uri) // 任意
  "description"?: string // 任意
  "cover"?: string (uri) // 任意
  "backUrl"?: string // 任意
  "isActive"?: boolean // 任意
  "enableSpeech": boolean
  "displayConversationStarters": [
    string
  ]
  "theme": {
  {
    "primaryColor"?: string // 任意
    "navbarTextColor"?: string // 任意
    "conversationBackgroundColor"?: string // 任意
    "chatbotMessageTextColor"?: string // 任意
    "userMessageTextColor"?: string // 任意
    "chatbotMessageBackgroundColor"?: string // 任意
    "userMessageBackgroundColor"?: string // 任意
    "chatbotMessageBackgroundShadowEnabled"?: boolean // 任意
    "userMessageBackgroundShadowEnabled"?: boolean // 任意
    "chatbotMessageGradientEnabled"?: boolean // 任意
    "userMessageGradientEnabled"?: boolean // 任意
  }
  }
  "darkTheme": {
  {
    "primaryColor"?: string // 任意
    "navbarTextColor"?: string // 任意
    "conversationBackgroundColor"?: string // 任意
    "chatbotMessageTextColor"?: string // 任意
    "userMessageTextColor"?: string // 任意
    "chatbotMessageBackgroundColor"?: string // 任意
    "userMessageBackgroundColor"?: string // 任意
    "chatbotMessageBackgroundShadowEnabled"?: boolean // 任意
    "userMessageBackgroundShadowEnabled"?: boolean // 任意
    "chatbotMessageGradientEnabled"?: boolean // 任意
    "userMessageGradientEnabled"?: boolean // 任意
  }
  }
  "enableFileUpload"?: boolean // 任意
  "enableDisplayCitations"?: boolean // 任意
  "toolDisplayMode"?: string (enum: full, compact, hidden) // * `full` - Full
* `compact` - Compact
* `hidden` - Hidden (任意)
  "enableDisplayThinking"?: boolean // 任意
  "enableUserThinkingControl"?: boolean // 任意
  "enableDisplayQueryMetadata"?: boolean // 任意
  "enableShareConversation"?: boolean // 任意
  "enableLocation"?: boolean // 任意
  "enableShowPoweredBy"?: boolean // 任意
  "poweredByLogo"?: string (uri) // 任意
  "enableAnonymous"?: boolean // 任意
  "enableDisplayPreviousConversation"?: boolean // 任意
  "enableDisplayConversationHistory"?: boolean // 任意
  "enableConversationTimer"?: boolean // 任意
  "conversationTimerDuration"?: integer // タイマーのタイムアウト時間。範囲は 3〜60 分です (任意)
  "enableAutoNewConversationOnTimeout"?: boolean // 任意
  "accessType": 
  {
  }
  "enableThemeModeToggle"?: boolean // 任意
  "enableDisplayFontSizeSwitch"?: boolean // 任意
  "defaultThemeMode"?:  // 任意
  {
  }
  "enableDownloadCitations"?: boolean // 任意
  "customDomain"?:  // 任意
  {
    "id": string (uuid)
    "domain": string
    "status": 
    {
    }
  }
  "enableDisplayChatbotAvatar"?: boolean // 任意
  "enableDisplayChatbotName"?: boolean // 任意
  "enableVoiceAgent"?: boolean // WebChat で音声エージェント機能の利用を許可するかどうか (任意)
  "buttonIcon"?: string (uri) // 任意
  "inbox": object
}
```

**レスポンスの例**

```json
{
  "id": "550e8400-e29b-41d4-a716-446655440000",
  "name": "レスポンス文字列",
  "avatar": "https://example.com/file.jpg",
  "logo": "https://example.com/file.jpg",
  "description": "レスポンス文字列",
  "cover": "https://example.com/file.jpg",
  "backUrl": "レスポンス文字列",
  "isActive": false,
  "enableSpeech": false,
  "displayConversationStarters": [
    "レスポンス文字列"
  ],
  "theme": {
    "primaryColor": "レスポンス文字列",
    "navbarTextColor": "レスポンス文字列",
    "conversationBackgroundColor": "レスポンス文字列",
    "chatbotMessageTextColor": "レスポンス文字列",
    "userMessageTextColor": "レスポンス文字列",
    "chatbotMessageBackgroundColor": "レスポンス文字列",
    "userMessageBackgroundColor": "レスポンス文字列",
    "chatbotMessageBackgroundShadowEnabled": false,
    "userMessageBackgroundShadowEnabled": false,
    "chatbotMessageGradientEnabled": false,
    "userMessageGradientEnabled": false
  },
  "darkTheme": {
    "primaryColor": "レスポンス文字列",
    "navbarTextColor": "レスポンス文字列",
    "conversationBackgroundColor": "レスポンス文字列",
    "chatbotMessageTextColor": "レスポンス文字列",
    "userMessageTextColor": "レスポンス文字列",
    "chatbotMessageBackgroundColor": "レスポンス文字列",
    "userMessageBackgroundColor": "レスポンス文字列",
    "chatbotMessageBackgroundShadowEnabled": false,
    "userMessageBackgroundShadowEnabled": false,
    "chatbotMessageGradientEnabled": false,
    "userMessageGradientEnabled": false
  },
  "enableFileUpload": false,
  "enableDisplayCitations": false,
  "toolDisplayMode": "full",
  "enableDisplayThinking": false,
  "enableUserThinkingControl": false,
  "enableDisplayQueryMetadata": false,
  "enableShareConversation": false,
  "enableLocation": false,
  "enableShowPoweredBy": false,
  "poweredByLogo": "https://example.com/file.jpg",
  "enableAnonymous": false,
  "enableDisplayPreviousConversation": false,
  "enableDisplayConversationHistory": false,
  "enableConversationTimer": false,
  "conversationTimerDuration": 456,
  "enableAutoNewConversationOnTimeout": false,
  "accessType": {},
  "enableThemeModeToggle": false,
  "enableDisplayFontSizeSwitch": false,
  "defaultThemeMode": {},
  "enableDownloadCitations": false,
  "customDomain": {
    "id": "550e8400-e29b-41d4-a716-446655440000",
    "domain": "レスポンス文字列",
    "status": {}
  },
  "enableDisplayChatbotAvatar": false,
  "enableDisplayChatbotName": false,
  "enableVoiceAgent": false,
  "buttonIcon": "https://example.com/file.jpg",
  "inbox": {
    "id": "550e8400-e29b-41d4-a716-446655440000",
    "name": "レスポンス例の名前",
    "description": "レスポンス例の説明"
  }
}
```

***

### 音声アシスタント Token の取得 <a href="#token" id="token"></a>

POST `/api/web-chats/{id}/voice-agent/token/`

#### パラメータ

| パラメータ名 | 必須 | 型      | 説明                                       |
| ------ | -- | ------ | ---------------------------------------- |
| `id`   | ✅  | string | A UUID string identifying this web chat. |

#### リクエスト内容

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

| フィールド                                           | 型                                          | 必須  | 説明                                                    |
| ----------------------------------------------- | ------------------------------------------ | --- | ----------------------------------------------------- |
| avatar                                          | string (uri)                               | いいえ |                                                       |
| logo                                            | string (uri)                               | いいえ |                                                       |
| description                                     | string                                     | いいえ |                                                       |
| cover                                           | string (uri)                               | いいえ |                                                       |
| backUrl                                         | string                                     | いいえ |                                                       |
| isActive                                        | boolean                                    | いいえ |                                                       |
| theme                                           | object                                     | はい  |                                                       |
| theme.primaryColor                              | string                                     | いいえ |                                                       |
| theme.navbarTextColor                           | string                                     | いいえ |                                                       |
| theme.conversationBackgroundColor               | string                                     | いいえ |                                                       |
| theme.chatbotMessageTextColor                   | string                                     | いいえ |                                                       |
| theme.userMessageTextColor                      | string                                     | いいえ |                                                       |
| theme.chatbotMessageBackgroundColor             | string                                     | いいえ |                                                       |
| theme.userMessageBackgroundColor                | string                                     | いいえ |                                                       |
| theme.chatbotMessageBackgroundShadowEnabled     | boolean                                    | いいえ |                                                       |
| theme.userMessageBackgroundShadowEnabled        | boolean                                    | いいえ |                                                       |
| theme.chatbotMessageGradientEnabled             | boolean                                    | いいえ |                                                       |
| theme.userMessageGradientEnabled                | boolean                                    | いいえ |                                                       |
| darkTheme                                       | object                                     | はい  |                                                       |
| darkTheme.primaryColor                          | string                                     | いいえ |                                                       |
| darkTheme.navbarTextColor                       | string                                     | いいえ |                                                       |
| darkTheme.conversationBackgroundColor           | string                                     | いいえ |                                                       |
| darkTheme.chatbotMessageTextColor               | string                                     | いいえ |                                                       |
| darkTheme.userMessageTextColor                  | string                                     | いいえ |                                                       |
| darkTheme.chatbotMessageBackgroundColor         | string                                     | いいえ |                                                       |
| darkTheme.userMessageBackgroundColor            | string                                     | いいえ |                                                       |
| darkTheme.chatbotMessageBackgroundShadowEnabled | boolean                                    | いいえ |                                                       |
| darkTheme.userMessageBackgroundShadowEnabled    | boolean                                    | いいえ |                                                       |
| darkTheme.chatbotMessageGradientEnabled         | boolean                                    | いいえ |                                                       |
| darkTheme.userMessageGradientEnabled            | boolean                                    | いいえ |                                                       |
| enableFileUpload                                | boolean                                    | いいえ |                                                       |
| enableDisplayCitations                          | boolean                                    | いいえ |                                                       |
| toolDisplayMode                                 | string (enum: full, compact, hidden)       | いいえ | `full`: Full ; `compact`: Compact ; `hidden`: Hidden; |
| enableDisplayThinking                           | boolean                                    | いいえ |                                                       |
| enableUserThinkingControl                       | boolean                                    | いいえ |                                                       |
| enableDisplayQueryMetadata                      | boolean                                    | いいえ |                                                       |
| enableShareConversation                         | boolean                                    | いいえ |                                                       |
| enableLocation                                  | boolean                                    | いいえ |                                                       |
| enableShowPoweredBy                             | boolean                                    | いいえ |                                                       |
| poweredByLogo                                   | string (uri)                               | いいえ |                                                       |
| enableAnonymous                                 | boolean                                    | いいえ |                                                       |
| enableDisplayPreviousConversation               | boolean                                    | いいえ |                                                       |
| enableDisplayConversationHistory                | boolean                                    | いいえ |                                                       |
| enableConversationTimer                         | boolean                                    | いいえ |                                                       |
| conversationTimerDuration                       | integer                                    | いいえ | タイマーのタイムアウト時間。範囲は 3〜60 分です                            |
| enableAutoNewConversationOnTimeout              | boolean                                    | いいえ |                                                       |
| enableThemeModeToggle                           | boolean                                    | いいえ |                                                       |
| enableDisplayFontSizeSwitch                     | boolean                                    | いいえ |                                                       |
| defaultThemeMode                                | object                                     | いいえ |                                                       |
| enableDownloadCitations                         | boolean                                    | いいえ |                                                       |
| customDomain                                    | object (3 個のプロパティ: id, domain, status を含む) | いいえ |                                                       |
| customDomain.domain                             | string                                     | はい  |                                                       |
| enableDisplayChatbotAvatar                      | boolean                                    | いいえ |                                                       |
| enableDisplayChatbotName                        | boolean                                    | いいえ |                                                       |
| enableVoiceAgent                                | boolean                                    | いいえ | WebChat で音声エージェント機能の利用を許可するかどうか                       |
| buttonIcon                                      | string (uri)                               | いいえ |                                                       |

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

```typescript
{
  "avatar"?: string (uri) // 任意
  "logo"?: string (uri) // 任意
  "description"?: string // 任意
  "cover"?: string (uri) // 任意
  "backUrl"?: string // 任意
  "isActive"?: boolean // 任意
  "theme": {
  {
    "primaryColor"?: string // 任意
    "navbarTextColor"?: string // 任意
    "conversationBackgroundColor"?: string // 任意
    "chatbotMessageTextColor"?: string // 任意
    "userMessageTextColor"?: string // 任意
    "chatbotMessageBackgroundColor"?: string // 任意
    "userMessageBackgroundColor"?: string // 任意
    "chatbotMessageBackgroundShadowEnabled"?: boolean // 任意
    "userMessageBackgroundShadowEnabled"?: boolean // 任意
    "chatbotMessageGradientEnabled"?: boolean // 任意
    "userMessageGradientEnabled"?: boolean // 任意
  }
  }
  "darkTheme": {
  {
    "primaryColor"?: string // 任意
    "navbarTextColor"?: string // 任意
    "conversationBackgroundColor"?: string // 任意
    "chatbotMessageTextColor"?: string // 任意
    "userMessageTextColor"?: string // 任意
    "chatbotMessageBackgroundColor"?: string // 任意
    "userMessageBackgroundColor"?: string // 任意
    "chatbotMessageBackgroundShadowEnabled"?: boolean // 任意
    "userMessageBackgroundShadowEnabled"?: boolean // 任意
    "chatbotMessageGradientEnabled"?: boolean // 任意
    "userMessageGradientEnabled"?: boolean // 任意
  }
  }
  "enableFileUpload"?: boolean // 任意
  "enableDisplayCitations"?: boolean // 任意
  "toolDisplayMode"?: string (enum: full, compact, hidden) // * `full` - Full
* `compact` - Compact
* `hidden` - Hidden (任意)
  "enableDisplayThinking"?: boolean // 任意
  "enableUserThinkingControl"?: boolean // 任意
  "enableDisplayQueryMetadata"?: boolean // 任意
  "enableShareConversation"?: boolean // 任意
  "enableLocation"?: boolean // 任意
  "enableShowPoweredBy"?: boolean // 任意
  "poweredByLogo"?: string (uri) // 任意
  "enableAnonymous"?: boolean // 任意
  "enableDisplayPreviousConversation"?: boolean // 任意
  "enableDisplayConversationHistory"?: boolean // 任意
  "enableConversationTimer"?: boolean // 任意
  "conversationTimerDuration"?: integer // タイマーのタイムアウト時間。範囲は 3〜60 分です (任意)
  "enableAutoNewConversationOnTimeout"?: boolean // 任意
  "enableThemeModeToggle"?: boolean // 任意
  "enableDisplayFontSizeSwitch"?: boolean // 任意
  "defaultThemeMode"?:  // 任意
  {
  }
  "enableDownloadCitations"?: boolean // 任意
  "customDomain"?:  // 任意
  {
    "domain": string
  }
  "enableDisplayChatbotAvatar"?: boolean // 任意
  "enableDisplayChatbotName"?: boolean // 任意
  "enableVoiceAgent"?: boolean // WebChat で音声エージェント機能の利用を許可するかどうか (任意)
  "buttonIcon"?: string (uri) // 任意
}
```

**リクエストの例**

```json
{
  "avatar": "https://example.com/file.jpg",
  "logo": "https://example.com/file.jpg",
  "description": "サンプル文字列",
  "cover": "https://example.com/file.jpg",
  "backUrl": "サンプル文字列",
  "isActive": true,
  "theme": {
    "primaryColor": "サンプル文字列",
    "navbarTextColor": "サンプル文字列",
    "conversationBackgroundColor": "サンプル文字列",
    "chatbotMessageTextColor": "サンプル文字列",
    "userMessageTextColor": "サンプル文字列",
    "chatbotMessageBackgroundColor": "サンプル文字列",
    "userMessageBackgroundColor": "サンプル文字列",
    "chatbotMessageBackgroundShadowEnabled": true,
    "userMessageBackgroundShadowEnabled": true,
    "chatbotMessageGradientEnabled": true,
    "userMessageGradientEnabled": true
  },
  "darkTheme": {
    "primaryColor": "サンプル文字列",
    "navbarTextColor": "サンプル文字列",
    "conversationBackgroundColor": "サンプル文字列",
    "chatbotMessageTextColor": "サンプル文字列",
    "userMessageTextColor": "サンプル文字列",
    "chatbotMessageBackgroundColor": "サンプル文字列",
    "userMessageBackgroundColor": "サンプル文字列",
    "chatbotMessageBackgroundShadowEnabled": true,
    "userMessageBackgroundShadowEnabled": true,
    "chatbotMessageGradientEnabled": true,
    "userMessageGradientEnabled": true
  },
  "enableFileUpload": true,
  "enableDisplayCitations": true,
  "toolDisplayMode": "full",
  "enableDisplayThinking": true,
  "enableUserThinkingControl": true,
  "enableDisplayQueryMetadata": true,
  "enableShareConversation": true,
  "enableLocation": true,
  "enableShowPoweredBy": true,
  "poweredByLogo": "https://example.com/file.jpg",
  "enableAnonymous": true,
  "enableDisplayPreviousConversation": true,
  "enableDisplayConversationHistory": true,
  "enableConversationTimer": true,
  "conversationTimerDuration": 123,
  "enableAutoNewConversationOnTimeout": true,
  "enableThemeModeToggle": true,
  "enableDisplayFontSizeSwitch": true,
  "defaultThemeMode": {},
  "enableDownloadCitations": true,
  "customDomain": {
    "domain": "サンプル文字列"
  },
  "enableDisplayChatbotAvatar": true,
  "enableDisplayChatbotName": true,
  "enableVoiceAgent": true,
  "buttonIcon": "https://example.com/file.jpg"
}
```

#### コード例

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

```bash
# API 呼び出しの例 (Shell)
curl -X POST "https://api.maiagent.ai/api/web-chats/550e8400-e29b-41d4-a716-446655440000/voice-agent/token/" \
  -H "Authorization: Api-Key YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "avatar": "https://example.com/file.jpg",
    "logo": "https://example.com/file.jpg",
    "description": "サンプル文字列",
    "cover": "https://example.com/file.jpg",
    "backUrl": "サンプル文字列",
    "isActive": true,
    "theme": {
      "primaryColor": "サンプル文字列",
      "navbarTextColor": "サンプル文字列",
      "conversationBackgroundColor": "サンプル文字列",
      "chatbotMessageTextColor": "サンプル文字列",
      "userMessageTextColor": "サンプル文字列",
      "chatbotMessageBackgroundColor": "サンプル文字列",
      "userMessageBackgroundColor": "サンプル文字列",
      "chatbotMessageBackgroundShadowEnabled": true,
      "userMessageBackgroundShadowEnabled": true,
      "chatbotMessageGradientEnabled": true,
      "userMessageGradientEnabled": true
    },
    "darkTheme": {
      "primaryColor": "サンプル文字列",
      "navbarTextColor": "サンプル文字列",
      "conversationBackgroundColor": "サンプル文字列",
      "chatbotMessageTextColor": "サンプル文字列",
      "userMessageTextColor": "サンプル文字列",
      "chatbotMessageBackgroundColor": "サンプル文字列",
      "userMessageBackgroundColor": "サンプル文字列",
      "chatbotMessageBackgroundShadowEnabled": true,
      "userMessageBackgroundShadowEnabled": true,
      "chatbotMessageGradientEnabled": true,
      "userMessageGradientEnabled": true
    },
    "enableFileUpload": true,
    "enableDisplayCitations": true,
    "toolDisplayMode": "full",
    "enableDisplayThinking": true,
    "enableUserThinkingControl": true,
    "enableDisplayQueryMetadata": true,
    "enableShareConversation": true,
    "enableLocation": true,
    "enableShowPoweredBy": true,
    "poweredByLogo": "https://example.com/file.jpg",
    "enableAnonymous": true,
    "enableDisplayPreviousConversation": true,
    "enableDisplayConversationHistory": true,
    "enableConversationTimer": true,
    "conversationTimerDuration": 123,
    "enableAutoNewConversationOnTimeout": true,
    "enableThemeModeToggle": true,
    "enableDisplayFontSizeSwitch": true,
    "defaultThemeMode": {},
    "enableDownloadCitations": true,
    "customDomain": {
      "domain": "サンプル文字列"
    },
    "enableDisplayChatbotAvatar": true,
    "enableDisplayChatbotName": true,
    "enableVoiceAgent": true,
    "buttonIcon": "https://example.com/file.jpg"
  }'

# 実行前に 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 = {
    "avatar": "https://example.com/file.jpg",
    "logo": "https://example.com/file.jpg",
    "description": "サンプル文字列",
    "cover": "https://example.com/file.jpg",
    "backUrl": "サンプル文字列",
    "isActive": true,
    "theme": {
      "primaryColor": "サンプル文字列",
      "navbarTextColor": "サンプル文字列",
      "conversationBackgroundColor": "サンプル文字列",
      "chatbotMessageTextColor": "サンプル文字列",
      "userMessageTextColor": "サンプル文字列",
      "chatbotMessageBackgroundColor": "サンプル文字列",
      "userMessageBackgroundColor": "サンプル文字列",
      "chatbotMessageBackgroundShadowEnabled": true,
      "userMessageBackgroundShadowEnabled": true,
      "chatbotMessageGradientEnabled": true,
      "userMessageGradientEnabled": true
    },
    "darkTheme": {
      "primaryColor": "サンプル文字列",
      "navbarTextColor": "サンプル文字列",
      "conversationBackgroundColor": "サンプル文字列",
      "chatbotMessageTextColor": "サンプル文字列",
      "userMessageTextColor": "サンプル文字列",
      "chatbotMessageBackgroundColor": "サンプル文字列",
      "userMessageBackgroundColor": "サンプル文字列",
      "chatbotMessageBackgroundShadowEnabled": true,
      "userMessageBackgroundShadowEnabled": true,
      "chatbotMessageGradientEnabled": true,
      "userMessageGradientEnabled": true
    },
    "enableFileUpload": true,
    "enableDisplayCitations": true,
    "toolDisplayMode": "full",
    "enableDisplayThinking": true,
    "enableUserThinkingControl": true,
    "enableDisplayQueryMetadata": true,
    "enableShareConversation": true,
    "enableLocation": true,
    "enableShowPoweredBy": true,
    "poweredByLogo": "https://example.com/file.jpg",
    "enableAnonymous": true,
    "enableDisplayPreviousConversation": true,
    "enableDisplayConversationHistory": true,
    "enableConversationTimer": true,
    "conversationTimerDuration": 123,
    "enableAutoNewConversationOnTimeout": true,
    "enableThemeModeToggle": true,
    "enableDisplayFontSizeSwitch": true,
    "defaultThemeMode": {},
    "enableDownloadCitations": true,
    "customDomain": {
      "domain": "サンプル文字列"
    },
    "enableDisplayChatbotAvatar": true,
    "enableDisplayChatbotName": true,
    "enableVoiceAgent": true,
    "buttonIcon": "https://example.com/file.jpg"
  };

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

# リクエスト内容 (payload)
data = {
      "avatar": "https://example.com/file.jpg",
      "logo": "https://example.com/file.jpg",
      "description": "サンプル文字列",
      "cover": "https://example.com/file.jpg",
      "backUrl": "サンプル文字列",
      "isActive": true,
      "theme": {
        "primaryColor": "サンプル文字列",
        "navbarTextColor": "サンプル文字列",
        "conversationBackgroundColor": "サンプル文字列",
        "chatbotMessageTextColor": "サンプル文字列",
        "userMessageTextColor": "サンプル文字列",
        "chatbotMessageBackgroundColor": "サンプル文字列",
        "userMessageBackgroundColor": "サンプル文字列",
        "chatbotMessageBackgroundShadowEnabled": true,
        "userMessageBackgroundShadowEnabled": true,
        "chatbotMessageGradientEnabled": true,
        "userMessageGradientEnabled": true
      },
      "darkTheme": {
        "primaryColor": "サンプル文字列",
        "navbarTextColor": "サンプル文字列",
        "conversationBackgroundColor": "サンプル文字列",
        "chatbotMessageTextColor": "サンプル文字列",
        "userMessageTextColor": "サンプル文字列",
        "chatbotMessageBackgroundColor": "サンプル文字列",
        "userMessageBackgroundColor": "サンプル文字列",
        "chatbotMessageBackgroundShadowEnabled": true,
        "userMessageBackgroundShadowEnabled": true,
        "chatbotMessageGradientEnabled": true,
        "userMessageGradientEnabled": true
      },
      "enableFileUpload": true,
      "enableDisplayCitations": true,
      "toolDisplayMode": "full",
      "enableDisplayThinking": true,
      "enableUserThinkingControl": true,
      "enableDisplayQueryMetadata": true,
      "enableShareConversation": true,
      "enableLocation": true,
      "enableShowPoweredBy": true,
      "poweredByLogo": "https://example.com/file.jpg",
      "enableAnonymous": true,
      "enableDisplayPreviousConversation": true,
      "enableDisplayConversationHistory": true,
      "enableConversationTimer": true,
      "conversationTimerDuration": 123,
      "enableAutoNewConversationOnTimeout": true,
      "enableThemeModeToggle": true,
      "enableDisplayFontSizeSwitch": true,
      "defaultThemeMode": {},
      "enableDownloadCitations": true,
      "customDomain": {
        "domain": "サンプル文字列"
      },
      "enableDisplayChatbotAvatar": true,
      "enableDisplayChatbotName": true,
      "enableVoiceAgent": true,
      "buttonIcon": "https://example.com/file.jpg"
    }

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/web-chats/550e8400-e29b-41d4-a716-446655440000/voice-agent/token/", [
        'headers' => [
            'Authorization' => 'Api-Key YOUR_API_KEY',
            'Content-Type' => 'application/json'
        ],
        'json' => {
            "avatar": "https://example.com/file.jpg",
            "logo": "https://example.com/file.jpg",
            "description": "サンプル文字列",
            "cover": "https://example.com/file.jpg",
            "backUrl": "サンプル文字列",
            "isActive": true,
            "theme": {
                "primaryColor": "サンプル文字列",
                "navbarTextColor": "サンプル文字列",
                "conversationBackgroundColor": "サンプル文字列",
                "chatbotMessageTextColor": "サンプル文字列",
                "userMessageTextColor": "サンプル文字列",
                "chatbotMessageBackgroundColor": "サンプル文字列",
                "userMessageBackgroundColor": "サンプル文字列",
                "chatbotMessageBackgroundShadowEnabled": true,
                "userMessageBackgroundShadowEnabled": true,
                "chatbotMessageGradientEnabled": true,
                "userMessageGradientEnabled": true
            },
            "darkTheme": {
                "primaryColor": "サンプル文字列",
                "navbarTextColor": "サンプル文字列",
                "conversationBackgroundColor": "サンプル文字列",
                "chatbotMessageTextColor": "サンプル文字列",
                "userMessageTextColor": "サンプル文字列",
                "chatbotMessageBackgroundColor": "サンプル文字列",
                "userMessageBackgroundColor": "サンプル文字列",
                "chatbotMessageBackgroundShadowEnabled": true,
                "userMessageBackgroundShadowEnabled": true,
                "chatbotMessageGradientEnabled": true,
                "userMessageGradientEnabled": true
            },
            "enableFileUpload": true,
            "enableDisplayCitations": true,
            "toolDisplayMode": "full",
            "enableDisplayThinking": true,
            "enableUserThinkingControl": true,
            "enableDisplayQueryMetadata": true,
            "enableShareConversation": true,
            "enableLocation": true,
            "enableShowPoweredBy": true,
            "poweredByLogo": "https://example.com/file.jpg",
            "enableAnonymous": true,
            "enableDisplayPreviousConversation": true,
            "enableDisplayConversationHistory": true,
            "enableConversationTimer": true,
            "conversationTimerDuration": 123,
            "enableAutoNewConversationOnTimeout": true,
            "enableThemeModeToggle": true,
            "enableDisplayFontSizeSwitch": true,
            "defaultThemeMode": {},
            "enableDownloadCitations": true,
            "customDomain": {
                "domain": "サンプル文字列"
            },
            "enableDisplayChatbotAvatar": true,
            "enableDisplayChatbotName": true,
            "enableVoiceAgent": true,
            "buttonIcon": "https://example.com/file.jpg"
        }
    ]);
    
    $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
  "avatar"?: string (uri) // 任意
  "logo"?: string (uri) // 任意
  "description"?: string // 任意
  "cover"?: string (uri) // 任意
  "backUrl"?: string // 任意
  "isActive"?: boolean // 任意
  "enableSpeech": boolean
  "displayConversationStarters": [
    string
  ]
  "theme": {
  {
    "primaryColor"?: string // 任意
    "navbarTextColor"?: string // 任意
    "conversationBackgroundColor"?: string // 任意
    "chatbotMessageTextColor"?: string // 任意
    "userMessageTextColor"?: string // 任意
    "chatbotMessageBackgroundColor"?: string // 任意
    "userMessageBackgroundColor"?: string // 任意
    "chatbotMessageBackgroundShadowEnabled"?: boolean // 任意
    "userMessageBackgroundShadowEnabled"?: boolean // 任意
    "chatbotMessageGradientEnabled"?: boolean // 任意
    "userMessageGradientEnabled"?: boolean // 任意
  }
  }
  "darkTheme": {
  {
    "primaryColor"?: string // 任意
    "navbarTextColor"?: string // 任意
    "conversationBackgroundColor"?: string // 任意
    "chatbotMessageTextColor"?: string // 任意
    "userMessageTextColor"?: string // 任意
    "chatbotMessageBackgroundColor"?: string // 任意
    "userMessageBackgroundColor"?: string // 任意
    "chatbotMessageBackgroundShadowEnabled"?: boolean // 任意
    "userMessageBackgroundShadowEnabled"?: boolean // 任意
    "chatbotMessageGradientEnabled"?: boolean // 任意
    "userMessageGradientEnabled"?: boolean // 任意
  }
  }
  "enableFileUpload"?: boolean // 任意
  "enableDisplayCitations"?: boolean // 任意
  "toolDisplayMode"?: string (enum: full, compact, hidden) // * `full` - Full
* `compact` - Compact
* `hidden` - Hidden (任意)
  "enableDisplayThinking"?: boolean // 任意
  "enableUserThinkingControl"?: boolean // 任意
  "enableDisplayQueryMetadata"?: boolean // 任意
  "enableShareConversation"?: boolean // 任意
  "enableLocation"?: boolean // 任意
  "enableShowPoweredBy"?: boolean // 任意
  "poweredByLogo"?: string (uri) // 任意
  "enableAnonymous"?: boolean // 任意
  "enableDisplayPreviousConversation"?: boolean // 任意
  "enableDisplayConversationHistory"?: boolean // 任意
  "enableConversationTimer"?: boolean // 任意
  "conversationTimerDuration"?: integer // タイマーのタイムアウト時間。範囲は 3〜60 分です (任意)
  "enableAutoNewConversationOnTimeout"?: boolean // 任意
  "accessType": 
  {
  }
  "enableThemeModeToggle"?: boolean // 任意
  "enableDisplayFontSizeSwitch"?: boolean // 任意
  "defaultThemeMode"?:  // 任意
  {
  }
  "enableDownloadCitations"?: boolean // 任意
  "customDomain"?:  // 任意
  {
    "id": string (uuid)
    "domain": string
    "status": 
    {
    }
  }
  "enableDisplayChatbotAvatar"?: boolean // 任意
  "enableDisplayChatbotName"?: boolean // 任意
  "enableVoiceAgent"?: boolean // WebChat で音声エージェント機能の利用を許可するかどうか (任意)
  "buttonIcon"?: string (uri) // 任意
  "inbox": object
}
```

**レスポンスの例**

```json
{
  "id": "550e8400-e29b-41d4-a716-446655440000",
  "name": "レスポンス文字列",
  "avatar": "https://example.com/file.jpg",
  "logo": "https://example.com/file.jpg",
  "description": "レスポンス文字列",
  "cover": "https://example.com/file.jpg",
  "backUrl": "レスポンス文字列",
  "isActive": false,
  "enableSpeech": false,
  "displayConversationStarters": [
    "レスポンス文字列"
  ],
  "theme": {
    "primaryColor": "レスポンス文字列",
    "navbarTextColor": "レスポンス文字列",
    "conversationBackgroundColor": "レスポンス文字列",
    "chatbotMessageTextColor": "レスポンス文字列",
    "userMessageTextColor": "レスポンス文字列",
    "chatbotMessageBackgroundColor": "レスポンス文字列",
    "userMessageBackgroundColor": "レスポンス文字列",
    "chatbotMessageBackgroundShadowEnabled": false,
    "userMessageBackgroundShadowEnabled": false,
    "chatbotMessageGradientEnabled": false,
    "userMessageGradientEnabled": false
  },
  "darkTheme": {
    "primaryColor": "レスポンス文字列",
    "navbarTextColor": "レスポンス文字列",
    "conversationBackgroundColor": "レスポンス文字列",
    "chatbotMessageTextColor": "レスポンス文字列",
    "userMessageTextColor": "レスポンス文字列",
    "chatbotMessageBackgroundColor": "レスポンス文字列",
    "userMessageBackgroundColor": "レスポンス文字列",
    "chatbotMessageBackgroundShadowEnabled": false,
    "userMessageBackgroundShadowEnabled": false,
    "chatbotMessageGradientEnabled": false,
    "userMessageGradientEnabled": false
  },
  "enableFileUpload": false,
  "enableDisplayCitations": false,
  "toolDisplayMode": "full",
  "enableDisplayThinking": false,
  "enableUserThinkingControl": false,
  "enableDisplayQueryMetadata": false,
  "enableShareConversation": false,
  "enableLocation": false,
  "enableShowPoweredBy": false,
  "poweredByLogo": "https://example.com/file.jpg",
  "enableAnonymous": false,
  "enableDisplayPreviousConversation": false,
  "enableDisplayConversationHistory": false,
  "enableConversationTimer": false,
  "conversationTimerDuration": 456,
  "enableAutoNewConversationOnTimeout": false,
  "accessType": {},
  "enableThemeModeToggle": false,
  "enableDisplayFontSizeSwitch": false,
  "defaultThemeMode": {},
  "enableDownloadCitations": false,
  "customDomain": {
    "id": "550e8400-e29b-41d4-a716-446655440000",
    "domain": "レスポンス文字列",
    "status": {}
  },
  "enableDisplayChatbotAvatar": false,
  "enableDisplayChatbotName": false,
  "enableVoiceAgent": false,
  "buttonIcon": "https://example.com/file.jpg",
  "inbox": {
    "id": "550e8400-e29b-41d4-a716-446655440000",
    "name": "レスポンス例の名前",
    "description": "レスポンス例の説明"
  }
}
```

***

### 一括 QA ファイルのアップロード <a href="#qa" id="qa"></a>

POST `/api/v1/web-chats/{webchatPk}/batch-qas/`

#### パラメータ

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

#### リクエスト内容

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

| フィールド | 型            | 必須 | 説明 |
| ----- | ------------ | -- | -- |
| file  | string (uri) | はい |    |

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

```typescript
{
  "file": string (uri)
}
```

**リクエストの例**

```json
{
  "file": "https://example.com/file.jpg"
}
```

#### コード例

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

```bash
# API 呼び出しの例 (Shell)
curl -X POST "https://api.maiagent.ai/api/v1/web-chats/550e8400-e29b-41d4-a716-446655440000/batch-qas/" \
  -H "Authorization: Api-Key YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "file": "https://example.com/file.jpg"
  }'

# 実行前に 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 = {
    "file": "https://example.com/file.jpg"
  };

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

# リクエスト内容 (payload)
data = {
      "file": "https://example.com/file.jpg"
    }

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/web-chats/550e8400-e29b-41d4-a716-446655440000/batch-qas/", [
        'headers' => [
            'Authorization' => 'Api-Key YOUR_API_KEY',
            'Content-Type' => 'application/json'
        ],
        'json' => {
            "file": "https://example.com/file.jpg"
        }
    ]);
    
    $data = json_decode($response->getBody(), true);
    echo "レスポンスの取得に成功しました:\n";
    print_r($data);
} catch (Exception $e) {
    echo 'リクエストでエラーが発生しました: ' . $e->getMessage();
}
?>
```

{% endtab %}
{% endtabs %}

#### レスポンス内容

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

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

```typescript
{
  "id": string (uuid)
  "file": string (uri)
  "createdAt": string (timestamp)
}
```

**レスポンスの例**

```json
{
  "id": "550e8400-e29b-41d4-a716-446655440000",
  "file": "https://example.com/file.jpg",
  "createdAt": "レスポンス文字列"
}
```

***

### 一括 QA ファイルのアップロード <a href="#qa" id="qa"></a>

POST `/api/web-chats/{webchatPk}/batch-qas/`

#### パラメータ

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

#### リクエスト内容

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

| フィールド | 型            | 必須 | 説明 |
| ----- | ------------ | -- | -- |
| file  | string (uri) | はい |    |

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

```typescript
{
  "file": string (uri)
}
```

**リクエストの例**

```json
{
  "file": "https://example.com/file.jpg"
}
```

#### コード例

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

```bash
# API 呼び出しの例 (Shell)
curl -X POST "https://api.maiagent.ai/api/web-chats/550e8400-e29b-41d4-a716-446655440000/batch-qas/" \
  -H "Authorization: Api-Key YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "file": "https://example.com/file.jpg"
  }'

# 実行前に 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 = {
    "file": "https://example.com/file.jpg"
  };

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

# リクエスト内容 (payload)
data = {
      "file": "https://example.com/file.jpg"
    }

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/web-chats/550e8400-e29b-41d4-a716-446655440000/batch-qas/", [
        'headers' => [
            'Authorization' => 'Api-Key YOUR_API_KEY',
            'Content-Type' => 'application/json'
        ],
        'json' => {
            "file": "https://example.com/file.jpg"
        }
    ]);
    
    $data = json_decode($response->getBody(), true);
    echo "レスポンスの取得に成功しました:\n";
    print_r($data);
} catch (Exception $e) {
    echo 'リクエストでエラーが発生しました: ' . $e->getMessage();
}
?>
```

{% endtab %}
{% endtabs %}

#### レスポンス内容

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

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

```typescript
{
  "id": string (uuid)
  "file": string (uri)
  "createdAt": string (timestamp)
}
```

**レスポンスの例**

```json
{
  "id": "550e8400-e29b-41d4-a716-446655440000",
  "file": "https://example.com/file.jpg",
  "createdAt": "レスポンス文字列"
}
```

***

### 一括 QA を Excel にエクスポート <a href="#qa-excel" id="qa-excel"></a>

GET `/api/v1/web-chats/{webchatPk}/batch-qas/{id}/export-excel/`

#### パラメータ

| パラメータ名      | 必須 | 型      | 説明                                     |
| ----------- | -- | ------ | -------------------------------------- |
| `id`        | ✅  | string | この Chatbot 一括 QA ファイルを識別する UUID 文字列です。 |
| `webchatPk` | ✅  | string |                                        |

#### コード例

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

```bash
# API 呼び出しの例 (Shell)
curl -X GET "https://api.maiagent.ai/api/v1/web-chats/550e8400-e29b-41d4-a716-446655440000/batch-qas/550e8400-e29b-41d4-a716-446655440000/export-excel/" \
  -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/web-chats/550e8400-e29b-41d4-a716-446655440000/batch-qas/550e8400-e29b-41d4-a716-446655440000/export-excel/", 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/web-chats/550e8400-e29b-41d4-a716-446655440000/batch-qas/550e8400-e29b-41d4-a716-446655440000/export-excel/"
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/web-chats/550e8400-e29b-41d4-a716-446655440000/batch-qas/550e8400-e29b-41d4-a716-446655440000/export-excel/", [
        '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      | Excel ファイルのダウンロード |

***

### 一括 QA を Excel にエクスポート <a href="#qa-excel" id="qa-excel"></a>

GET `/api/web-chats/{webchatPk}/batch-qas/{id}/export-excel/`

#### パラメータ

| パラメータ名      | 必須 | 型      | 説明                                     |
| ----------- | -- | ------ | -------------------------------------- |
| `id`        | ✅  | string | この Chatbot 一括 QA ファイルを識別する UUID 文字列です。 |
| `webchatPk` | ✅  | string |                                        |

#### コード例

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

```bash
# API 呼び出しの例 (Shell)
curl -X GET "https://api.maiagent.ai/api/web-chats/550e8400-e29b-41d4-a716-446655440000/batch-qas/550e8400-e29b-41d4-a716-446655440000/export-excel/" \
  -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/web-chats/550e8400-e29b-41d4-a716-446655440000/batch-qas/550e8400-e29b-41d4-a716-446655440000/export-excel/", 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/web-chats/550e8400-e29b-41d4-a716-446655440000/batch-qas/550e8400-e29b-41d4-a716-446655440000/export-excel/"
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/web-chats/550e8400-e29b-41d4-a716-446655440000/batch-qas/550e8400-e29b-41d4-a716-446655440000/export-excel/", [
        '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      | Excel ファイルのダウンロード |

***

### LLM 利用統計の取得 <a href="#llm" id="llm"></a>

GET `/api/chatbots/{chatbotPk}/llm-usage-statistics/`

#### パラメータ

| パラメータ名            | 必須 | 型      | 説明                                        |
| ----------------- | -- | ------ | ----------------------------------------- |
| `chatbotPk`       | ✅  | string | A UUID string identifying this Chatbot ID |
| `endDate`         | ❌  | string | 終了日。形式: YYYY-MM-DD                        |
| `startDate`       | ✅  | string | 開始日。形式: YYYY-MM-DD                        |
| `timeGranularity` | ✅  | string | 時間粒度 (day/month)                          |

#### コード例

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

```bash
# API 呼び出しの例 (Shell)
curl -X GET "https://api.maiagent.ai/api/chatbots/550e8400-e29b-41d4-a716-446655440000/llm-usage-statistics/?endDate=example&startDate=example&timeGranularity=day" \
  -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/chatbots/550e8400-e29b-41d4-a716-446655440000/llm-usage-statistics/?endDate=example&startDate=example&timeGranularity=day", 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/chatbots/550e8400-e29b-41d4-a716-446655440000/llm-usage-statistics/?endDate=example&startDate=example&timeGranularity=day"
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/chatbots/550e8400-e29b-41d4-a716-446655440000/llm-usage-statistics/?endDate=example&startDate=example&timeGranularity=day", [
        '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
[
  {
    "date": string (date)
  }
]
```

**レスポンスの例**

```json
[
  [
    {
      "totalWordsCount": 511,
      "month": "2025-03-01",
      "llmDetails": [
        {
          "chatbotId": "5b646600-f6e0-4f07-aec7-0207a26c0a9b",
          "wordsCount": 511,
          "llmModelId": "d4282719-f50e-4a82-88d0-953e202a3383",
          "llmModelName": "GPT-4o-2024-08-06",
          "llmModelProvider": "openai"
        }
      ]
    }
  ]
]
```

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

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

```typescript
{
  "detail"?: string // 任意
  "valid_types"?: [ // 任意
    string
  ]
}
```

**レスポンスの例**

```json
[
  [
    {
      "totalWordsCount": 511,
      "month": "2025-03-01",
      "llmDetails": [
        {
          "chatbotId": "5b646600-f6e0-4f07-aec7-0207a26c0a9b",
          "wordsCount": 511,
          "llmModelId": "d4282719-f50e-4a82-88d0-953e202a3383",
          "llmModelName": "GPT-4o-2024-08-06",
          "llmModelProvider": "openai"
        }
      ]
    }
  ]
]
```

***

### LLM 利用統計の取得 <a href="#llm" id="llm"></a>

GET `/api/v1/chatbots/{chatbotPk}/llm-usage-statistics/`

#### パラメータ

| パラメータ名            | 必須 | 型      | 説明                                        |
| ----------------- | -- | ------ | ----------------------------------------- |
| `chatbotPk`       | ✅  | string | A UUID string identifying this Chatbot ID |
| `endDate`         | ❌  | string | 終了日。形式: YYYY-MM-DD                        |
| `startDate`       | ✅  | string | 開始日。形式: YYYY-MM-DD                        |
| `timeGranularity` | ✅  | string | 時間粒度 (day/month)                          |

#### コード例

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

```bash
# API 呼び出しの例 (Shell)
curl -X GET "https://api.maiagent.ai/api/v1/chatbots/550e8400-e29b-41d4-a716-446655440000/llm-usage-statistics/?endDate=example&startDate=example&timeGranularity=day" \
  -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/chatbots/550e8400-e29b-41d4-a716-446655440000/llm-usage-statistics/?endDate=example&startDate=example&timeGranularity=day", 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/chatbots/550e8400-e29b-41d4-a716-446655440000/llm-usage-statistics/?endDate=example&startDate=example&timeGranularity=day"
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/chatbots/550e8400-e29b-41d4-a716-446655440000/llm-usage-statistics/?endDate=example&startDate=example&timeGranularity=day", [
        '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
[
  {
    "date": string (date)
  }
]
```

**レスポンスの例**

```json
[
  [
    {
      "totalWordsCount": 511,
      "month": "2025-03-01",
      "llmDetails": [
        {
          "chatbotId": "5b646600-f6e0-4f07-aec7-0207a26c0a9b",
          "wordsCount": 511,
          "llmModelId": "d4282719-f50e-4a82-88d0-953e202a3383",
          "llmModelName": "GPT-4o-2024-08-06",
          "llmModelProvider": "openai"
        }
      ]
    }
  ]
]
```

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

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

```typescript
{
  "detail"?: string // 任意
  "valid_types"?: [ // 任意
    string
  ]
}
```

**レスポンスの例**

```json
[
  [
    {
      "totalWordsCount": 511,
      "month": "2025-03-01",
      "llmDetails": [
        {
          "chatbotId": "5b646600-f6e0-4f07-aec7-0207a26c0a9b",
          "wordsCount": 511,
          "llmModelId": "d4282719-f50e-4a82-88d0-953e202a3383",
          "llmModelName": "GPT-4o-2024-08-06",
          "llmModelProvider": "openai"
        }
      ]
    }
  ]
]
```

***

### AI アシスタント統計データの取得 <a href="#ai" id="ai"></a>

GET `/api/chatbots/{chatbotPk}/statistics/`

#### パラメータ

| パラメータ名            | 必須 | 型      | 説明                                        |
| ----------------- | -- | ------ | ----------------------------------------- |
| `chatbotPk`       | ✅  | string | A UUID string identifying this Chatbot ID |
| `datetimeFrom`    | ❌  | string | 開始時刻                                      |
| `datetimeTo`      | ❌  | string | 終了時刻                                      |
| `timeGranularity` | ❌  | string | 時間粒度 (hour/day/month)                     |

#### コード例

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

```bash
# API 呼び出しの例 (Shell)
curl -X GET "https://api.maiagent.ai/api/chatbots/550e8400-e29b-41d4-a716-446655440000/statistics/?datetimeFrom=example&datetimeTo=example&timeGranularity=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/chatbots/550e8400-e29b-41d4-a716-446655440000/statistics/?datetimeFrom=example&datetimeTo=example&timeGranularity=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/chatbots/550e8400-e29b-41d4-a716-446655440000/statistics/?datetimeFrom=example&datetimeTo=example&timeGranularity=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/chatbots/550e8400-e29b-41d4-a716-446655440000/statistics/?datetimeFrom=example&datetimeTo=example&timeGranularity=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
[
  {
    "datetime": integer // タイムスタンプ（ミリ秒）
    "messagesCount": integer // メッセージ数
    "conversationsCount": integer // 会話数
    "likesCount": integer // 高評価数
    "dislikesCount": integer // 低評価数
  }
]
```

**レスポンスの例**

```json
[
  {
    "datetime": 456,
    "messagesCount": 456,
    "conversationsCount": 456,
    "likesCount": 456,
    "dislikesCount": 456
  }
]
```

***

### AI アシスタント統計データの取得 <a href="#ai" id="ai"></a>

GET `/api/v1/chatbots/{chatbotPk}/statistics/`

#### パラメータ

| パラメータ名            | 必須 | 型      | 説明                                        |
| ----------------- | -- | ------ | ----------------------------------------- |
| `chatbotPk`       | ✅  | string | A UUID string identifying this Chatbot ID |
| `datetimeFrom`    | ❌  | string | 開始時刻                                      |
| `datetimeTo`      | ❌  | string | 終了時刻                                      |
| `timeGranularity` | ❌  | string | 時間粒度 (hour/day/month)                     |

#### コード例

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

```bash
# API 呼び出しの例 (Shell)
curl -X GET "https://api.maiagent.ai/api/v1/chatbots/550e8400-e29b-41d4-a716-446655440000/statistics/?datetimeFrom=example&datetimeTo=example&timeGranularity=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/chatbots/550e8400-e29b-41d4-a716-446655440000/statistics/?datetimeFrom=example&datetimeTo=example&timeGranularity=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/chatbots/550e8400-e29b-41d4-a716-446655440000/statistics/?datetimeFrom=example&datetimeTo=example&timeGranularity=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/chatbots/550e8400-e29b-41d4-a716-446655440000/statistics/?datetimeFrom=example&datetimeTo=example&timeGranularity=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
[
  {
    "datetime": integer // タイムスタンプ（ミリ秒）
    "messagesCount": integer // メッセージ数
    "conversationsCount": integer // 会話数
    "likesCount": integer // 高評価数
    "dislikesCount": integer // 低評価数
  }
]
```

**レスポンスの例**

```json
[
  {
    "datetime": 456,
    "messagesCount": 456,
    "conversationsCount": 456,
    "likesCount": 456,
    "dislikesCount": 456
  }
]
```

***


---

# 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 dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.maiagent.ai/api/api-doc-ja/api-reference/dui-hua-widget.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
