> ## Documentation Index
> Fetch the complete documentation index at: https://docs.gnani.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Update Chat Widget Config

> Update Chat Widget visual customizations and settings for an agent

## Overview

Update the visual customizations and settings for the Chat Widget embedded in your product. All fields are optional — only the fields you include are updated. Unspecified fields retain their current values.

Requires the `ORG_ADMIN` or `DEVELOPER` role. The `QA` role does not have write access to widget settings.

## Required Permission

`agents` with `ORG_ADMIN` or `DEVELOPER` role

## Path Parameters

| Name    | Type   | Required | Description              |
| ------- | ------ | -------- | ------------------------ |
| `botId` | string | Yes      | Unique agent identifier. |

## Request Body Fields

| Field                                                              | Type      | Description                                             |
| ------------------------------------------------------------------ | --------- | ------------------------------------------------------- |
| `chatSdkConfig.enabled`                                            | boolean   | Enable or disable the Chat Widget.                      |
| `chatSdkConfig.allowedOrigins`                                     | string\[] | Domains permitted to embed the widget (CORS whitelist). |
| `chatSdkConfig.windowCustomizations.header.title`                  | string    | Chat window title text.                                 |
| `chatSdkConfig.windowCustomizations.header.subtitle`               | string    | Subtitle text below the title.                          |
| `chatSdkConfig.windowCustomizations.header.logo`                   | string    | URL of the logo shown in the header.                    |
| `chatSdkConfig.windowCustomizations.header.backgroundColor`        | string    | Header background color (hex, e.g. `#1A73E8`).          |
| `chatSdkConfig.windowCustomizations.header.textColor`              | string    | Header text color (hex).                                |
| `chatSdkConfig.windowCustomizations.body.backgroundColor`          | string    | Chat transcript area background color.                  |
| `chatSdkConfig.windowCustomizations.body.fontSize`                 | string    | Transcript text font size (e.g. `"14px"`).              |
| `chatSdkConfig.windowCustomizations.body.textColor`                | string    | Transcript text color.                                  |
| `chatSdkConfig.windowCustomizations.userMessage.backgroundColor`   | string    | User message bubble background color.                   |
| `chatSdkConfig.windowCustomizations.userMessage.fontSize`          | string    | User message font size.                                 |
| `chatSdkConfig.windowCustomizations.userMessage.textColor`         | string    | User message text color.                                |
| `chatSdkConfig.windowCustomizations.botMessage.backgroundColor`    | string    | Agent message bubble background color.                  |
| `chatSdkConfig.windowCustomizations.botMessage.fontSize`           | string    | Agent message font size.                                |
| `chatSdkConfig.windowCustomizations.botMessage.textColor`          | string    | Agent message text color.                               |
| `chatSdkConfig.windowCustomizations.footer.backgroundColor`        | string    | Footer background color.                                |
| `chatSdkConfig.windowCustomizations.footer.textColor`              | string    | Footer text color.                                      |
| `chatSdkConfig.windowCustomizations.footer.fontSize`               | string    | Footer font size.                                       |
| `chatSdkConfig.windowCustomizations.footer.infoText`               | string    | Footer info text (e.g. `"Powered by Inya"`).            |
| `chatSdkConfig.windowCustomizations.footer.input.backgroundColor`  | string    | Text input field background color.                      |
| `chatSdkConfig.windowCustomizations.footer.input.borderColor`      | string    | Text input field border color.                          |
| `chatSdkConfig.windowCustomizations.footer.input.textColor`        | string    | Text input field text color.                            |
| `chatSdkConfig.windowCustomizations.footer.input.placeholder`      | string    | Placeholder text in the input field.                    |
| `chatSdkConfig.windowCustomizations.footer.button.backgroundColor` | string    | Send button background color.                           |
| `chatSdkConfig.windowCustomizations.footer.button.textColor`       | string    | Send button icon/text color.                            |
| `chatSdkConfig.widgetCustomizations.buttonStyles.backgroundColor`  | string    | Launcher button background color.                       |
| `chatSdkConfig.widgetCustomizations.buttonStyles.width`            | string    | Launcher button width (e.g. `"60px"`).                  |
| `chatSdkConfig.widgetCustomizations.buttonStyles.height`           | string    | Launcher button height (e.g. `"60px"`).                 |

## Example cURL

```bash theme={null}
curl -X PUT "https://api.inya.ai/platform/v1/agents/fb79920229d144608ebf665a10e50275/chat-sdk-config" \
  -H "x-api-key: <your_api_key>" \
  -H "Content-Type: application/json" \
  -d '{
    "chatSdkConfig": {
      "enabled": true,
      "allowedOrigins": ["https://yourapp.example.com"],
      "windowCustomizations": {
        "header": {
          "title": "Support Chat",
          "subtitle": "How can we help?",
          "backgroundColor": "#1A73E8",
          "textColor": "#FFFFFF"
        },
        "body": {
          "backgroundColor": "#F9FAFB",
          "fontSize": "14px",
          "textColor": "#111827"
        },
        "userMessage": {
          "backgroundColor": "#1A73E8",
          "textColor": "#FFFFFF",
          "fontSize": "14px"
        },
        "botMessage": {
          "backgroundColor": "#E5E7EB",
          "textColor": "#111827",
          "fontSize": "14px"
        },
        "footer": {
          "backgroundColor": "#FFFFFF",
          "infoText": "Powered by Inya",
          "input": {
            "placeholder": "Type your message..."
          },
          "button": {
            "backgroundColor": "#1A73E8",
            "textColor": "#FFFFFF"
          }
        }
      },
      "widgetCustomizations": {
        "buttonStyles": {
          "backgroundColor": "#1A73E8",
          "width": "60px",
          "height": "60px"
        }
      }
    }
  }'
```

