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

# Website chat

> Create the website chat of a tenant and get the snippet to put on its site.

Website chat needs no account at a provider. You give the sites that may show the chat, and the call answers with a
snippet. The widget itself is described in [the chat widget](https://docs.impellabs.tech/developers/widget.md).

## Create the chat

```bash theme={null}
curl -X POST https://api.impellabs.tech/api/v1/partner/tenants/acme-001/channels/website/ \
  -H "Authorization: Bearer implpk_..." \
  -H "Content-Type: application/json" \
  -d '{
    "allowed_origins": ["https://acmedental.yourcompany.test"],
    "brand_color": "#1e417d"
  }'
```

| Field | Rule |
| - | - |
| `allowed_origins` | Required. A list of sites. An empty list is refused. |
| `name` | Optional. Default `Website chat`. |
| `brand_color` | Optional. A colour as `#RRGGBB`. |

The answer is 201.

```json theme={null}
{
  "id": "3b4c5d6e-0000-4000-8000-000000000000",
  "name": "Website chat",
  "public_key": "PUBLIC_KEY",
  "allowed_origins": ["https://acmedental.yourcompany.test"],
  "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>"
}
```

Put `embed_snippet` on the pages of the customer's site. The `public_key` is public by design. It works only from the sites
in `allowed_origins`.

## Read or change the chat

`GET /api/v1/partner/tenants/{external_ref}/channels/website/` returns the same object with `configured` set to `true`, or
`{ "configured": false }` when the tenant has no chat.

A second `POST` changes the chat that exists. It keeps the key, so a snippet that is on a site keeps working. The greeting,
the suggestions and the waiting message stay as they are.

## Conversations

A visitor's chat is a conversation with the channel `website`. See [Conversations](https://docs.impellabs.tech/partners/conversations.md). A website
chat takes text only from a person.


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