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

# Get webchat embed script

> Public endpoint returning the JavaScript webchat widget loader with the resolved configuration (colors, position, starter message, etc.) inlined. Used by the `<script src="…webchat-script?webchatConfigId=…">` tag a customer pastes onto their site.



## OpenAPI

````yaml /api-reference/openapi.yaml get /api/webhook/webchat-script
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/webhook/webchat-script:
    get:
      tags:
        - Webhooks
      summary: Get webchat embed script
      description: >-
        Public endpoint returning the JavaScript webchat widget loader with the
        resolved configuration (colors, position, starter message, etc.)
        inlined. Used by the `<script src="…webchat-script?webchatConfigId=…">`
        tag a customer pastes onto their site.
      operationId: get_webhook_webchat_script
      parameters:
        - in: query
          name: webchatConfigId
          required: true
          schema:
            type: string
      responses:
        '200':
          description: >-
            JavaScript embed script with the resolved webchat configuration
            inlined.
          content:
            application/javascript:
              schema:
                type: string
              example: >-
                (function(){var
                w=window,d=document,c={webchatConfigId:"64a1b2c3d4e5f60012345678",primaryColor:"#3B82F6",position:"bottom-right",starterMessage:"Hi!
                How can we
                help?",apiBaseUrl:"https://api.tetherai.ca"};w.__TETHER_WEBCHAT__=c;var
                s=d.createElement("script");s.src=c.apiBaseUrl+"/static/webchat-runtime.js";s.async=true;d.head.appendChild(s);})();
        '400':
          description: webchatConfigId is required
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/WebhookAssetErrorResponse'
        '404':
          description: Webchat configuration not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/WebhookAssetErrorResponse'
components:
  schemas:
    WebhookAssetErrorResponse:
      type: object
      description: >-
        Error envelope returned by the static-asset webhook routes
        (`/api/webhook/webchat-script` and `/api/webhook/notification-sound`).
        The 200 path serves binary/script content; only failure responses are
        JSON.
      properties:
        error:
          type: string
        message:
          type: string
      additionalProperties: true
      example:
        error: Webchat configuration not found

````