## Response

### Success (200)

```json theme={null}
{
  "status": "success",
  "requestId": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
  "message": "Chat SDK config updated successfully",
  "response": {
    "updated": true,
    "botId": "fb79920229d144608ebf665a10e50275"
  }
}
```

### Error Responses

**403 Forbidden** - Insufficient role

```json theme={null}
{
  "status": "failure",
  "requestId": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
  "message": "QA role does not have permission to update chat SDK configuration"
}
```

**404 Not Found** - Agent does not exist

```json theme={null}
{
  "status": "failure",
  "requestId": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
  "message": "Agent not found"
}
```

## Use Cases

* Matching the chat widget to your brand colors and typography
* Customizing the widget for different agents (e.g. support vs. sales)
* Enabling or disabling the widget for a specific agent
* Restricting widget access to specific domains via `allowedOrigins`

<Tip>
  Use **Get Chat Widget Config** first to retrieve the current settings before making partial updates.
</Tip>

<Note>
  Save the `requestId` from every response. You will need it if you contact Inya support to trace a specific request.
</Note>


## OpenAPI

````yaml PUT /v1/agents/{botId}/chat-sdk-config
openapi: 3.0.3
info:
  title: Platform Agents API
  description: API endpoints for creating, managing, and interacting with voice agents
  version: 2.1.0
servers:
  - url: https://api.inya.ai/platform
    description: Production server
security:
  - ApiKeyAuth: []
tags:
  - name: Agents
    description: Agent management operations
  - name: AgentFAQ
    description: Agent FAQ management
  - name: AgentCallTriggers
    description: Outbound call triggers
  - name: ChatSDK
    description: Chat Widget configuration
  - name: Conversations
    description: Conversation logs, statistics, and audio
paths:
  /v1/agents/{botId}/chat-sdk-config:
    put:
      tags:
        - ChatSDK
      summary: Update Chat Widget configuration
      description: >-
        Update the Chat Widget configuration for an agent. All fields are
        optional. Requires ORG_ADMIN or DEVELOPER role.
      operationId: updateChatSdkConfig
      parameters:
        - $ref: '#/components/parameters/AgentId'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateChatSdkConfigRequest'
      responses:
        '200':
          description: Chat SDK config updated successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/StandardResponse'
              examples:
                success:
                  value:
                    status: success
                    requestId: a1b2c3d4-e5f6-7890-abcd-ef1234567890
                    message: Chat SDK config updated successfully
                    response:
                      updated: true
                      botId: fb79920229d144608ebf665a10e50275
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '500':
          $ref: '#/components/responses/ServerError'
components:
  parameters:
    AgentId:
      name: botId
      in: path
      required: true
      description: Unique identifier of the agent
      schema:
        type: string
  schemas:
    UpdateChatSdkConfigRequest:
      type: object
      properties:
        chatSdkConfig:
          type: object
          properties:
            enabled:
              type: boolean
            allowedOrigins:
              type: array
              items:
                type: string
            windowCustomizations:
              type: object
              properties:
                header:
                  type: object
                  properties:
                    title:
                      type: string
                    subtitle:
                      type: string
                    logo:
                      type: string
                    backgroundColor:
                      type: string
                    textColor:
                      type: string
                body:
                  type: object
                  properties:
                    backgroundColor:
                      type: string
                    fontSize:
                      type: string
                    textColor:
                      type: string
                userMessage:
                  type: object
                  properties:
                    backgroundColor:
                      type: string
                    fontSize:
                      type: string
                    textColor:
                      type: string
                botMessage:
                  type: object
                  properties:
                    backgroundColor:
                      type: string
                    fontSize:
                      type: string
                    textColor:
                      type: string
                footer:
                  type: object
                  properties:
                    backgroundColor:
                      type: string
                    textColor:
                      type: string
                    fontSize:
                      type: string
                    infoText:
                      type: string
                    input:
                      type: object
                      properties:
                        backgroundColor:
                          type: string
                        borderColor:
                          type: string
                        textColor:
                          type: string
                        placeholder:
                          type: string
                    button:
                      type: object
                      properties:
                        backgroundColor:
                          type: string
                        textColor:
                          type: string
            widgetCustomizations:
              type: object
              properties:
                buttonStyles:
                  type: object
                  properties:
                    backgroundColor:
                      type: string
                    width:
                      type: string
                    height:
                      type: string
    StandardResponse:
      type: object
      properties:
        status:
          type: string
          example: success
        requestId:
          type: string
          example: a1b2c3d4-e5f6-7890-abcd-ef1234567890
        message:
          type: string
        response:
          type: object
    ErrorResponse:
      type: object
      properties:
        status:
          type: string
          example: error
        requestId:
          type: string
          example: a1b2c3d4-e5f6-7890-abcd-ef1234567890
        message:
          type: string
  responses:
    Forbidden:
      description: Permission denied
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
    NotFound:
      description: Resource not found
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
    ServerError:
      description: Internal server error
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: x-api-key
      description: API key with 'agents' permission

````