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

# Update webchat configuration

> Update mutable fields on a webchat widget. `icon` accepts an empty string or null to clear the configured icon.



## OpenAPI

````yaml /api-reference/openapi.yaml put /api/webchats/{id}
openapi: 3.0.3
info:
  title: Tether Relay and Tether API
  version: 1.0.0
  description: >-
    Route-derived OpenAPI contract generated from tether-relay backend sources.
    Regenerate with scripts/sync-openapi-from-backend.mjs.
servers:
  - url: https://your-instance.example.com
    description: Production
  - url: http://localhost:2212
    description: Local API service
security: []
tags:
  - name: AI
  - name: Applications
  - name: Approval
  - name: Auth
  - name: Automations
  - name: Calls
  - name: Campaigns
  - name: Contact Analytics
  - name: Contact Metrics
  - name: Contact Notes
  - name: Contacts
  - name: Conversation Monitor
  - name: Conversations
  - name: Departments
  - name: Email
  - name: Escalation Dashboard
  - name: Event Logs
  - name: Google Sheets
  - name: Marketplace
  - name: Messages
  - name: Notification Sounds
  - name: Notifications
  - name: Org Snapshots
  - name: Organizations
  - name: Outreach
  - name: Outreach Metrics
  - name: Outreach Sources
  - name: Pipelines
  - name: Processes
  - name: Prompts
  - name: Reminders
  - name: Sms
  - name: Templates
  - name: Traces
  - name: Training
  - name: Upload
  - name: User Snapshots
  - name: Users
  - name: Vertical
  - name: Webchats
  - name: Webhook
paths:
  /api/webchats/{id}:
    put:
      tags:
        - Webchats
      summary: Update webchat configuration
      description: >-
        Update mutable fields on a webchat widget. `icon` accepts an empty
        string or null to clear the configured icon.
      operationId: put_webchat
      parameters:
        - in: path
          name: id
          required: true
          schema:
            type: string
      requestBody:
        required: false
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateWebchatRequest'
      responses:
        '200':
          description: Webchat configuration updated
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/WebchatMutationResponse'
        '400':
          description: Invalid input
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/WebchatErrorResponse'
        '404':
          description: Webchat configuration not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/WebchatErrorResponse'
        '500':
          description: Failed to update webchat configuration
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/WebchatErrorResponse'
      security:
        - bearerAuth: []
components:
  schemas:
    UpdateWebchatRequest:
      type: object
      properties:
        name:
          type: string
        description:
          type: string
        starterMessage:
          type: string
        backgroundColor:
          type: string
        primaryColor:
          type: string
        secondaryColor:
          type: string
        icon:
          type: string
          nullable: true
          description: Set to empty string or null to remove icon
        headerTextColor:
          type: string
        statusText:
          type: string
        statusTextColor:
          type: string
        timestampColor:
          type: string
        csatBackgroundColor:
          type: string
        csatTextColor:
          type: string
        csatThankYouMessage:
          type: string
        promptId:
          type: string
        allowedDomains:
          type: array
          items:
            type: string
        pipelineId:
          type: string
        pipelineStage:
          type: string
        initialStage:
          type: string
        isAutopilot:
          type: boolean
        isEnabled:
          type: boolean
      additionalProperties: true
      example:
        starterMessage: Hi! Looking for help today?
        isEnabled: true
        allowedDomains:
          - https://example.com
          - https://help.example.com
    WebchatMutationResponse:
      type: object
      description: Response from `POST /api/webchats` and `PUT /api/webchats/{id}`.
      properties:
        message:
          type: string
        data:
          $ref: '#/components/schemas/WebchatDto'
      required:
        - data
      additionalProperties: true
      example:
        message: Webchat configuration created
        data:
          _id: 67d3a0b0c0d0e0f0a0b0c0d0
          name: Marketing site widget
          isEnabled: true
    WebchatErrorResponse:
      type: object
      description: Error envelope returned by webchat endpoints.
      properties:
        error:
          type: string
        details:
          type: string
      required:
        - error
      additionalProperties: true
      example:
        error: Webchat configuration not found
        details: NOT_FOUND
    WebchatDto:
      type: object
      description: >-
        Stored webchat configuration document. The `icon` field, when present,
        is a freshly-signed URL pointing at the R2-hosted asset (the database
        stores the storage key).
      properties:
        _id:
          type: string
        organizationId:
          type: string
        userId:
          type: string
          description: >-
            Contact owner. Inbound contacts created from this webchat are routed
            to this user.
        createdBy:
          type: string
        name:
          type: string
        description:
          type: string
        starterMessage:
          type: string
        backgroundColor:
          type: string
        primaryColor:
          type: string
        secondaryColor:
          type: string
        icon:
          type: string
          nullable: true
          description: Signed R2 URL for the icon image. `null` when no icon is configured.
        headerTextColor:
          type: string
        statusText:
          type: string
        statusTextColor:
          type: string
        timestampColor:
          type: string
        csatBackgroundColor:
          type: string
        csatTextColor:
          type: string
        csatThankYouMessage:
          type: string
        promptId:
          type: string
        allowedDomains:
          type: array
          items:
            type: string
        pipelineId:
          type: string
          nullable: true
        pipelineStage:
          type: string
          nullable: true
        initialStage:
          type: string
        isAutopilot:
          type: boolean
        isEnabled:
          type: boolean
        position:
          type: string
        offsetX:
          type: number
        offsetY:
          type: number
        zIndex:
          type: number
        initialState:
          type: string
        autoOpenDelay:
          type: number
        autoOpenOnScroll:
          type: number
        mobileBreakpoint:
          type: number
        allowedPages:
          type: array
          items:
            type: string
        headless:
          type: boolean
        pageContext:
          type: boolean
        pageContextPrompt:
          type: string
        createdAt:
          type: string
          format: date-time
        updatedAt:
          type: string
          format: date-time
      additionalProperties: true
      example:
        _id: 67d3a0b0c0d0e0f0a0b0c0d0
        organizationId: 65a0e0e0e0e0e0e0e0e0e0e0
        userId: 65b1f0a2c3d4e5f6a7b8c9d0
        createdBy: 65b1f0a2c3d4e5f6a7b8c9d0
        name: Marketing site widget
        description: Bottom-right widget on the marketing site
        starterMessage: Hi! Looking for pricing?
        backgroundColor: '#FFFFFF'
        primaryColor: '#1F2937'
        secondaryColor: '#3B82F6'
        icon: https://r2.example.com/orgs/65a0.../webchat/icon.png?token=...
        promptId: 65b2a1c3d4e5f6a7b8c9d0e1
        allowedDomains:
          - https://example.com
        pipelineId: 66f0a0b0c0d0e0f0a0b0c0d0
        initialStage: new
        isAutopilot: true
        isEnabled: true
        position: bottom-right
        offsetX: 24
        offsetY: 24
        zIndex: 9999
        createdAt: '2026-03-12T10:00:00.000Z'
        updatedAt: '2026-05-18T14:00:00.000Z'
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT

````