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

# Upload Chat Widget Icon

> Upload a custom launcher icon for the Chat Widget

## Overview

Upload a custom image to replace the Chat Widget's floating launcher button icon. The uploaded file is stored and applied to the widget immediately after upload.

Requires the `ORG_ADMIN` or `DEVELOPER` role.

## Required Permission

`agents` — `ORG_ADMIN` or `DEVELOPER` role

## Path Parameters

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

## Request

Send the request as `multipart/form-data` with a single field named `file` containing the image. When using cURL with the `-F` flag, the `Content-Type` header is set automatically.

**Accepted formats:** JPEG, PNG, GIF, BMP, WebP, TIFF, SVG

## Example cURL

```bash theme={null}
curl -X POST "https://api.inya.ai/platform/v1/agents/fb79920229d144608ebf665a10e50275/chat-sdk-icon" \
  -H "x-api-key: <your_api_key>" \
  -F "file=@/path/to/your/icon.png"
```

## Response

### Success (200)

```json theme={null}
{
  "status": "success",
  "requestId": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
  "message": "File uploaded successfully",
  "response": {
    "fileUrl": "https://your-storage.blob.core.windows.net/..."
  }
}
```

## Response Fields

| Field     | Type   | Description                                                                              |
| --------- | ------ | ---------------------------------------------------------------------------------------- |
| `fileUrl` | string | URL of the uploaded icon file. Use this URL in your chat widget configuration if needed. |

### Error Responses

| Status | Condition                    | Message                                                                  |
| ------ | ---------------------------- | ------------------------------------------------------------------------ |
| `400`  | Unsupported file type        | `Unsupported image type. Allowed: JPEG, PNG, GIF, BMP, WebP, TIFF, SVG.` |
| `403`  | QA role attempted the upload | `QA role does not have permission to update agents.`                     |
| `404`  | Agent not found              | `Agent not found`                                                        |

## Use Cases

* Branding the chat widget launcher with your company logo
* Using a different icon per agent to reflect different product lines
* Updating the icon after a brand refresh

<Note>
  For best results, use a square image of at least 60×60 pixels. PNG or WebP with a transparent background renders cleanly on any launcher button color.
</Note>

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


## OpenAPI

````yaml POST /v1/agents/{botId}/chat-sdk-icon
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-icon:
    post:
      tags:
        - ChatSDK
      summary: Upload Chat Widget icon
      description: >-
        Upload a custom launcher icon image for the Chat Widget. Accepted
        formats JPEG, PNG, GIF, BMP, WebP, TIFF, SVG. Requires ORG_ADMIN or
        DEVELOPER role.
      operationId: uploadChatSdkIcon
      parameters:
        - $ref: '#/components/parameters/AgentId'
      requestBody:
        required: true
        content:
          multipart/form-data:
            schema:
              type: object
              required:
                - file
              properties:
                file:
                  type: string
                  format: binary
                  description: Icon image file (JPEG, PNG, GIF, BMP, WebP, TIFF, SVG)
      responses:
        '200':
          description: File uploaded successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/StandardResponse'
              examples:
                success:
                  value:
                    status: success
                    requestId: a1b2c3d4-e5f6-7890-abcd-ef1234567890
                    message: File uploaded successfully
                    response:
                      fileUrl: https://your-storage.blob.core.windows.net/...
        '400':
          description: Unsupported file type
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              examples:
                unsupportedType:
                  value:
                    status: failure
                    requestId: a1b2c3d4-e5f6-7890-abcd-ef1234567890
                    message: >-
                      Unsupported image type. Allowed: JPEG, PNG, GIF, BMP,
                      WebP, TIFF, SVG.
        '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:
    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

````