> ## 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.

# Get Chat Widget Config

> Retrieve the current Chat Widget configuration for an agent

## Overview

Retrieve the complete Chat Widget (Chat SDK) configuration for a specific agent. This includes all visual customizations for the chat window and launcher button, the list of allowed origins for CORS, and whether the widget is currently enabled.

Use this endpoint to inspect the current widget settings before making updates via **Update Chat Widget Config**.

## Required Permission

`agents`

## Path Parameters

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

## Query Parameters

| Name          | Type   | Required | Description                                 |
| ------------- | ------ | -------- | ------------------------------------------- |
| `environment` | string | No       | Target environment. Default: `development`. |

## Example cURL

```bash theme={null}
curl "https://api.inya.ai/platform/v1/agents/fb79920229d144608ebf665a10e50275/chat-sdk-config?environment=development" \
  -H "x-api-key: <your_api_key>"
```

## Response

### Success (200)

```json theme={null}
{
  "status": "success",
  "requestId": "71b1f0ad-b3eb-46cc-b04d-37f020cbbe43",
  "message": "Chat SDK config retrieved successfully",
  "response": {
    "chatSdkConfig": {
      "enabled": true,
      "allowedOrigins": ["https://example.com"],
      "windowCustomizations": {
        "header": {
          "title": "Support Bot",
          "subtitle": "How can I help you?",
          "logo": "https://example.com/logo.svg",
          "backgroundColor": "#1A73E8",
          "textColor": "#FFFFFF"
        },
        "body": {
          "backgroundColor": "#ffffff",
          "fontSize": "14px",
          "textColor": "#101828"
        },
        "userMessage": {
          "backgroundColor": "#0087c7",
          "fontSize": "14px",
          "textColor": "#ffffff"
        },
        "botMessage": {
          "backgroundColor": "#f9fafb",
          "fontSize": "14px",
          "textColor": "#101828"
        },
        "footer": {
          "backgroundColor": "#ffffff",
          "textColor": "#101828",
          "fontSize": "14px",
          "infoText": "Powered by Inya",
          "input": {
            "backgroundColor": "#ffffff",
            "borderColor": "#0087c7",
            "textColor": "#101828",
            "placeholder": "Type here..."
          },
          "button": {
            "backgroundColor": "#101828",
            "textColor": "#ffffff"
          }
        }
      },
      "widgetCustomizations": {
        "buttonStyles": {
          "backgroundColor": "#1A73E8",
          "width": "60px",
          "height": "60px"
        }
      },
      "quickActions": null,
      "callTransfer": null,
      "clearChat": null
    }
  }
}
```

## Response Fields

### `response.chatSdkConfig`

| Field            | Type           | Description                                                                        |
| ---------------- | -------------- | ---------------------------------------------------------------------------------- |
| `enabled`        | boolean        | Whether the Chat Widget is currently active.                                       |
| `allowedOrigins` | string\[]      | Whitelisted domains permitted to embed and use the widget (CORS).                  |
| `quickActions`   | object \| null | Quick-reply action buttons shown to the user. `null` if not configured.            |
| `callTransfer`   | object \| null | Configuration for transferring the chat to a live agent. `null` if not configured. |
| `clearChat`      | object \| null | Configuration for the clear-chat control. `null` if not configured.                |

### `windowCustomizations`

| Section       | Fields                                                                    | Description                                                |
| ------------- | ------------------------------------------------------------------------- | ---------------------------------------------------------- |
| `header`      | `title`, `subtitle`, `logo`, `backgroundColor`, `textColor`               | Chat window header bar appearance.                         |
| `body`        | `backgroundColor`, `fontSize`, `textColor`                                | Chat transcript area background and text styles.           |
| `userMessage` | `backgroundColor`, `fontSize`, `textColor`                                | Style for user-sent message bubbles.                       |
| `botMessage`  | `backgroundColor`, `fontSize`, `textColor`                                | Style for agent-sent message bubbles.                      |
| `footer`      | `backgroundColor`, `textColor`, `fontSize`, `infoText`, `input`, `button` | Footer bar including the text input field and send button. |

### `widgetCustomizations`

| Section        | Fields                               | Description                                                         |
| -------------- | ------------------------------------ | ------------------------------------------------------------------- |
| `buttonStyles` | `backgroundColor`, `width`, `height` | Styles for the floating launcher button that opens the chat window. |

### Error Responses

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

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

## Use Cases

* Retrieving widget configuration before updating it
* Displaying current widget settings in an administration dashboard
* Exporting widget configuration for backup or audit purposes

<Tip>
  Fetch the current configuration before making updates so you can perform partial modifications without overwriting fields you intend to keep.
</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 GET /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:
    get:
      tags:
        - ChatSDK
      summary: Get Chat Widget configuration
      description: Retrieve the current Chat Widget configuration for an agent.
      operationId: getChatSdkConfig
      parameters:
        - $ref: '#/components/parameters/AgentId'
        - name: environment
          in: query
          description: Target environment. Default is development.
          required: false
          schema:
            type: string
            enum:
              - development
              - staging
              - production
            default: development
      responses:
        '200':
          description: Chat widget config retrieved successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/StandardResponse'
              examples:
                success:
                  value:
                    status: success
                    requestId: 71b1f0ad-b3eb-46cc-b04d-37f020cbbe43
                    message: Chat SDK config retrieved successfully
                    response:
                      chatSdkConfig:
                        enabled: true
                        allowedOrigins:
                          - https://example.com
                        windowCustomizations:
                          header:
                            title: Support Bot
                            subtitle: How can I help you?
                            logo: https://example.com/logo.svg
                            backgroundColor: '#1A73E8'
                            textColor: '#FFFFFF'
                          body:
                            backgroundColor: '#ffffff'
                            fontSize: 14px
                            textColor: '#101828'
                          userMessage:
                            backgroundColor: '#0087c7'
                            fontSize: 14px
                            textColor: '#ffffff'
                          botMessage:
                            backgroundColor: '#f9fafb'
                            fontSize: 14px
                            textColor: '#101828'
                          footer:
                            backgroundColor: '#ffffff'
                            textColor: '#101828'
                            fontSize: 14px
                            infoText: Powered by Inya
                            input:
                              backgroundColor: '#ffffff'
                              borderColor: '#0087c7'
                              textColor: '#101828'
                              placeholder: Type here...
                            button:
                              backgroundColor: '#101828'
                              textColor: '#ffffff'
                        widgetCustomizations:
                          buttonStyles:
                            backgroundColor: '#1A73E8'
                            width: 60px
                            height: 60px
                        quickActions: null
                        callTransfer: null
                        clearChat: null
        '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:
    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:
    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

````