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

# Get widget snippet

> Returns the script tag that embeds the chat widget on a website, filled in for this project and environment, to place before each page's closing body tag.



## OpenAPI

````yaml /specs-prettified/realtime/openapi.stable.json get /v1/stable/widget/snippet
openapi: 3.0.0
info:
  title: Realtime
  description: Realtime gateway API service
  version: 1.0.0
  contact: {}
servers:
  - url: https://realtime-api.voiceflow.com
security: []
tags: []
paths:
  /v1/stable/widget/snippet:
    get:
      tags:
        - Widget
      summary: Get widget snippet
      description: Returns the script tag that embeds the chat widget on a website,
        filled in for this project and environment, to place before each page's
        closing body tag.
      operationId: StableWidgetController_getSnippet
      parameters:
        - name: projectID
          required: true
          in: query
          schema:
            type: string
            description: The ID of the project to operate on.
        - name: environmentAlias
          required: true
          in: query
          schema:
            type: string
            description: The alias of the environment to operate on (e.g. `main`).
        - name: version
          required: false
          in: query
          schema:
            default: published
            description: "Pins the embed to one version of the environment: `draft`, the
              version used when testing, or `published`, the version serving
              live traffic. Omit it to pin the snippet to `published`."
            type: string
            enum:
              - draft
              - published
            x-enumNames:
              - DRAFT
              - PUBLISHED
      responses:
        "200":
          description: Returns the complete `<script>` tag to paste into the website,
            built from the environment's widget configuration at the requested
            version.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/StableWidgetGetSnippetResponse"
          x-vf-doc:
            description: Returns the complete `<script>` tag to paste into the website,
              built from the environment's widget configuration at the requested
              version.
      security:
        - token: []
components:
  schemas:
    StableWidgetGetSnippetResponse:
      type: object
      properties:
        snippet:
          type: string
          description: The complete `<script>` tag to paste into the website, just before
            the closing `</body>` of every page the widget should appear on.
            Already filled in with the right verification key, runtime endpoints
            and render block — it is meant to be copied verbatim, not edited.
      required:
        - snippet
  securitySchemes:
    token:
      scheme: bearer
      bearerFormat: JWT
      type: http
      description: Voiceflow bearer token
````
