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

# Create or update the website chat

> Creates the website chat, or changes the one that exists. Answers 201 with the snippet. `allowed_origins` is required. Needs the `channels:write` scope.



## OpenAPI

````yaml /openapi/partner.yaml post /api/v1/partner/tenants/{external_ref}/channels/website/
openapi: 3.1.0
info:
  title: ImpelLabs Partner API
  version: '1'
  description: >-
    The Partner API provisions customer businesses (tenants) and runs their
    channels, conversations and templates from your own product. Call it from
    your server with a partner key. Every path ends with a slash.
servers:
  - url: https://api.impellabs.tech
security:
  - bearer: []
tags:
  - name: Keys
    description: Your partner API keys.
  - name: Tenants
    description: Customer businesses, their channels, conversations and templates.
  - name: Webhooks
    description: Where your tenants' events go.
  - name: WhatsApp sign-up
    description: The settings of the hosted WhatsApp sign-up.
paths:
  /api/v1/partner/tenants/{external_ref}/channels/website/:
    post:
      tags:
        - Tenants
      summary: Create or update the website chat
      description: >-
        Creates the website chat, or changes the one that exists. Answers 201
        with the snippet. `allowed_origins` is required. Needs the
        `channels:write` scope.
      operationId: post_api_v1_partner_tenants_external_ref_channels_website
      parameters:
        - name: external_ref
          in: path
          required: true
          schema:
            type: string
          description: Your own id for the customer business, set when you created it.
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                allowed_origins:
                  type: array
                  items:
                    type: string
                  description: The sites that may show the chat. An empty list is refused.
                name:
                  type: string
                  description: A name for the chat. Default `Website chat`.
                brand_color:
                  type: string
                  description: A colour as `#RRGGBB`.
              required:
                - allowed_origins
            example:
              allowed_origins:
                - https://example.org
              brand_color: '#1e417d'
        required: true
      responses:
        '201':
          description: Success
          content:
            application/json:
              example:
                configured: true
                id: 3b4c5d6e-0000-4000-8000-000000000000
                name: Website chat
                public_key: PUBLIC_KEY
                allowed_origins:
                  - https://example.org
                brand_color: '#1e417d'
                is_active: true
                sdk_url: https://cdn.impellabs.tech/sdk/impel-chat.js
                api_base_url: https://api.impellabs.tech/api/v1
                embed_snippet: >-
                  <script src="https://cdn.impellabs.tech/sdk/impel-chat.js"
                  data-impel-key="PUBLIC_KEY"
                  data-api-base-url="https://api.impellabs.tech/api/v1"
                  data-brand-color="#1e417d" defer></script>
        '400':
          $ref: '#/components/responses/Invalid'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        4XX:
          description: The request is not valid or not allowed
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
components:
  responses:
    Invalid:
      description: >-
        A field is missing or wrong. The body names each field: {"field": "what
        to fix"}.
    Unauthorized:
      description: The credentials are missing, wrong, expired or revoked.
    Forbidden:
      description: These credentials may not do this.
    NotFound:
      description: There is no such row, or these credentials cannot see it.
  schemas:
    Error:
      type: object
      description: >-
        An error. Most errors carry `detail`. Some carry `error` with `code` and
        `message`.
      properties:
        detail:
          type: string
        code:
          type: string
        field:
          type: string
        error:
          type: object
          properties:
            code:
              type: string
            message:
              type: string
  securitySchemes:
    bearer:
      type: http
      scheme: bearer

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.